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.

219 lines
8.4 KiB

  1. /******************************************************************
  2. Copyright (C) 2001 Microsoft Corp.
  3. sdwmi.H -- WMI provider class definition
  4. Description:
  5. *******************************************************************/
  6. // Property set identification
  7. //============================
  8. #ifndef _SessionDirectory_H_
  9. #define _SessionDirectory_H_
  10. #include "resource.h"
  11. //#include <utilsub.h>
  12. #include <allproc.h>
  13. #include "trace.h"
  14. #include "jetrpc.h"
  15. #define SDWMI_NAME_LENGTH 64
  16. #define TSSD_NameLength 128
  17. #define PROVIDER_NAME_Win32_WIN32_SESSIONDIRECTORYCLUSTER_Prov L"Win32_SessionDirectoryCluster"
  18. #define PROVIDER_NAME_Win32_WIN32_SESSIONDIRECTORYSERVER_Prov L"Win32_SessionDirectoryServer"
  19. #define PROVIDER_NAME_Win32_WIN32_SESSIONDIRECTORYSESSION_Prov L"Win32_SessionDirectorySession"
  20. #define SIZE_OF_BUFFER( x ) sizeof( x ) / sizeof( TCHAR )
  21. extern BOOL g_bInitialized;
  22. // See ExecQuery for details of the usage of these #defines
  23. #define BIT_CLUSTERNAME 0x00000001
  24. #define BIT_NUMBEROFSERVERS 0x00000002
  25. #define BIT_SINGLESESSIONMODE 0x00000004
  26. #define BIT_SERVERNAME 0x00000008
  27. #define BIT_SERVERIPADDRESS 0x00000010
  28. #define BIT_NUMBEROFSESSIONS 0x00000020
  29. #define BIT_USERNAME 0x00000040
  30. #define BIT_DOMAINNAME 0x00000080
  31. #define BIT_SESSIONID 0x00000100
  32. #define BIT_TSPROTOCOL 0x00000200
  33. #define BIT_APPLICATIONTYPE 0x00000400
  34. #define BIT_RESOLUTIONWIDTH 0x00000800
  35. #define BIT_RESOLUTIONHEIGHT 0x00001000
  36. #define BIT_COLORDEPTH 0x00002000
  37. #define BIT_CREATETIME 0x00004000
  38. #define BIT_DISCONNECTTIME 0x00008000
  39. #define BIT_SESSIONSTATE 0x00010000
  40. #define BIT_ALL_PROPERTIES 0xffffffff
  41. //=---------
  42. class CWin32_SessionDirectoryCluster : public Provider
  43. {
  44. public:
  45. // Constructor/destructor
  46. //=======================
  47. CWin32_SessionDirectoryCluster(LPCWSTR lpwszClassName, LPCWSTR lpwszNameSpace);
  48. virtual ~CWin32_SessionDirectoryCluster();
  49. protected:
  50. // Reading Functions
  51. //============================
  52. virtual HRESULT EnumerateInstances(MethodContext* pMethodContext, long lFlags = 0L);
  53. virtual HRESULT GetObject(CInstance* pInstance, long lFlags, CFrameworkQuery &Query);
  54. virtual HRESULT ExecQuery(MethodContext *pMethodContext, CFrameworkQuery& Query, long lFlags = 0L);
  55. // Writing Functions
  56. //============================
  57. virtual HRESULT PutInstance(const CInstance& Instance, long lFlags = 0L);
  58. virtual HRESULT DeleteInstance(const CInstance& Instance, long lFlags = 0L);
  59. // Other Functions
  60. //virtual HRESULT ExecMethod(const CInstance& Instance,
  61. // const BSTR bstrMethodName,
  62. // CInstance *pInParams,
  63. // CInstance *pOutParams,
  64. // long lFlags = 0L );
  65. HRESULT LoadPropertyValues(CInstance *pInstance, DWORD dwIndex, DWORD dwRequiredProperties);
  66. // TO DO: Declare any additional functions and accessor
  67. // functions for private data used by this class
  68. //===========================================================
  69. private:
  70. // All data members for CTerminalWinstation should be included here.
  71. BOOL IsInList(const CHStringArray &asArray, LPCWSTR pszString);
  72. TCHAR m_szClusterName[SDWMI_NAME_LENGTH];
  73. TCHAR m_szNumberOfServers[SDWMI_NAME_LENGTH];
  74. TCHAR m_szSingleSessionMode[SDWMI_NAME_LENGTH];
  75. //TCHAR m_szSetNumberOfSessions[ SDWMI_NAME_LENGTH ];
  76. TSSD_ClusterInfo *m_pClusterInfo;
  77. } ;
  78. class CWin32_SessionDirectoryServer : public Provider
  79. {
  80. public:
  81. // Constructor/destructor
  82. //=======================
  83. CWin32_SessionDirectoryServer(LPCWSTR lpwszClassName, LPCWSTR lpwszNameSpace);
  84. virtual ~CWin32_SessionDirectoryServer();
  85. protected:
  86. // Reading Functions
  87. //============================
  88. virtual HRESULT EnumerateInstances(MethodContext* pMethodContext, long lFlags = 0L);
  89. virtual HRESULT GetObject(CInstance* pInstance, long lFlags, CFrameworkQuery &Query);
  90. virtual HRESULT ExecQuery(MethodContext *pMethodContext, CFrameworkQuery& Query, long lFlags = 0L);
  91. // Writing Functions
  92. //============================
  93. virtual HRESULT PutInstance(const CInstance& Instance, long lFlags = 0L);
  94. virtual HRESULT DeleteInstance(const CInstance& Instance, long lFlags = 0L);
  95. // Other Functions
  96. //virtual HRESULT ExecMethod(const CInstance& Instance,
  97. // const BSTR bstrMethodName,
  98. // CInstance *pInParams,
  99. // CInstance *pOutParams,
  100. // long lFlags = 0L );
  101. HRESULT LoadPropertyValues(CInstance *pInstance, DWORD dwIndex, DWORD dwRequiredProperties);
  102. // TO DO: Declare any additional functions and accessor
  103. // functions for private data used by this class
  104. //===========================================================
  105. private:
  106. // All data members for CWin32_SessionDirectoryServer should be included here.
  107. BOOL IsInList(const CHStringArray &asArray, LPCWSTR pszString);
  108. TCHAR m_szServerName[SDWMI_NAME_LENGTH];
  109. TCHAR m_szServerIPAddress[SDWMI_NAME_LENGTH];
  110. TCHAR m_szClusterName[SDWMI_NAME_LENGTH];
  111. TCHAR m_szNumberOfSessions[SDWMI_NAME_LENGTH];
  112. TCHAR m_szSingleSessionMode[SDWMI_NAME_LENGTH];
  113. //TCHAR m_szSetNumberOfSessions[ SDWMI_NAME_LENGTH ];
  114. TSSD_ServerInfo *m_pServerInfo;
  115. } ;
  116. class CWin32_SessionDirectorySession : public Provider
  117. {
  118. public:
  119. // Constructor/destructor
  120. //=======================
  121. CWin32_SessionDirectorySession(LPCWSTR lpwszClassName, LPCWSTR lpwszNameSpace);
  122. virtual ~CWin32_SessionDirectorySession();
  123. protected:
  124. // Reading Functions
  125. //============================
  126. virtual HRESULT EnumerateInstances(MethodContext* pMethodContext, long lFlags = 0L);
  127. virtual HRESULT GetObject(CInstance* pInstance, long lFlags, CFrameworkQuery &Query);
  128. virtual HRESULT ExecQuery(MethodContext *pMethodContext, CFrameworkQuery& Query, long lFlags = 0L);
  129. // Writing Functions
  130. //============================
  131. virtual HRESULT PutInstance(const CInstance& Instance, long lFlags = 0L);
  132. virtual HRESULT DeleteInstance(const CInstance& Instance, long lFlags = 0L);
  133. // Other Functions
  134. //virtual HRESULT ExecMethod(const CInstance& Instance,
  135. // const BSTR bstrMethodName,
  136. // CInstance *pInParams,
  137. // CInstance *pOutParams,
  138. // long lFlags = 0L );
  139. HRESULT LoadPropertyValues(CInstance *pInstance, DWORD dwIndex, DWORD dwRequiredProperties);
  140. // TO DO: Declare any additional functions and accessor
  141. // functions for private data used by this class
  142. //===========================================================
  143. private:
  144. // All data members for CWin32_SessionDirectorySession should be included here.
  145. BOOL IsInList(const CHStringArray &asArray, LPCWSTR pszString);
  146. TCHAR m_szServerName[SDWMI_NAME_LENGTH];
  147. TCHAR m_szSessionID[SDWMI_NAME_LENGTH];
  148. TCHAR m_szUserName[SDWMI_NAME_LENGTH];
  149. TCHAR m_szDomainName[SDWMI_NAME_LENGTH];
  150. TCHAR m_szServerIPAddress[SDWMI_NAME_LENGTH];
  151. TCHAR m_szTSProtocol[SDWMI_NAME_LENGTH];
  152. TCHAR m_szApplicationType[SDWMI_NAME_LENGTH];
  153. TCHAR m_szResolutionWidth[SDWMI_NAME_LENGTH];
  154. TCHAR m_szResolutionHeight[SDWMI_NAME_LENGTH];
  155. TCHAR m_szColorDepth[SDWMI_NAME_LENGTH];
  156. TCHAR m_szCreateTime[SDWMI_NAME_LENGTH];
  157. TCHAR m_szDisconnectTime[SDWMI_NAME_LENGTH];
  158. TCHAR m_szSessionState[SDWMI_NAME_LENGTH];
  159. TSSD_SessionInfo *m_pSessionInfo;
  160. } ;
  161. #endif