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.

349 lines
10 KiB

  1. /*******************************************************************************
  2. *
  3. * waextend.h
  4. *
  5. * Declarations for structures passed between WinAdmin and ADMINEX.DLL
  6. *
  7. * copyright notice: Copyright 1997, Citrix Systems Inc.
  8. * Copyright (c) 1998 - 1999 Microsoft Corporation
  9. *
  10. * $Author: unknown $ Don Messerli
  11. *
  12. * $Log: R:\nt\private\utils\citrix\winutils\tsadmin\vcs\waextend.h $
  13. *
  14. * Rev 1.5 22 Feb 1998 15:53:34 unknown
  15. * Removed winframe.h dependency
  16. *
  17. * Rev 1.4 16 Feb 1998 16:02:54 donm
  18. * modifications to support pICAsso extension
  19. *
  20. * Rev 1.1 22 Oct 1997 21:56:54 donm
  21. * update
  22. *
  23. * Rev 1.0 15 Oct 1997 19:19:58 donm
  24. * Initial revision.
  25. *
  26. *******************************************************************************/
  27. #ifndef _WAEXTEND_H
  28. #define _WAEXTEND_H
  29. class CAppServer;
  30. // Messages sent by the extension DLL
  31. #define EXT_MESSAGE_BASE WM_USER + 1000
  32. #define WM_EXT_ADD_APPLICATION EXT_MESSAGE_BASE
  33. #define WM_EXT_ADD_APP_SERVER EXT_MESSAGE_BASE + 1
  34. #define WM_EXT_APP_CHANGED EXT_MESSAGE_BASE + 2
  35. #define WM_EXT_REMOVE_APPLICATION EXT_MESSAGE_BASE + 3
  36. #define WM_EXT_REMOVE_APP_SERVER EXT_MESSAGE_BASE + 4
  37. // Flags for ExtServerInfo
  38. const ULONG ESF_WINFRAME = 0x0001; // Server is running Picasso or WinFrame 1.7
  39. const ULONG ESF_LOAD_BALANCING = 0x0002; // Server is load balancing
  40. const ULONG ESF_NO_LICENSE_PRIVILEGES = 0x0004; // User doesn't have privileges to enumerate licenses
  41. const ULONG ESF_UNLIMITED_LICENSES = 0x0008; // Server has an unlimited user license installed
  42. // Information about a Server
  43. // For the All Server Servers Page
  44. typedef struct _ExtServerInfo {
  45. // TCP/IP Address of the server as an ASCII string
  46. TCHAR TcpAddress[50];
  47. // Raw TCP/IP Address of the server
  48. ULONG RawTcpAddress;
  49. // IPX Address of the server
  50. TCHAR IpxAddress[50];
  51. ULONG TcpLoadLevel;
  52. ULONG IpxLoadLevel;
  53. ULONG NetbiosLoadLevel;
  54. // License Counts
  55. ULONG ServerPoolInstalled;
  56. ULONG ServerPoolInUse;
  57. ULONG ServerPoolAvailable;
  58. ULONG ServerLocalInstalled;
  59. ULONG ServerLocalInUse;
  60. ULONG ServerLocalAvailable;
  61. ULONG ServerTotalInstalled;
  62. ULONG ServerTotalInUse;
  63. ULONG ServerTotalAvailable;
  64. ULONG NetworkPoolInstalled;
  65. ULONG NetworkPoolInUse;
  66. ULONG NetworkPoolAvailable;
  67. ULONG NetworkLocalInstalled;
  68. ULONG NetworkLocalInUse;
  69. ULONG NetworkLocalAvailable;
  70. ULONG NetworkTotalInstalled;
  71. ULONG NetworkTotalInUse;
  72. ULONG NetworkTotalAvailable;
  73. // Flags
  74. ULONG Flags;
  75. } ExtServerInfo;
  76. // Flags for ExtWinStationInfo
  77. // WinStation Extra Info
  78. typedef struct _ExtWinStationInfo {
  79. ULONG CacheTiny;
  80. ULONG CacheLowMem;
  81. ULONG CacheXms;
  82. ULONG CacheDASD;
  83. ULONG DimCacheSize;
  84. ULONG DimBitmapMin;
  85. ULONG DimSignatureLevel;
  86. // Flags
  87. ULONG Flags;
  88. } ExtWinStationInfo;
  89. // Global Extra Info
  90. typedef struct _ExtGlobalInfo {
  91. // License Counts
  92. ULONG NetworkPoolInstalled;
  93. ULONG NetworkPoolInUse;
  94. ULONG NetworkPoolAvailable;
  95. ULONG NetworkLocalInstalled;
  96. ULONG NetworkLocalInUse;
  97. ULONG NetworkLocalAvailable;
  98. ULONG NetworkTotalInstalled;
  99. ULONG NetworkTotalInUse;
  100. ULONG NetworkTotalAvailable;
  101. } ExtGlobalInfo;
  102. typedef enum _LICENSECLASS {
  103. LicenseBase,
  104. LicenseBump,
  105. LicenseEnabler,
  106. LicenseUnknown
  107. } LICENSECLASS;
  108. const ULONG ELF_POOLING = 0x0001;
  109. const ULONG ELF_REGISTERED = 0x0002;
  110. typedef struct _ExtLicenseInfo {
  111. LICENSECLASS Class;
  112. ULONG PoolLicenseCount;
  113. ULONG LicenseCount;
  114. WCHAR RegSerialNumber[26];
  115. WCHAR LicenseNumber[36];
  116. WCHAR Description[65];
  117. ULONG Flags;
  118. } ExtLicenseInfo;
  119. typedef struct _ExtModuleInfo {
  120. USHORT Date;
  121. USHORT Time;
  122. ULONG Size;
  123. BYTE LowVersion;
  124. BYTE HighVersion;
  125. TCHAR Name[13];
  126. } ExtModuleInfo;
  127. typedef struct _ExtAddTreeNode {
  128. CObject *pObject;
  129. CObject *pParent;
  130. HTREEITEM hParent;
  131. TCHAR Name[256];
  132. } ExtAddTreeNode;
  133. enum AATYPE {
  134. AAT_USER,
  135. AAT_LOCAL_GROUP,
  136. AAT_GLOBAL_GROUP
  137. };
  138. // Published App flags
  139. const ULONG AF_QUERYSUCCESS = 0x00000001;
  140. const ULONG AF_ANONYMOUS = 0x00000002;
  141. const ULONG AF_INHERIT_CLIENT_SIZE = 0x00000004;
  142. const ULONG AF_INHERIT_CLIENT_COLORS = 0x00000008;
  143. const ULONG AF_HIDE_TITLE_BAR = 0x00000010;
  144. const ULONG AF_MAXIMIZE = 0x00000020;
  145. const ULONG AF_CURRENT = 0x00000040;
  146. // A mask to use to clear all flags set with data from the APPCONFIG structure
  147. const ULONG AF_CONFIG_MASK = AF_ANONYMOUS | AF_INHERIT_CLIENT_SIZE | AF_INHERIT_CLIENT_COLORS
  148. | AF_HIDE_TITLE_BAR | AF_MAXIMIZE;
  149. // Published Application States (for m_State)
  150. enum APP_STATE {
  151. PAS_NONE,
  152. PAS_GETTING_INFORMATION,
  153. PAS_GOOD
  154. };
  155. // Flags that get sent in wParam of WM_EXT_APP_CHANGED message
  156. // telling what has changed
  157. const WPARAM ACF_STATE = 0x0001;
  158. const WPARAM ACF_CONFIG = 0x0002;
  159. const WPARAM ACF_ALLOWED = 0x0004;
  160. // Published App Window Color Values
  161. const ULONG APP_16_COLOR = 0x0001;
  162. const ULONG APP_256_COLOR = 0x0002;
  163. const ULONG APP_64K_COLOR = 0x0004;
  164. const ULONG APP_16M_COLOR = 0x0008;
  165. class CPublishedApp : public CObject
  166. {
  167. public:
  168. // Constructor
  169. CPublishedApp(TCHAR *name);
  170. // Destructor
  171. ~CPublishedApp();
  172. // Query Servers
  173. void QueryServers();
  174. // Update with new information
  175. BOOL Update();
  176. // Returns the name of the published app
  177. TCHAR *GetName() { return m_Name; }
  178. // Returns the handle to this app's tree item
  179. HTREEITEM GetTreeItem() { return m_hTreeItem; }
  180. // Sets the tree item handle
  181. void SetTreeItem(HTREEITEM handle) { m_hTreeItem = handle; }
  182. // Returns a pointer to this app's server list
  183. CObList *GetServerList() { return &m_ServerList; }
  184. // Locks the server list
  185. void LockServerList() { m_ServerListCriticalSection.Lock(); }
  186. // Unlock the server list
  187. void UnlockServerList() { m_ServerListCriticalSection.Unlock(); }
  188. // Locks the allowed user list
  189. void LockAllowedUserList() { m_AllowedUserListCriticalSection.Lock(); }
  190. // Unlock the allowed user list
  191. void UnlockAllowedUserList() { m_AllowedUserListCriticalSection.Unlock(); }
  192. // Returns a pointer to this app's allowed user list
  193. CObList *GetAllowedUserList() { return &m_AllowedUserList; }
  194. // returns a pointer to a given CAppServer object if it is in our list
  195. CAppServer *FindServerByName(TCHAR *pServerName);
  196. // Returns TRUE if we successfully queried this application
  197. BOOLEAN WasQuerySuccessful() { return (m_Flags & AF_QUERYSUCCESS) > 0; }
  198. // Sets the query success flag
  199. void SetQuerySuccess() { m_Flags |= AF_QUERYSUCCESS; }
  200. // Returns TRUE if current flag is set
  201. BOOLEAN IsCurrent() { return (m_Flags & AF_CURRENT) > 0; }
  202. // Sets the current flag
  203. void SetCurrent() { m_Flags |= AF_CURRENT; }
  204. // Clears the current flag
  205. void ClearCurrent() { m_Flags &= ~AF_CURRENT; }
  206. // Returns TRUE if application is anonymous
  207. BOOLEAN IsAnonymous() { return (m_Flags & AF_ANONYMOUS) > 0; }
  208. // Returns TRUE if application inherits client size
  209. BOOLEAN InheritsClientSize() { return (m_Flags & AF_INHERIT_CLIENT_SIZE) > 0; }
  210. // Returns TRUE if application inherits client color
  211. BOOLEAN InheritsClientColors() { return (m_Flags & AF_INHERIT_CLIENT_COLORS) > 0; }
  212. // Returns TRUE if application wants title bar hidden
  213. BOOLEAN IsTitleBarHidden() { return (m_Flags & AF_HIDE_TITLE_BAR) > 0; }
  214. // Returns TRUE if the application wants to be maximized
  215. BOOLEAN IsMaximize() { return (m_Flags & AF_MAXIMIZE) > 0; }
  216. // Returns the Window Scale
  217. ULONG GetWindowScale() { return m_WindowScale; }
  218. // Returns the Window Width
  219. ULONG GetWindowWidth() { return m_WindowWidth; }
  220. // Returns the Window Height
  221. ULONG GetWindowHeight() { return m_WindowHeight; }
  222. // Returns the Window Color
  223. ULONG GetWindowColor() { return m_WindowColor; }
  224. // Returns the State
  225. APP_STATE GetState() { return m_State; }
  226. // Sets the State
  227. void SetState(APP_STATE state) { m_State = state; }
  228. // Checks the State
  229. BOOLEAN IsState(APP_STATE state) { return(m_State == state); }
  230. private:
  231. void RemoveAppServer(CAppServer *pAppServer);
  232. static UINT BackgroundThreadProc(LPVOID);
  233. CWinThread *m_pBackgroundThread;
  234. BOOL m_BackgroundContinue;
  235. // Name of the published application
  236. TCHAR m_Name[256];
  237. // Handle to the tree item for this app in the tree view
  238. HTREEITEM m_hTreeItem;
  239. // List of application's server
  240. CObList m_ServerList;
  241. // Critical section for locking the server list
  242. CCriticalSection m_ServerListCriticalSection;
  243. // Critical section for locking the allowed user list
  244. CCriticalSection m_AllowedUserListCriticalSection;
  245. // List of application's allowed users
  246. CObList m_AllowedUserList;
  247. // State
  248. APP_STATE m_State;
  249. ULONG m_WindowScale;
  250. ULONG m_WindowWidth;
  251. ULONG m_WindowHeight;
  252. ULONG m_WindowColor;
  253. ULONG m_AppConfigCRC;
  254. ULONG m_SrvAppConfigCRC;
  255. ULONG m_UserAndGroupListCRC;
  256. // Flags
  257. ULONG m_Flags;
  258. };
  259. // AppServer flags
  260. const ULONG ASF_NOT_RESPONDING = 0x00000001;
  261. const ULONG ASF_UPDATE_PENDING = 0x00000002;
  262. const ULONG ASF_ACCESS_DENIED = 0x00000004;
  263. const ULONG ASF_IS_CURRENT_SERVER = 0x00000008;
  264. const ULONG ASF_CURRENT = 0x00000010;
  265. class CAppServer : public CObject
  266. {
  267. public:
  268. // Constructor
  269. CAppServer(PVOID pConfig, CPublishedApp *pPublishedApp);
  270. // Destructor
  271. ~CAppServer();
  272. // Returns TRUE if this is the server that the app is being run from
  273. BOOL IsCurrentServer() { return ((m_Flags & ASF_IS_CURRENT_SERVER) > 0); }
  274. // Returns the Published App this server is associated with
  275. CPublishedApp *GetPublishedApp() { return m_pPublishedApp; }
  276. // Returns the name of the server
  277. TCHAR *GetName() { return m_Name; }
  278. // Returns the Initial Program
  279. TCHAR *GetInitialProgram() { return m_InitialProgram; }
  280. // Returns the Working Directory
  281. TCHAR *GetWorkDirectory() { return m_WorkDirectory; }
  282. // Sets the tree item
  283. void SetTreeItem(HTREEITEM h) { m_hTreeItem = h; }
  284. // Gets the tree item
  285. HTREEITEM GetTreeItem() { return m_hTreeItem; }
  286. // Sets the current flag
  287. void SetCurrent() { m_Flags |= ASF_CURRENT; }
  288. // Is the current flag set?
  289. BOOL IsCurrent() { return ((m_Flags & ASF_CURRENT) > 0); }
  290. // Clears the current flag
  291. void ClearCurrent() { m_Flags &= ~ASF_CURRENT; }
  292. // Has the configuration for this AppServer changed
  293. BOOL HasConfigChanged(PVOID);
  294. private:
  295. CPublishedApp *m_pPublishedApp;
  296. TCHAR m_Name[20];
  297. TCHAR m_InitialProgram[257];
  298. TCHAR m_WorkDirectory[257];
  299. HTREEITEM m_hTreeItem;
  300. ULONG m_Flags;
  301. };
  302. class CAppAllowed : public CObject
  303. {
  304. public:
  305. // constructor
  306. CAppAllowed(TCHAR *name, AATYPE type) { wcscpy(m_Name, name); m_Type = type; }
  307. AATYPE GetType() { return m_Type; }
  308. TCHAR m_Name[257];
  309. private:
  310. AATYPE m_Type;
  311. };
  312. #endif // _WAEXTEND_H