Leaked source code of windows server 2003
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.

107 lines
2.3 KiB

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