Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. cenumjob.hxx
  5. Abstract:
  6. Contains definitions for CWinNTPrintJobsCollection
  7. and for CWinNTJobsEnumVar
  8. Author:
  9. Ram Viswanathan (ramv) 11-28-95
  10. Revision History:
  11. --*/
  12. class CWinNTJobsEnumVar;
  13. class CWinNTPrintJobsCollection: INHERIT_TRACKING,
  14. ISupportErrorInfo,
  15. public IADsCollection
  16. {
  17. public:
  18. /* IUnknown methods */
  19. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  20. DECLARE_STD_REFCOUNTING;
  21. DECLARE_IDispatch_METHODS;
  22. DECLARE_ISupportErrorInfo_METHODS;
  23. DECLARE_IADsCollection_METHODS;
  24. //
  25. // constructor and destructor
  26. //
  27. CWinNTPrintJobsCollection();
  28. ~CWinNTPrintJobsCollection();
  29. static HRESULT Create(LPWSTR pszPrinterADsPath,
  30. CWinNTCredentials& Credentials,
  31. CWinNTPrintJobsCollection ** ppJobsCollection
  32. );
  33. protected:
  34. CAggregatorDispMgr * _pDispMgr;
  35. CWinNTJobsEnumVar *_pCJobsEnumVar;
  36. HANDLE _hPrinter;
  37. LPWSTR _pszPrinterName;
  38. LPWSTR _pszADsPrinterPath;
  39. CWinNTCredentials _Credentials;
  40. };
  41. class CWinNTJobsEnumVar : INHERIT_TRACKING,
  42. public IEnumVARIANT
  43. {
  44. public:
  45. /* IUnknown methods */
  46. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  47. DECLARE_STD_REFCOUNTING;
  48. DECLARE_IEnumVARIANT_METHODS;
  49. static HRESULT Create(HANDLE hprinter,
  50. LPTSTR pszADsPrinterPath,
  51. CWinNTCredentials& Credentials,
  52. CWinNTJobsEnumVar FAR* FAR*);
  53. CWinNTJobsEnumVar();
  54. ~CWinNTJobsEnumVar();
  55. //
  56. // Helper functions
  57. //
  58. friend HRESULT FillSafeArray(HANDLE hPrinter,
  59. LPTSTR pszPrinterPath,
  60. CWinNTCredentials& Credentials,
  61. CWinNTJobsEnumVar * pJobsEnumVar);
  62. protected:
  63. LPWSTR _pszADsPrinterPath;
  64. SAFEARRAY FAR* _pSafeArray;
  65. LONG _lCurrentPosition;
  66. ULONG _cElements;
  67. LONG _lLBound;
  68. ULONG _cMax;
  69. CWinNTCredentials _Credentials;
  70. };
  71. //
  72. // Helper functions
  73. //
  74. BOOL
  75. MyEnumJobs(HANDLE hPrinter,
  76. DWORD dwFirstJob,
  77. DWORD dwNoJobs,
  78. DWORD dwLevel,
  79. LPBYTE *lplpbJobs,
  80. DWORD *pcbBuf,
  81. LPDWORD lpdwReturned
  82. );