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.

115 lines
2.5 KiB

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