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.

113 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. cenumres.hxx
  5. Abstract:
  6. Contains definitions for CWinNTResourcesCollection
  7. and for CWinNTResourcesEnumVar
  8. Author:
  9. Ram Viswanathan (ramv) 02-12-96
  10. Revision History:
  11. --*/
  12. class CWinNTResourcesEnumVar;
  13. class CWinNTResourcesCollection: INHERIT_TRACKING,
  14. public 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. CWinNTResourcesCollection();
  28. ~CWinNTResourcesCollection();
  29. static HRESULT Create(LPTSTR pszServerADsPath,
  30. LPTSTR pszBasePath,
  31. LPTSTR pszUserName,
  32. CWinNTCredentials& Credentials,
  33. CWinNTResourcesCollection ** ppResourcesCollection
  34. );
  35. protected:
  36. CAggregatorDispMgr * _pDispMgr;
  37. CWinNTResourcesEnumVar *_pCResourcesEnumVar;
  38. LPWSTR _pszServerADsPath;
  39. LPWSTR _pszServerName;
  40. LPWSTR _pszBasePath;
  41. LPWSTR _pszUserName;
  42. CWinNTCredentials _Credentials;
  43. };
  44. class CWinNTResourcesEnumVar : public CWinNTEnumVariant
  45. {
  46. public:
  47. static HRESULT Create(LPTSTR pszServerADsPath,
  48. LPTSTR pszBasePath,
  49. LPTSTR pszUserName,
  50. CWinNTCredentials& Credentials,
  51. CWinNTResourcesEnumVar **pCResourcesEnumVar
  52. );
  53. CWinNTResourcesEnumVar();
  54. ~CWinNTResourcesEnumVar();
  55. protected:
  56. LPWSTR _pszServerName;
  57. LPWSTR _pszServerADsPath;
  58. LPWSTR _pszBasePath;
  59. LPWSTR _pszUserName;
  60. LONG _lCurrentPosition;
  61. ULONG _cElements;
  62. LONG _lLBound;
  63. DWORD_PTR _dwResumeHandle;
  64. DWORD _dwTotalEntries;
  65. LPBYTE _pbResources;
  66. CWinNTCredentials _Credentials;
  67. STDMETHOD(Next)(
  68. ULONG cElements,
  69. VARIANT FAR* pvar,
  70. ULONG FAR* pcElementFetched
  71. );
  72. };
  73. //
  74. // Helper functions
  75. //
  76. HRESULT
  77. WinNTEnumResources(LPTSTR pszServerName,
  78. LPTSTR pszBasePath,
  79. LPTSTR pszUserName,
  80. LPBYTE * ppMem,
  81. LPDWORD pdwEntriesRead,
  82. LPDWORD pdwTotalEntries,
  83. PDWORD_PTR pdwResumeHandle
  84. );