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.

1641 lines
66 KiB

  1. /*******************************************************************************
  2. *
  3. * winadmin.h
  4. *
  5. * main header file for the WINADMIN application
  6. *
  7. * copyright notice: Copyright 1997, Citrix Systems Inc.
  8. * Copyright (c) 1998 - 1999 Microsoft Corporation
  9. * $Author: donm $ Don Messerli
  10. *
  11. * $Log: N:\nt\private\utils\citrix\winutils\tsadmin\VCS\winadmin.h $
  12. *
  13. * Rev 1.12 25 Apr 1998 13:43:14 donm
  14. * MS 2167: try to use proper Wd from registry
  15. *
  16. * Rev 1.11 19 Feb 1998 17:42:52 donm
  17. * removed latest extension DLL support
  18. *
  19. * Rev 1.9 19 Jan 1998 16:49:28 donm
  20. * new ui behavior for domains and servers
  21. *
  22. * Rev 1.8 03 Nov 1997 15:28:02 donm
  23. * added Domains
  24. *
  25. * Rev 1.7 22 Oct 1997 21:09:10 donm
  26. * update
  27. *
  28. * Rev 1.6 17 Oct 1997 18:07:28 donm
  29. * update
  30. *
  31. * Rev 1.5 15 Oct 1997 19:52:48 donm
  32. * update
  33. *
  34. * Rev 1.4 13 Oct 1997 23:07:14 donm
  35. * update
  36. *
  37. * Rev 1.3 13 Oct 1997 22:20:02 donm
  38. * update
  39. *
  40. * Rev 1.2 26 Aug 1997 19:16:24 donm
  41. * bug fixes/changes from WinFrame 1.7
  42. *
  43. * Rev 1.1 31 Jul 1997 16:52:52 butchd
  44. * update
  45. *
  46. * Rev 1.0 30 Jul 1997 17:13:12 butchd
  47. * Initial revision.
  48. *
  49. *******************************************************************************/
  50. #ifndef _WINADMIN_H
  51. #define _WINADMIN_H
  52. #ifndef __AFXWIN_H__
  53. #error include 'stdafx.h' before including this file for PCH
  54. #endif
  55. #include "resource.h" // main symbols
  56. #include <afxmt.h>
  57. #include <winsta.h>
  58. #include <time.h>
  59. #include <utildll.h>
  60. #include "waextend.h"
  61. // Classes defined in this file
  62. class CTreeNode;
  63. class CWinStation;
  64. class CModule;
  65. class CLicense;
  66. class CServer;
  67. class CWinAdminApp;
  68. class CProcess;
  69. class CHotFix;
  70. class CDomain;
  71. class CWd;
  72. // Server icon overlay states
  73. const USHORT STATE_NORMAL = 0x0000;
  74. const USHORT STATE_NOT = 0x0100;
  75. const USHORT STATE_QUESTION = 0x0200;
  76. const USHORT MSG_TITLE_LENGTH = 64;
  77. const USHORT MSG_MESSAGE_LENGTH = 256;
  78. const USHORT LIST_TOP_OFFSET = 4;
  79. const int KBDSHIFT = 0x01;
  80. const int KBDCTRL = 0x02;
  81. const int KBDALT = 0x04;
  82. enum VIEW {
  83. VIEW_BLANK,
  84. VIEW_ALL_SERVERS,
  85. VIEW_DOMAIN,
  86. VIEW_SERVER,
  87. VIEW_MESSAGE,
  88. VIEW_WINSTATION,
  89. VIEW_CHANGING
  90. };
  91. const int PAGE_CHANGING = 0xFFFF;
  92. enum AS_PAGE {
  93. // All Servers Pages
  94. PAGE_AS_SERVERS,
  95. PAGE_AS_USERS,
  96. PAGE_AS_WINSTATIONS,
  97. PAGE_AS_PROCESSES,
  98. PAGE_AS_LICENSES
  99. };
  100. enum DOMAIN_PAGE {
  101. PAGE_DOMAIN_SERVERS,
  102. PAGE_DOMAIN_USERS,
  103. PAGE_DOMAIN_WINSTATIONS,
  104. PAGE_DOMAIN_PROCESSES,
  105. PAGE_DOMAIN_LICENSES
  106. };
  107. enum SERVER_PAGE {
  108. // Server Pages
  109. PAGE_USERS,
  110. PAGE_WINSTATIONS,
  111. PAGE_PROCESSES,
  112. PAGE_LICENSES,
  113. PAGE_INFO
  114. };
  115. enum WINS_PAGE {
  116. // WinStation Pages
  117. PAGE_WS_PROCESSES,
  118. PAGE_WS_INFO,
  119. PAGE_WS_MODULES,
  120. PAGE_WS_CACHE,
  121. PAGE_WS_NO_INFO
  122. };
  123. // The column enums have to be here so that colsort.cpp can get to them
  124. // Server User's columns
  125. enum USERSCOLUMNS {
  126. USERS_COL_USER,
  127. USERS_COL_WINSTATION,
  128. USERS_COL_ID,
  129. USERS_COL_STATE,
  130. USERS_COL_IDLETIME,
  131. USERS_COL_LOGONTIME
  132. };
  133. // Server WinStation's columns
  134. enum STATIONCOLUMNS {
  135. WS_COL_WINSTATION,
  136. WS_COL_USER,
  137. WS_COL_ID,
  138. WS_COL_STATE,
  139. WS_COL_TYPE,
  140. WS_COL_CLIENTNAME,
  141. WS_COL_IDLETIME,
  142. WS_COL_LOGONTIME,
  143. WS_COL_COMMENT
  144. };
  145. // Server Processes' columns
  146. enum PROCESSCOLUMNS {
  147. PROC_COL_USER,
  148. PROC_COL_WINSTATION,
  149. PROC_COL_ID,
  150. PROC_COL_PID,
  151. PROC_COL_IMAGE
  152. };
  153. // Server Licenses' columns
  154. enum LICENSECOLUMNS {
  155. LICENSE_COL_DESCRIPTION,
  156. LICENSE_COL_REGISTERED,
  157. LICENSE_COL_USERCOUNT,
  158. LICENSE_COL_POOLCOUNT,
  159. LICENSE_COL_NUMBER
  160. };
  161. // Server Hotfix columns
  162. enum HOTFIXCOLUMNS {
  163. HOTFIX_COL_NAME,
  164. HOTFIX_COL_INSTALLEDBY,
  165. HOTFIX_COL_INSTALLEDON
  166. };
  167. // WinStation Processes columns
  168. enum WS_PROCESSCOLUMNS {
  169. WS_PROC_COL_ID,
  170. WS_PROC_COL_PID,
  171. WS_PROC_COL_IMAGE
  172. };
  173. // WinStation Modules columns
  174. enum MODULESCOLUMNS {
  175. MODULES_COL_FILENAME,
  176. MODULES_COL_FILEDATETIME,
  177. MODULES_COL_SIZE,
  178. MODULES_COL_VERSIONS
  179. };
  180. // All Server Servers columns
  181. enum SERVERSCOLUMNS {
  182. SERVERS_COL_SERVER,
  183. SERVERS_COL_TCPADDRESS,
  184. SERVERS_COL_IPXADDRESS,
  185. SERVERS_COL_NUMWINSTATIONS
  186. };
  187. // All Server Users columns
  188. enum AS_USERS_COLUMNS {
  189. AS_USERS_COL_SERVER,
  190. AS_USERS_COL_USER,
  191. AS_USERS_COL_WINSTATION,
  192. AS_USERS_COL_ID,
  193. AS_USERS_COL_STATE,
  194. AS_USERS_COL_IDLETIME,
  195. AS_USERS_COL_LOGONTIME
  196. };
  197. // All Server WinStations columns
  198. enum AS_STATIONCOLUMNS {
  199. AS_WS_COL_SERVER,
  200. AS_WS_COL_WINSTATION,
  201. AS_WS_COL_USER,
  202. AS_WS_COL_ID,
  203. AS_WS_COL_STATE,
  204. AS_WS_COL_TYPE,
  205. AS_WS_COL_CLIENTNAME,
  206. AS_WS_COL_IDLETIME,
  207. AS_WS_COL_LOGONTIME,
  208. AS_WS_COL_COMMENT
  209. };
  210. // All Server Processes columns
  211. enum AS_PROCESSCOLUMNS {
  212. AS_PROC_COL_SERVER,
  213. AS_PROC_COL_USER,
  214. AS_PROC_COL_WINSTATION,
  215. AS_PROC_COL_ID,
  216. AS_PROC_COL_PID,
  217. AS_PROC_COL_IMAGE
  218. };
  219. // All Server Licenses columns
  220. enum AS_LICENSECOLUMNS {
  221. AS_LICENSE_COL_SERVER,
  222. AS_LICENSE_COL_DESCRIPTION,
  223. AS_LICENSE_COL_REGISTERED,
  224. AS_LICENSE_COL_USERCOUNT,
  225. AS_LICENSE_COL_POOLCOUNT,
  226. AS_LICENSE_COL_NUMBER
  227. };
  228. // in colsort.cpp
  229. void SortByColumn(int View, int Page, CListCtrl *list, int ColumnNumber, BOOL bAscending);
  230. // Extension Startup Function
  231. typedef void (WINAPI *LPFNEXSTARTUPPROC) (HWND);
  232. // Extension Shutdown Function
  233. typedef void (WINAPI *LPFNEXSHUTDOWNPROC) (void);
  234. // Extension Server Enumerate Function
  235. typedef LPWSTR (WINAPI *LPFNEXENUMERATEPROC) (LPWSTR);
  236. // Extension WinStation Init Function
  237. typedef void* (WINAPI *LPFNEXWINSTATIONINITPROC) (HANDLE, ULONG);
  238. // Extension WinStation Additional Info Function
  239. typedef void (WINAPI *LPFNEXWINSTATIONINFOPROC) (void*, int);
  240. // Extension WinStation Cleanup Function
  241. typedef void (WINAPI *LPFNEXWINSTATIONCLEANUPPROC) (void*);
  242. // Extension Server Init Function
  243. typedef void* (WINAPI *LPFNEXSERVERINITPROC) (TCHAR*, HANDLE);
  244. // Extension Server Cleanup Function
  245. typedef void (WINAPI *LPFNEXSERVERCLEANUPPROC) (void*);
  246. // Extension Server Event Function
  247. typedef BOOL (WINAPI *LPFNEXSERVEREVENTPROC) (void*, ULONG);
  248. // Extension Get Server Info
  249. typedef ExtServerInfo* (WINAPI *LPFNEXGETSERVERINFOPROC) (void *);
  250. // Extension Get Server License Info
  251. typedef ExtLicenseInfo* (WINAPI *LPFNEXGETSERVERLICENSESPROC) (void*, ULONG*);
  252. // Extension Get Global Info
  253. typedef ExtGlobalInfo* (WINAPI *LPFNEXGETGLOBALINFOPROC) (void);
  254. // Extension Get WinStation Info
  255. typedef ExtWinStationInfo* (WINAPI *LPFNEXGETWINSTATIONINFOPROC) (void *);
  256. // Extension Get WinStation Modules
  257. typedef ExtModuleInfo* (WINAPI *LPFNEXGETWINSTATIONMODULESPROC) (void*, ULONG*);
  258. // Extension Free Server License Info
  259. typedef void (WINAPI *LPFNEXFREESERVERLICENSESPROC) (ExtLicenseInfo*);
  260. // Extension Free WinStation Modules
  261. typedef void (WINAPI *LPFNEXFREEWINSTATIONMODULESPROC) (ExtModuleInfo*);
  262. /////////////////////////////////////////////////////////////////////////////
  263. // CWinAdminApp:
  264. // See WinAdmin.cpp for the implementation of this class
  265. //
  266. class CWinAdminApp : public CWinApp
  267. {
  268. public:
  269. // constructor
  270. CWinAdminApp();
  271. // Returns the Current User Name
  272. TCHAR *GetCurrentUserName() { return m_CurrentUserName; }
  273. // Returns the Current WinStation Name
  274. PWINSTATIONNAME GetCurrentWinStationName() { return m_CurrentWinStationName; }
  275. // Returns the Current Server Name
  276. TCHAR *GetCurrentServerName() { return m_CurrentServerName; }
  277. // Returns the Current Logon Id
  278. ULONG GetCurrentLogonId() { return m_CurrentLogonId; }
  279. // Returns the Current WinStation Flags
  280. ULONG GetCurrentWSFlags() { return m_CurrentWSFlags; }
  281. // Returns TRUE if the current user has Admin privileges?
  282. BOOL IsUserAdmin() { return m_Admin; }
  283. // Returns TRUE if we are running under Picasso
  284. BOOL IsPicasso() { return m_Picasso; }
  285. // Returns TRUE if we should show system processes
  286. BOOL ShowSystemProcesses() { return m_ShowSystemProcesses; }
  287. // Sets the show system processes variable
  288. void SetShowSystemProcesses(BOOL show) { m_ShowSystemProcesses = show; }
  289. // Returns TRUE if we should ask user for confirmation of Actions
  290. BOOL AskConfirmation() { return m_Confirmation; }
  291. // Sets the confirmation variable
  292. void SetConfirmation(BOOL conf) { m_Confirmation = conf; }
  293. // Returms TRUE if we should save the preferences upon exit
  294. BOOL SavePreferences() { return m_SavePreferences; }
  295. // Sets the save preferences variable
  296. void SetSavePreferences(BOOL pref) { m_SavePreferences = pref; }
  297. // Returns the Process List Refresh Time
  298. UINT GetProcessListRefreshTime() { return m_ProcessListRefreshTime; }
  299. // Sets the Process List Refresh Time
  300. void SetProcessListRefreshTime(UINT pt) { m_ProcessListRefreshTime = pt; }
  301. // Returns the Status Dialog Refresh Time
  302. UINT GetStatusRefreshTime() { return m_StatusRefreshTime; }
  303. // Sets the Status Dialog Refresh Time
  304. void SetStatusRefreshTime(UINT st) { m_StatusRefreshTime = st; }
  305. // Returns a pointer to the document
  306. CDocument *GetDocument() { return m_Document; }
  307. // Sets the m_Document variable
  308. void SetDocument(CDocument *doc) { m_Document = doc; }
  309. // Should we Show All Servers - based on menu item toggle
  310. BOOL GetShowAllServers() { return m_ShowAllServers; }
  311. // Set the Show All Servers variable
  312. void SetShowAllServers(BOOL sa) { m_ShowAllServers = sa; }
  313. // Returns the value of shadow hotkey key
  314. int GetShadowHotkeyKey() { return m_ShadowHotkeyKey; }
  315. // Sets the value of shadow hotkey key
  316. void SetShadowHotkeyKey(int key) { m_ShadowHotkeyKey = key; }
  317. // Returns the value of shadow hotkey shift state
  318. DWORD GetShadowHotkeyShift() { return m_ShadowHotkeyShift; }
  319. // Sets the value of shadow hotkey shift state
  320. void SetShadowHotkeyShift(DWORD shift) { m_ShadowHotkeyShift = shift; }
  321. // Get the tree width
  322. int GetTreeWidth() { return m_TreeWidth; }
  323. // Set the tree width
  324. void SetTreeWidth(int width) { m_TreeWidth = width; }
  325. // Get the window placement
  326. WINDOWPLACEMENT *GetPlacement() { return &m_Placement; }
  327. // Returns the address of the extension DLL's startup function
  328. LPFNEXSTARTUPPROC GetExtStartupProc() { return m_lpfnWAExStart; }
  329. // Returns the address of the extension DLL's shutdown function
  330. LPFNEXSHUTDOWNPROC GetExtShutdownProc() { return m_lpfnWAExEnd; }
  331. // Returns the address of the extension DLL's server enumeration function
  332. LPFNEXENUMERATEPROC GetExtEnumerationProc() { return m_lpfnWAExServerEnumerate; }
  333. // Returns the address of the extension DLL's WinStation Init function
  334. LPFNEXWINSTATIONINITPROC GetExtWinStationInitProc() { return m_lpfnWAExWinStationInit; }
  335. // Returns the address of the extension DLL's WinStation Info function
  336. LPFNEXWINSTATIONINFOPROC GetExtWinStationInfoProc() { return m_lpfnWAExWinStationInfo; }
  337. // Returns the address of the extension DLL's WinStation Cleanup function
  338. LPFNEXWINSTATIONCLEANUPPROC GetExtWinStationCleanupProc() { return m_lpfnWAExWinStationCleanup; }
  339. // Returns the address of the extension DLL's Server Init function
  340. LPFNEXSERVERINITPROC GetExtServerInitProc() { return m_lpfnWAExServerInit; }
  341. // Returns the address of the extension DLL's Server Cleanup function
  342. LPFNEXSERVERCLEANUPPROC GetExtServerCleanupProc() { return m_lpfnWAExServerCleanup; }
  343. // Returns the address of the extension DLL's Get Server Info function
  344. LPFNEXGETSERVERINFOPROC GetExtGetServerInfoProc() { return m_lpfnWAExGetServerInfo; }
  345. // Returns the address of the extension DLL's Get Server License Info function
  346. LPFNEXGETSERVERLICENSESPROC GetExtGetServerLicensesProc() { return m_lpfnWAExGetServerLicenses; }
  347. // Returns the address of the extension DLL's Server Event function
  348. LPFNEXSERVEREVENTPROC GetExtServerEventProc() { return m_lpfnWAExServerEvent; }
  349. // Returns the address of the extension DLL's Get Global Info function
  350. LPFNEXGETGLOBALINFOPROC GetExtGetGlobalInfoProc() { return m_lpfnWAExGetGlobalInfo; }
  351. // Returns the address of the extension DLL's Get WinStation Info Function
  352. LPFNEXGETWINSTATIONINFOPROC GetExtGetWinStationInfoProc() { return m_lpfnWAExGetWinStationInfo; }
  353. // Returns the address of the extension DLL's Get WinStation Module Info function
  354. LPFNEXGETWINSTATIONMODULESPROC GetExtGetWinStationModulesProc() { return m_lpfnWAExGetWinStationModules; }
  355. // Returns the address of the extension DLL's Free Server License Info function
  356. LPFNEXFREESERVERLICENSESPROC GetExtFreeServerLicensesProc() { return m_lpfnWAExFreeServerLicenses; }
  357. // Returns the address of the extension DLL's Free WinStation Modules function
  358. LPFNEXFREEWINSTATIONMODULESPROC GetExtFreeWinStationModulesProc() { return m_lpfnWAExFreeWinStationModules; }
  359. void BeginOutstandingThread() { ::InterlockedIncrement(&m_OutstandingThreads); }
  360. void EndOutstandingThread() { ::InterlockedDecrement(&m_OutstandingThreads); }
  361. // make this guy public for speed ?
  362. TCHAR m_szSystemConsole[WINSTATIONNAME_LENGTH+1];
  363. // make this guy public so the MainFrm can get at it
  364. WINDOWPLACEMENT m_Placement;
  365. private:
  366. void ReadPreferences();
  367. void WritePreferences();
  368. BOOL IsBrowserRunning();
  369. LONG m_OutstandingThreads; // the number of outstanding threads
  370. TCHAR m_CurrentUserName[USERNAME_LENGTH+1];
  371. WINSTATIONNAME m_CurrentWinStationName;
  372. TCHAR m_CurrentServerName[MAX_COMPUTERNAME_LENGTH + 1];
  373. ULONG m_CurrentLogonId;
  374. ULONG m_CurrentWSFlags;
  375. BOOL m_Admin; // does the user have Admin privileges?
  376. BOOL m_Picasso; // are we running under Picasso?
  377. UINT m_ShowSystemProcesses;
  378. UINT m_ShowAllServers;
  379. int m_ShadowHotkeyKey;
  380. DWORD m_ShadowHotkeyShift;
  381. int m_TreeWidth;
  382. HINSTANCE m_hExtensionDLL; // handle to the extension DLL if loaded
  383. // functions in the extension DLL
  384. LPFNEXSTARTUPPROC m_lpfnWAExStart;
  385. LPFNEXSHUTDOWNPROC m_lpfnWAExEnd;
  386. LPFNEXENUMERATEPROC m_lpfnWAExServerEnumerate;
  387. LPFNEXWINSTATIONINITPROC m_lpfnWAExWinStationInit;
  388. LPFNEXWINSTATIONINFOPROC m_lpfnWAExWinStationInfo;
  389. LPFNEXWINSTATIONCLEANUPPROC m_lpfnWAExWinStationCleanup;
  390. LPFNEXSERVERINITPROC m_lpfnWAExServerInit;
  391. LPFNEXSERVERCLEANUPPROC m_lpfnWAExServerCleanup;
  392. LPFNEXGETSERVERINFOPROC m_lpfnWAExGetServerInfo;
  393. LPFNEXGETSERVERLICENSESPROC m_lpfnWAExGetServerLicenses;
  394. LPFNEXSERVEREVENTPROC m_lpfnWAExServerEvent;
  395. LPFNEXGETGLOBALINFOPROC m_lpfnWAExGetGlobalInfo;
  396. LPFNEXGETWINSTATIONINFOPROC m_lpfnWAExGetWinStationInfo;
  397. LPFNEXGETWINSTATIONMODULESPROC m_lpfnWAExGetWinStationModules;
  398. LPFNEXFREESERVERLICENSESPROC m_lpfnWAExFreeServerLicenses;
  399. LPFNEXFREEWINSTATIONMODULESPROC m_lpfnWAExFreeWinStationModules;
  400. // user preferences
  401. UINT m_Confirmation; // ask user for confirmation
  402. UINT m_SavePreferences; // save preferences upon exit
  403. UINT m_ProcessListRefreshTime;
  404. UINT m_StatusRefreshTime;
  405. CDocument *m_Document;
  406. // Overrides
  407. // ClassWizard generated virtual function overrides
  408. //{{AFX_VIRTUAL(CWinAdminApp)
  409. public:
  410. virtual BOOL InitInstance();
  411. virtual int ExitInstance();
  412. //}}AFX_VIRTUAL
  413. // Implementation
  414. //{{AFX_MSG(CWinAdminApp)
  415. afx_msg void OnAppAbout();
  416. // NOTE - the ClassWizard will add and remove member functions here.
  417. // DO NOT EDIT what you see in these blocks of generated code !
  418. //}}AFX_MSG
  419. DECLARE_MESSAGE_MAP()
  420. };
  421. enum NODETYPE {
  422. NODE_ALL_SERVERS,
  423. NODE_DOMAIN,
  424. NODE_SERVER,
  425. NODE_WINSTATION,
  426. NODE_PUBLISHED_APPS,
  427. NODE_APPLICATION,
  428. NODE_APP_SERVER,
  429. NODE_FAV_LIST,
  430. NODE_THIS_COMP,
  431. NODE_NONE
  432. };
  433. class CNodeType : public CObject
  434. {
  435. public:
  436. CNodeType( NODETYPE m )
  437. {
  438. m_nodetype = m;
  439. }
  440. ~CNodeType()
  441. {
  442. ODS( L"CNodeType I'm going away\n" );
  443. }
  444. NODETYPE m_nodetype;
  445. };
  446. class CTreeNode : public CObject
  447. {
  448. public:
  449. // constructor
  450. CTreeNode(NODETYPE NodeType, CObject* pObject) { m_NodeType = NodeType; m_pTreeObject = pObject; }
  451. // Returns the node type
  452. NODETYPE GetNodeType() { return m_NodeType; }
  453. // Returns the object pointed to by this node
  454. CObject *GetTreeObject() { return m_pTreeObject; }
  455. // Returns the sort order stored in the object
  456. ULONG GetSortOrder() { return m_SortOrder; }
  457. // Sets the sort order stored with the object
  458. void SetSortOrder(ULONG order) { m_SortOrder = order; }
  459. virtual ~CTreeNode( )
  460. {
  461. if( m_NodeType == NODE_FAV_LIST || m_NodeType == NODE_THIS_COMP )
  462. {
  463. if( m_pTreeObject != NULL )
  464. {
  465. delete m_pTreeObject;
  466. }
  467. }
  468. }
  469. private:
  470. NODETYPE m_NodeType;
  471. CObject* m_pTreeObject;
  472. ULONG m_SortOrder;
  473. };
  474. // structure passed to the Server's BackgroundThreadProc
  475. typedef struct _ServerProcInfo {
  476. CDocument *pDoc;
  477. CServer *pServer;
  478. } ServerProcInfo;
  479. // structure for storing User SID
  480. class CUserSid : public CObject
  481. {
  482. public:
  483. USHORT m_SidCrc;
  484. TCHAR m_UserName[USERNAME_LENGTH+1];
  485. };
  486. // Information we get from the registry of the server
  487. typedef struct _ServerRegistryInfo {
  488. ULONG InstallDate;
  489. TCHAR ServicePackLevel[128];
  490. TCHAR MSVersion[128];
  491. DWORD MSVersionNum;
  492. TCHAR MSBuild[128];
  493. TCHAR MSProductName[128];
  494. TCHAR CTXProductName[128];
  495. TCHAR CTXVersion[128];
  496. DWORD CTXVersionNum;
  497. TCHAR CTXBuild[128];
  498. } ServerRegistryInfo;
  499. class CHotfix : public CObject
  500. {
  501. public:
  502. TCHAR m_Name[10];
  503. TCHAR m_InstalledBy[USERNAME_LENGTH + 1];
  504. ULONG m_InstalledOn;
  505. ULONG m_Valid;
  506. CServer *m_pServer;
  507. };
  508. typedef struct _EncLevel {
  509. WORD StringID;
  510. DWORD RegistryValue;
  511. WORD Flags;
  512. } EncryptionLevel;
  513. typedef LONG (WINAPI *LPFNEXTENCRYPTIONLEVELSPROC) (WDNAME *pWdName, EncryptionLevel **);
  514. class CWd : public CObject
  515. {
  516. public:
  517. // constructor
  518. CWd(PWDCONFIG2 pWdConfig, PWDNAME pRegistryName);
  519. // destructor
  520. ~CWd();
  521. BOOL GetEncryptionLevelString(DWORD Value, CString *pString);
  522. TCHAR *GetName() { return m_WdName; }
  523. TCHAR *GetRegistryName() { return m_RegistryName; }
  524. private:
  525. HINSTANCE m_hExtensionDLL;
  526. WDNAME m_WdName;
  527. WDNAME m_RegistryName;
  528. LPFNEXTENCRYPTIONLEVELSPROC m_lpfnExtEncryptionLevels;
  529. EncryptionLevel *m_pEncryptionLevels;
  530. LONG m_NumEncryptionLevels;
  531. };
  532. // structure passed to a Domain's background thread process
  533. typedef struct _DomainProcInfo {
  534. LPVOID pDoc;
  535. CDomain *pDomain;
  536. } DomainProcInfo;
  537. // Flags for CDomain objects
  538. const ULONG DF_CURRENT_DOMAIN = 0x00000001;
  539. // States of CDomain objects
  540. enum DOMAIN_STATE {
  541. DS_NONE, // seed value for m_State and m_PreviousState
  542. DS_NOT_ENUMERATING, // not enumerating (m_pBackgroundThread == NULL)
  543. DS_INITIAL_ENUMERATION, // enumerating servers for the first time
  544. DS_ENUMERATING, // enumerating
  545. DS_STOPPED_ENUMERATING, // no longer enumerating
  546. };
  547. class CDomain : public CObject
  548. {
  549. public:
  550. // constructor
  551. CDomain(TCHAR *name);
  552. // destructor
  553. ~CDomain();
  554. TCHAR *GetName() { return m_Name; }
  555. // Returns the state of this domain object
  556. DOMAIN_STATE GetState() { return m_State; }
  557. // Sets the state of this domain object
  558. void SetState(DOMAIN_STATE State);
  559. // Returns the previous state of this domain object
  560. DOMAIN_STATE GetPreviousState() { return m_PreviousState; }
  561. // Returns TRUE if m_State is set to a given state
  562. BOOLEAN IsState(DOMAIN_STATE State) { return (m_State == State); }
  563. // Returns TRUE if m_PreviousState is set to a given state
  564. BOOLEAN IsPreviousState(DOMAIN_STATE State) { return (m_PreviousState == State); }
  565. // Returns the tree item handle
  566. HTREEITEM GetTreeItem() { return m_hTreeItem; }
  567. // Sets the tree item handle
  568. void SetTreeItem(HTREEITEM handle) { m_hTreeItem = handle; }
  569. BOOLEAN IsCurrentDomain() { return (m_Flags & DF_CURRENT_DOMAIN) > 0; }
  570. void SetCurrentDomain() { m_Flags |= DF_CURRENT_DOMAIN; }
  571. void ClearCurrentDomain() { m_Flags &= ~DF_CURRENT_DOMAIN; }
  572. BOOL StartEnumerating();
  573. void StopEnumerating();
  574. void SetEnumEvent() { if(m_pBackgroundThread) m_WakeUpEvent.SetEvent(); }
  575. void LockBackgroundThread() { m_ThreadCriticalSection.Lock(); }
  576. void UnlockBackgroundThread() { m_ThreadCriticalSection.Unlock(); }
  577. // returns TRUE as long as the background thread should keep running
  578. BOOL ShouldBackgroundContinue() { return m_BackgroundContinue; }
  579. void ClearBackgroundContinue() { m_BackgroundContinue = FALSE; }
  580. // Returns the pointer to the domain's background thread
  581. CWinThread *GetThreadPointer() { return m_pBackgroundThread; }
  582. LPWSTR EnumHydraServers( /*LPWSTR pDomain,*/ DWORD verMajor, DWORD verMinor );
  583. void CreateServers(LPWSTR pBuffer, LPVOID pDoc);
  584. // Connect to all servers in this Domain
  585. void ConnectAllServers();
  586. // Disconnect from all servers in this Domain
  587. void DisconnectAllServers();
  588. private:
  589. // the state of the domain object
  590. DOMAIN_STATE m_State;
  591. DOMAIN_STATE m_PreviousState;
  592. // the name of the domain
  593. TCHAR m_Name[50];
  594. HTREEITEM m_hTreeItem;
  595. // Background thread to update document when servers
  596. // appear and disapper
  597. // Called with AfxBeginThread
  598. static UINT BackgroundThreadProc(LPVOID);
  599. CWinThread *m_pBackgroundThread;
  600. BOOL m_BackgroundContinue;
  601. // Event to wakeup background thread so that
  602. // he can exit (WaitForSingleEvent instead of Sleep)
  603. CEvent m_WakeUpEvent;
  604. // Critical section to protect accesses to m_pBackgroundThread
  605. CCriticalSection m_ThreadCriticalSection;
  606. ULONG m_Flags;
  607. };
  608. // Flags for CServer objects
  609. const ULONG SF_BACKGROUND_FOUND = 0x00000001;
  610. const ULONG SF_SERVER_INACTIVE = 0x00000002;
  611. const ULONG SF_REGISTRY_INFO = 0x00000004;
  612. const ULONG SF_HANDLE_GOOD = 0x00000008;
  613. const ULONG SF_SELECTED = 0x00000010;
  614. const ULONG SF_UNDEFINED_0040 = 0x00000020;
  615. const ULONG SF_UNDEFINED_0080 = 0x00000040;
  616. const ULONG SF_LOST_CONNECTION = 0x00000080;
  617. const ULONG SF_FOUND_LATER = 0x00000100;
  618. const ULONG SF_WINFRAME = 0x00000200;
  619. const ULONG SF_CONNECTED = 0x00000400;
  620. // How many times we will let a load level query timeout
  621. // before we set it to N/A
  622. const USHORT MAX_LL_TIMEOUTS = 10;
  623. // States of CServer objects
  624. enum SERVER_STATE {
  625. SS_NONE, // seed value for m_State and m_PreviousState
  626. SS_NOT_CONNECTED, // not connected yet or disconnected
  627. SS_OPENED, // opened RPC connection
  628. SS_GETTING_INFO, // getting information about the server
  629. SS_GOOD, // server information is good
  630. SS_DISCONNECTING, // in the process of disconnecting
  631. SS_BAD // could not open the server
  632. };
  633. class CServer : public CObject
  634. {
  635. public:
  636. // constructor
  637. CServer(CDomain *pDomain, TCHAR *name, BOOL bFoundLater, BOOL bConnect); // FoundLater is TRUE if found as new server after initial server enum
  638. // destructor
  639. ~CServer();
  640. // Functions to check,set,and clear m_ServerFlags
  641. BOOLEAN IsServerSane() { return (m_State != SS_BAD); }
  642. BOOLEAN IsManualFind( ) { return m_fManualFind; }
  643. void SetManualFind( ) { m_fManualFind = TRUE; }
  644. void ClearManualFind( ) { m_fManualFind = FALSE; }
  645. BOOLEAN IsBackgroundFound() { return (m_ServerFlags & SF_BACKGROUND_FOUND) > 0; }
  646. void SetBackgroundFound() { m_ServerFlags |= SF_BACKGROUND_FOUND; }
  647. void ClearBackgroundFound() { m_ServerFlags &= ~SF_BACKGROUND_FOUND; }
  648. BOOLEAN IsServerInactive() { return (m_ServerFlags & SF_SERVER_INACTIVE) > 0; }
  649. void SetServerInactive() { m_ServerFlags |= SF_SERVER_INACTIVE; m_BackgroundContinue = FALSE; }
  650. void ClearServerInactive() { m_ServerFlags &= ~SF_SERVER_INACTIVE; }
  651. BOOLEAN IsServerActive() { return (m_ServerFlags & SF_SERVER_INACTIVE) == 0; }
  652. BOOLEAN IsRegistryInfoValid() { return (m_ServerFlags & SF_REGISTRY_INFO) > 0; }
  653. void SetRegistryInfoValid() { m_ServerFlags |= SF_REGISTRY_INFO; }
  654. void ClearRegistryInfoValid() { m_ServerFlags &= ~SF_REGISTRY_INFO; }
  655. BOOLEAN IsHandleGood() { return (m_ServerFlags & SF_HANDLE_GOOD) > 0; }
  656. void SetHandleGood() { m_ServerFlags |= SF_HANDLE_GOOD; }
  657. void ClearHandleGood() { m_ServerFlags &= ~SF_HANDLE_GOOD; }
  658. BOOLEAN IsSelected() { return (m_ServerFlags & SF_SELECTED) > 0; }
  659. void SetSelected() { m_ServerFlags |= SF_SELECTED; }
  660. void ClearSelected() { m_ServerFlags &= ~SF_SELECTED; }
  661. BOOLEAN HasLostConnection() { return (m_ServerFlags & SF_LOST_CONNECTION) > 0; }
  662. void SetLostConnection() { m_ServerFlags |= SF_LOST_CONNECTION; }
  663. void ClearLostConnection() { m_ServerFlags &= ~SF_LOST_CONNECTION; }
  664. BOOLEAN WasFoundLater() { return (m_ServerFlags & SF_FOUND_LATER) > 0; }
  665. void SetFoundLater() { m_ServerFlags |= SF_FOUND_LATER; }
  666. void ClearFoundLater() { m_ServerFlags &= ~SF_FOUND_LATER; }
  667. BOOLEAN IsWinFrame() { return (m_ServerFlags & SF_WINFRAME) > 0; }
  668. void SetWinFrame() { m_ServerFlags |= SF_WINFRAME; }
  669. void ClearWinFrame() { m_ServerFlags &= ~SF_WINFRAME; }
  670. // Returns the state of this server object
  671. SERVER_STATE GetState() { return m_State; }
  672. // Sets the state of this server object
  673. void SetState(SERVER_STATE State);
  674. // Returns the previous state of this server object
  675. SERVER_STATE GetPreviousState() { return m_PreviousState; }
  676. // Returns TRUE if m_State is set to a given state
  677. BOOLEAN IsState(SERVER_STATE State) { return (m_State == State); }
  678. // Returns TRUE if m_PreviousState is set to a given state
  679. BOOLEAN IsPreviousState(SERVER_STATE State) { return (m_PreviousState == State); }
  680. // Add a WinStation to WinStationList in sorted order
  681. void AddWinStation(CWinStation *pWinStation);
  682. // Returns a pointer to the WinStation linked list
  683. CObList *GetWinStationList() { return &m_WinStationList; }
  684. // Locks the WinStation linked list
  685. void LockWinStationList() { m_WinStationListCriticalSection.Lock(); }
  686. // Unlocks the WinStation linked list
  687. void UnlockWinStationList() { m_WinStationListCriticalSection.Unlock(); }
  688. void LockThreadAlive() { m_ThreadCriticalSection.Lock(); }
  689. void UnlockThreadAlive() { m_ThreadCriticalSection.Unlock(); }
  690. void SetThreadAlive() { LockThreadAlive(); m_bThreadAlive = TRUE; UnlockThreadAlive(); }
  691. void ClearThreadAlive() { LockThreadAlive(); m_bThreadAlive = FALSE; UnlockThreadAlive(); }
  692. // Returns a pointer to the Process linked list
  693. CObList *GetProcessList() { return &m_ProcessList; }
  694. // Locks the Process linked list
  695. void LockProcessList() { m_ProcessListCriticalSection.Lock(); }
  696. // Unlocks the Process linked list
  697. void UnlockProcessList() { m_ProcessListCriticalSection.Unlock(); }
  698. // Returns a pointer to the License linked list
  699. CObList *GetLicenseList() { return &m_LicenseList; }
  700. // Locks the License linked list
  701. void LockLicenseList() { m_LicenseListCriticalSection.Lock(); }
  702. // Unlocks the License linked list
  703. void UnlockLicenseList() { m_LicenseListCriticalSection.Unlock(); }
  704. // Returns a pointer to the User Sid linked list
  705. CObList *GetUserSidList() { return &m_UserSidList; }
  706. // Returns a pointer to the Hotfix linked list
  707. CObList *GetHotfixList() { return &m_HotfixList; }
  708. // Get the server's handle
  709. HANDLE GetHandle() { return m_Handle; }
  710. // Set the handle
  711. void SetHandle(HANDLE hIn) { m_Handle = hIn; }
  712. // Go get detailed information about the server
  713. void DoDetail();
  714. // Get this server's addresses from the browser
  715. void QueryAddresses();
  716. // Enumerate this server's processes
  717. BOOL EnumerateProcesses();
  718. // Clear out the list of processes
  719. void ClearProcesses();
  720. // Get the name of the server
  721. TCHAR *GetName() { return m_Name; }
  722. // Returns TRUE if this is the server that the app is being run from
  723. BOOL IsCurrentServer() { return (lstrcmpi(m_Name, ((CWinAdminApp*)AfxGetApp())->GetCurrentServerName()) == 0); }
  724. // Clears the WAF_SELECTED bit in all of this server's lists
  725. void ClearAllSelected();
  726. // returns TRUE as long as the background thread should keep running
  727. BOOL ShouldBackgroundContinue() { return m_BackgroundContinue; }
  728. // turns off the background continue boolean
  729. void ClearBackgroundContinue() { m_BackgroundContinue = FALSE; }
  730. // returns a pointer to a CWinStation from m_WinStationList
  731. CWinStation *FindWinStationById(ULONG Id);
  732. // returns a pointer to a CProcess from m_ProcessList given a PID
  733. CProcess *FindProcessByPID(ULONG Pid);
  734. // returns the number of connected WinStations
  735. ULONG GetNumWinStations() { return m_NumWinStations; }
  736. // Sets the number of connected WinStations
  737. void SetNumWinStations(ULONG num) { m_NumWinStations = num; }
  738. // Go out and fill in the registry info structure
  739. BOOL BuildRegistryInfo();
  740. // Returns the Install Date
  741. ULONG GetInstallDate() { return m_pRegistryInfo->InstallDate; }
  742. // Returns the Service Pack Level
  743. TCHAR *GetServicePackLevel() { return m_pRegistryInfo->ServicePackLevel; }
  744. // Returns the handle to this server's tree item
  745. TCHAR *GetMSVersion() { return m_pRegistryInfo->MSVersion; }
  746. // Returns the MS product version number (binary)
  747. DWORD GetMSVersionNum() { return m_pRegistryInfo->MSVersionNum; }
  748. // Returns the MS product build
  749. TCHAR *GetMSBuild() { return m_pRegistryInfo->MSBuild; }
  750. // Returns the MS product name
  751. TCHAR *GetMSProductName() { return m_pRegistryInfo->MSProductName; }
  752. // Returns the 'Citrix' product name
  753. TCHAR *GetCTXProductName() { return m_pRegistryInfo->CTXProductName; }
  754. // Returns the 'Citrix' product version
  755. TCHAR *GetCTXVersion() { return m_pRegistryInfo->CTXVersion; }
  756. // Returns the 'Citrix' product version number (binary)
  757. DWORD GetCTXVersionNum() { return m_pRegistryInfo->CTXVersionNum; }
  758. // Returns the 'Citrix' product build
  759. TCHAR *GetCTXBuild() { return m_pRegistryInfo->CTXBuild; }
  760. // Sets the pointer to the info from the extension DLL
  761. void SetExtensionInfo(void *p) { m_pExtensionInfo = p; }
  762. // Returns the pointer to the info from the extension DLL
  763. void *GetExtensionInfo() { return m_pExtensionInfo; }
  764. // Returns a pointer to the info from the extension DLL
  765. ExtServerInfo *GetExtendedInfo() { return m_pExtServerInfo; }
  766. // Manipulate the number selected counts
  767. UINT GetNumWinStationsSelected() { return m_NumWinStationsSelected; }
  768. UINT GetNumProcessesSelected() { return m_NumProcessesSelected; }
  769. void IncrementNumWinStationsSelected() { m_NumWinStationsSelected++; }
  770. void IncrementNumProcessesSelected() { m_NumProcessesSelected++; }
  771. void DecrementNumWinStationsSelected() { if(m_NumWinStationsSelected) m_NumWinStationsSelected--; }
  772. void DecrementNumProcessesSelected() { if(m_NumProcessesSelected) m_NumProcessesSelected--; }
  773. void RemoveWinStationProcesses(CWinStation *pWinStation); // remove all the processes for a given WinStation
  774. void QueryLicenses();
  775. CDomain *GetDomain() { return m_pDomain; }
  776. // Returns the pointer to the server's background thread
  777. CWinThread *GetThreadPointer() { return m_pBackgroundThread; }
  778. BOOL Connect();
  779. void Disconnect();
  780. // Returns the tree item handle
  781. HTREEITEM GetTreeItem() { return m_hTreeItem; }
  782. HTREEITEM GetTreeItemFromFav( ) { return m_hFavTree; }
  783. HTREEITEM GetTreeItemFromThisComputer( ) { return m_hThisServer; }
  784. // Sets the tree item handle
  785. void SetTreeItem(HTREEITEM handle) { m_hTreeItem = handle; }
  786. void SetTreeItemForFav( HTREEITEM handle ) { m_hFavTree = handle; }
  787. void SetTreeItemForThisComputer( HTREEITEM handle ) { m_hThisServer = handle; }
  788. private:
  789. void AddLicense(CLicense *pNewLicense);
  790. // the state of the server object
  791. SERVER_STATE m_State;
  792. SERVER_STATE m_PreviousState;
  793. // the name of the server
  794. TCHAR m_Name[50];
  795. // Number of WinStations (store here for sorting)
  796. ULONG m_NumWinStations;
  797. // Handle to the tree item for this server in the tree view
  798. HTREEITEM m_hThisServer;
  799. HTREEITEM m_hTreeItem;
  800. HTREEITEM m_hFavTree;
  801. // Which domain this server is in
  802. CDomain *m_pDomain;
  803. // handle from WinStationOpenServer
  804. HANDLE m_Handle;
  805. CObList m_WinStationList;
  806. CCriticalSection m_WinStationListCriticalSection;
  807. CObList m_ProcessList;
  808. CCriticalSection m_ProcessListCriticalSection;
  809. CObList m_LicenseList;
  810. CCriticalSection m_LicenseListCriticalSection;
  811. CObList m_UserSidList;
  812. CObList m_HotfixList;
  813. // Pointer to registry info structure
  814. ServerRegistryInfo *m_pRegistryInfo;
  815. // Background thread to update document when WinStations
  816. // appear, disappear, and change state
  817. // Called with AfxBeginThread
  818. static UINT BackgroundThreadProc(LPVOID);
  819. CWinThread *m_pBackgroundThread;
  820. BOOL m_BackgroundContinue;
  821. // We need a critical section to wrap accesses to m_bThreadAlive
  822. CCriticalSection m_ThreadCriticalSection;
  823. BOOL m_bThreadAlive;
  824. // Keep track of how many of each thing are selected
  825. UINT m_NumWinStationsSelected;
  826. UINT m_NumProcessesSelected;
  827. ULONG m_ServerFlags;
  828. BOOLEAN m_fManualFind;
  829. // Pointer to information stored by the extension DLL
  830. void *m_pExtensionInfo;
  831. // Pointer to extended info from the extension DLL
  832. ExtServerInfo *m_pExtServerInfo;
  833. };
  834. class CLicense : public CObject
  835. {
  836. public:
  837. // constructor
  838. CLicense(CServer *pServer, ExtLicenseInfo *pLicenseInfo);
  839. // Return the serial number (what we sort on)
  840. TCHAR *GetSerialNumber() { return m_RegSerialNumber; }
  841. // Return the license number (what we display)
  842. TCHAR *GetLicenseNumber() { return m_LicenseNumber; }
  843. // Return the license class
  844. LICENSECLASS GetClass() { return m_Class; }
  845. // Return the description
  846. TCHAR *GetDescription() { return m_Description; }
  847. // Return the local count
  848. ULONG GetLocalCount() { return ((m_PoolCount == 0xFFFFFFFF) ? m_LicenseCount : m_LicenseCount - m_PoolCount); }
  849. // Return the pooled count
  850. ULONG GetPoolCount() { return ((m_PoolCount == 0xFFFFFFFF) ? 0 : m_PoolCount); }
  851. // Return the total count
  852. ULONG GetTotalCount() { return m_LicenseCount; }
  853. // Return TRUE if this license is registers
  854. BOOLEAN IsRegistered() { return((m_Flags & ELF_REGISTERED) > 0); }
  855. // Return TRUE if pooling is enabled
  856. BOOLEAN IsPoolingEnabled() { return(m_PoolCount != 0xFFFFFFFF); }
  857. // Returns a pointer to the server this license is for
  858. CServer *GetServer() { return m_pServer; }
  859. private:
  860. LICENSECLASS m_Class;
  861. ULONG m_LicenseCount;
  862. ULONG m_PoolLicenseCount;
  863. WCHAR m_RegSerialNumber[26];
  864. WCHAR m_LicenseNumber[36];
  865. WCHAR m_Description[65];
  866. ULONG m_Flags;
  867. ULONG m_PoolCount;
  868. CServer *m_pServer;
  869. };
  870. typedef struct _MessageParms {
  871. TCHAR MessageTitle[MSG_TITLE_LENGTH + 1];
  872. TCHAR MessageBody[MSG_MESSAGE_LENGTH + 1];
  873. CWinStation* pWinStation;
  874. } MessageParms;
  875. typedef struct _ResetParms {
  876. CWinStation *pWinStation;
  877. BOOL bReset; // TRUE if reset, FALSE if logoff
  878. } ResetParms;
  879. // Flags for CWinStation objects
  880. const ULONG WF_SELECTED = 0x00000001;
  881. const ULONG WF_CAN_BE_SHADOWED = 0x00000002;
  882. const ULONG WF_DIRECT_ASYNC = 0x00000004;
  883. const ULONG WF_CURRENT = 0x00000008;
  884. const ULONG WF_HAS_USER = 0x00000010;
  885. const ULONG WF_ADDITIONAL_DONE = 0x00000020;
  886. const ULONG WF_QUERIES_SUCCESSFUL = 0x00000040;
  887. const ULONG WF_CHANGED = 0x00000080; // Changed during last enumeration
  888. const ULONG WF_NEW = 0x00000100; // New this enumeration
  889. class CWinStation : public CObject
  890. {
  891. public:
  892. // constructor
  893. CWinStation(CServer *pServer, PLOGONID pLogonId);
  894. // destructor
  895. ~CWinStation();
  896. // Updates this WinStation with new data from another CWinStation
  897. BOOL Update(CWinStation *pWinStation);
  898. // Returns a pointer to this guy's server
  899. CServer *GetServer() { return m_pServer; }
  900. // Returns the logon Id
  901. ULONG GetLogonId() { return m_LogonId; }
  902. // Returns the name of the WinStation
  903. PWINSTATIONNAME GetName() { return m_Name; }
  904. // Sets the name
  905. void SetName(PWINSTATIONNAME name) { wcscpy(m_Name, name); }
  906. // Returns the state
  907. WINSTATIONSTATECLASS GetState() { return m_State; }
  908. // Sets the state
  909. void SetState(WINSTATIONSTATECLASS state) { m_State = state; }
  910. // Returns TRUE if m_State is set to a given state
  911. BOOLEAN IsState(WINSTATIONSTATECLASS state) { return (m_State == state); }
  912. // Returns the sort order
  913. ULONG GetSortOrder() { return m_SortOrder; }
  914. // Sets the sort order
  915. void SetSortOrder(ULONG sort) { m_SortOrder = sort; }
  916. // Returns the comment
  917. TCHAR *GetComment() { return m_Comment; }
  918. // Sets the comment
  919. void SetComment(TCHAR *comment) { wcscpy(m_Comment, comment); }
  920. // Returns the user name
  921. TCHAR *GetUserName() { return m_UserName; }
  922. // Sets the user name
  923. void SetUserName(TCHAR *name) { wcscpy(m_UserName, name); }
  924. // Returns the SdClass
  925. SDCLASS GetSdClass() { return m_SdClass; }
  926. // Sets the SdClass
  927. void SetSdClass(SDCLASS pd) { m_SdClass = pd; }
  928. // Returns the Logon Time
  929. LARGE_INTEGER GetLogonTime() { return m_LogonTime; }
  930. // Sets the Logon Time
  931. void SetLogonTime(LARGE_INTEGER t) { m_LogonTime = t; }
  932. // Returns the Last Input Time
  933. LARGE_INTEGER GetLastInputTime() { return m_LastInputTime; }
  934. // Sets the Last Input Time
  935. void SetLastInputTime(LARGE_INTEGER t) { m_LastInputTime = t; }
  936. // Returns the Current Time
  937. LARGE_INTEGER GetCurrentTime() { return m_CurrentTime; }
  938. // Set the Current Time
  939. void SetCurrentTime(LARGE_INTEGER t) { m_CurrentTime = t; }
  940. // Returns the IdleTime
  941. ELAPSEDTIME GetIdleTime() { return m_IdleTime; }
  942. // Sets the IdleTime variable
  943. void SetIdleTime(ELAPSEDTIME it) { m_IdleTime = it; }
  944. // Returns the WdName
  945. PWDNAME GetWdName() { return m_WdName; }
  946. // Sets the WdName
  947. void SetWdName(PWDNAME wdname) { wcscpy(m_WdName, wdname); }
  948. // Returns the Wd Structure
  949. CWd *GetWd() { return m_pWd; }
  950. // Sets the Wd Structure
  951. void SetWd(CWd *pwd) { m_pWd = pwd; }
  952. // Returns the PdName
  953. PPDNAME GetPdName() { return m_PdName; }
  954. // Returns the Client Name
  955. TCHAR *GetClientName() { return m_ClientName; }
  956. // Sets the Client Name
  957. void SetClientName(TCHAR *name) { wcscpy(m_ClientName, name); }
  958. //returns the client digital product id
  959. TCHAR* GetClientDigProductId() { return m_clientDigProductId; }
  960. //sets the client digital product id
  961. void SetClientDigProductId( TCHAR* prodid) { wcscpy(m_clientDigProductId, prodid); }
  962. // Returns the Client Build Number
  963. ULONG GetClientBuildNumber() { return m_ClientBuildNumber; }
  964. // Returns the Client Directory
  965. TCHAR *GetClientDir() { return m_ClientDir; }
  966. // Returns the Modem Name
  967. TCHAR *GetModemName() { return m_ModemName; }
  968. // Returns the Client License
  969. TCHAR *GetClientLicense() { return m_ClientLicense; }
  970. // Returns the Client Product Id
  971. USHORT GetClientProductId() { return m_ClientProductId; }
  972. // Returns the Client Serial Number
  973. ULONG GetClientSerialNumber() { return m_ClientSerialNumber; }
  974. // Returns the Client Address
  975. TCHAR *GetClientAddress() { return m_ClientAddress; }
  976. // Returns the number of host buffers
  977. USHORT GetHostBuffers() { return m_HostBuffers; }
  978. // Returns the number of client buffers
  979. USHORT GetClientBuffers() { return m_ClientBuffers; }
  980. // Returns the buffer length
  981. USHORT GetBufferLength() { return m_BufferLength; }
  982. // Gets additional information about the WinStation
  983. void QueryAdditionalInformation();
  984. // Shadow this WinStation
  985. void Shadow();
  986. // connect to this WinStation
  987. void Connect(BOOL bUser);
  988. // show status dialog
  989. void ShowStatus();
  990. // Are there outstanding threads?
  991. BOOL HasOutstandingThreads() { return(m_OutstandingThreads > 0); }
  992. // Is this WinStation down?
  993. BOOL IsDown() { return(m_State == State_Down || m_State == State_Init); }
  994. // Is this WinStation connected?
  995. BOOL IsConnected() { return(m_State == State_Connected || m_State == State_Active); }
  996. // Is this WinStation disconnected?
  997. BOOL IsDisconnected() { return(m_State == State_Disconnected); }
  998. // Is this WinStation active?
  999. BOOL IsActive() { return(m_State == State_Active); }
  1000. // Is this WinStation idle?
  1001. BOOL IsIdle() { return(m_State == State_Idle); }
  1002. // Is this WinStation a listener?
  1003. BOOL IsListener() { return(m_State == State_Listen); }
  1004. // Is this the system console
  1005. BOOL IsSystemConsole() { return(0 == lstrcmpi(m_Name, ((CWinAdminApp*)AfxGetApp())->m_szSystemConsole)); }
  1006. // Returns TRUE if this WinStation is on the current server
  1007. BOOL IsOnCurrentServer() { return m_pServer->IsCurrentServer(); }
  1008. // Returns TRUE if the current user is logged in on this WinStation
  1009. BOOL IsCurrentUser() { return(m_pServer->IsCurrentServer() && m_LogonId == ((CWinAdminApp*)AfxGetApp())->GetCurrentLogonId()); }
  1010. //BOOL IsCurrentUser() { return(m_pServer->IsCurrentServer() && (lstrcmpi(m_UserName, ((CWinAdminApp*)AfxGetApp())->GetCurrentUserName()) == 0)); }
  1011. // Returns TRUE if this is the current WinStation
  1012. BOOL IsCurrentWinStation() { return(m_pServer->IsCurrentServer() && m_LogonId == ((CWinAdminApp*)AfxGetApp())->GetCurrentLogonId()); }
  1013. // Returns the handle to this WinStations's tree item
  1014. HTREEITEM GetTreeItem() { return m_hTreeItem; }
  1015. HTREEITEM GetTreeItemFromFav( ) { return m_hFavTree; }
  1016. HTREEITEM GetTreeItemFromThisComputer( ) { return m_hTreeThisComputer; }
  1017. // Sets the tree item handle
  1018. void SetTreeItem(HTREEITEM handle) { m_hTreeItem = handle; }
  1019. void SetTreeItemForFav( HTREEITEM handle ) { m_hFavTree = handle; }
  1020. void SetTreeItemForThisComputer( HTREEITEM handle ) { m_hTreeThisComputer = handle; }
  1021. // Returns the number of colors
  1022. TCHAR *GetColors() { return m_Colors; }
  1023. // Returns the vertical resolution
  1024. USHORT GetVRes() { return m_VRes; }
  1025. // Returns the horizontal resolution
  1026. USHORT GetHRes() { return m_HRes; }
  1027. // Returns the protocol
  1028. USHORT GetProtocolType() { return m_ProtocolType; }
  1029. // Returns the encryption level
  1030. BYTE GetEncryptionLevel() { return m_EncryptionLevel; }
  1031. // Sets the encryption level
  1032. void SetEncryptionLevel(BYTE level) { m_EncryptionLevel = level; }
  1033. // Fills in the CString with the description of the Encryption level
  1034. BOOL GetEncryptionLevelString(CString *pString) {
  1035. if(m_pWd) {
  1036. return m_pWd->GetEncryptionLevelString(m_EncryptionLevel, pString);
  1037. }
  1038. else return FALSE;
  1039. }
  1040. // Returns the name of the Wd in the registry
  1041. TCHAR *GetWdRegistryName() { return (m_pWd) ? m_pWd->GetRegistryName() : NULL; }
  1042. // Returns the time of the last update to this WinStation's data
  1043. clock_t GetLastUpdateClock() { return m_LastUpdateClock; }
  1044. void SetLastUpdateClock() { m_LastUpdateClock = clock(); }
  1045. // Is this an ICA WinStation?
  1046. BOOL IsICA() { return(m_ProtocolType == PROTOCOL_ICA); }
  1047. // Can this WinStation be shadowed
  1048. BOOL CanBeShadowed() { return((m_WinStationFlags & WF_CAN_BE_SHADOWED) > 0); }
  1049. void SetCanBeShadowed() { m_WinStationFlags |= WF_CAN_BE_SHADOWED; }
  1050. void ClearCanBeShadowed() { m_WinStationFlags &= ~WF_CAN_BE_SHADOWED; }
  1051. BOOLEAN IsDirectAsync() { return (m_WinStationFlags & WF_DIRECT_ASYNC) > 0; }
  1052. void SetDirectAsync() { m_WinStationFlags |= WF_DIRECT_ASYNC; }
  1053. void ClearDirectAsync() { m_WinStationFlags &= ~WF_DIRECT_ASYNC; }
  1054. BOOLEAN IsCurrent() { return (m_WinStationFlags & WF_CURRENT) > 0; }
  1055. void SetCurrent() { m_WinStationFlags |= WF_CURRENT; }
  1056. void ClearCurrent() { m_WinStationFlags &= ~WF_CURRENT; }
  1057. BOOLEAN IsChanged() { return (m_WinStationFlags & WF_CHANGED) > 0; }
  1058. void SetChanged() { m_WinStationFlags |= WF_CHANGED; }
  1059. void ClearChanged() { m_WinStationFlags &= ~WF_CHANGED; }
  1060. BOOLEAN IsNew() { return (m_WinStationFlags & WF_NEW) > 0; }
  1061. void SetNew() { m_WinStationFlags |= WF_NEW; }
  1062. void ClearNew() { m_WinStationFlags &= ~WF_NEW; }
  1063. BOOLEAN IsSelected() { return (m_WinStationFlags & WF_SELECTED) > 0; }
  1064. void SetSelected()
  1065. {
  1066. if (!IsSelected())
  1067. {
  1068. m_WinStationFlags |= WF_SELECTED;
  1069. m_pServer->IncrementNumWinStationsSelected();
  1070. }
  1071. }
  1072. void ClearSelected()
  1073. {
  1074. if (IsSelected())
  1075. {
  1076. m_WinStationFlags &= ~WF_SELECTED;
  1077. m_pServer->DecrementNumWinStationsSelected();
  1078. }
  1079. }
  1080. BOOLEAN HasUser() { return (m_WinStationFlags & WF_HAS_USER) > 0; }
  1081. void SetHasUser() { m_WinStationFlags |= WF_HAS_USER; }
  1082. void ClearHasUser() { m_WinStationFlags &= ~WF_HAS_USER; }
  1083. BOOLEAN AdditionalDone() { return (m_WinStationFlags & WF_ADDITIONAL_DONE) > 0; }
  1084. void SetAdditionalDone() { m_WinStationFlags |= WF_ADDITIONAL_DONE; }
  1085. void ClearAdditionalDone() { m_WinStationFlags &= ~WF_ADDITIONAL_DONE; }
  1086. BOOL QueriesSuccessful() { return (m_WinStationFlags & WF_QUERIES_SUCCESSFUL) > 0; }
  1087. void SetQueriesSuccessful() { m_WinStationFlags |= WF_QUERIES_SUCCESSFUL; }
  1088. void ClearQueriesSuccessful() { m_WinStationFlags &= ~WF_QUERIES_SUCCESSFUL; }
  1089. // Sets the pointer to the info from the extension DLL
  1090. void SetExtensionInfo(void *p) { m_pExtensionInfo = p; }
  1091. // Returns the pointer to the info from the extension DLL
  1092. void *GetExtensionInfo() { return m_pExtensionInfo; }
  1093. // Sets the pointer to the info from the extension DLL
  1094. void SetExtendedInfo(ExtWinStationInfo *p) { m_pExtWinStationInfo = p; }
  1095. // Returns a pointer to the info from the extension DLL
  1096. ExtWinStationInfo *GetExtendedInfo() { return m_pExtWinStationInfo; }
  1097. // Returns a pointer to the module info from the extension DLL
  1098. ExtModuleInfo *GetExtModuleInfo() { return m_pExtModuleInfo; }
  1099. // Sets the pointer to the module info from the extension DLL
  1100. void SetExtModuleInfo(ExtModuleInfo *m) { m_pExtModuleInfo = m; }
  1101. // Returns the number of modules
  1102. ULONG GetNumModules() { return m_NumModules; }
  1103. void BeginOutstandingThread() {
  1104. ::InterlockedIncrement(&m_OutstandingThreads);
  1105. //((CWinAdminApp*)AfxGetApp())->BeginOutStandingThread());
  1106. }
  1107. void EndOutstandingThread() {
  1108. ::InterlockedDecrement(&m_OutstandingThreads);
  1109. //((CWinAdminApp*)AfxGetApp())->EndOutStandingThread());
  1110. }
  1111. // static member function to send a message to a WinStation
  1112. // Called with AfxBeginThread
  1113. static UINT SendMessage(LPVOID);
  1114. // static member function to disconnect a WinStation
  1115. // Called with AfxBeginThread
  1116. static UINT Disconnect(LPVOID);
  1117. // static member function to reset a WinStation
  1118. // Called with AfxBeginThread
  1119. static UINT Reset(LPVOID);
  1120. private:
  1121. CServer* m_pServer;
  1122. CWd* m_pWd;
  1123. ULONG m_LogonId;
  1124. WINSTATIONNAME m_Name;
  1125. WINSTATIONSTATECLASS m_State;
  1126. ULONG m_SortOrder;
  1127. TCHAR m_Comment[WINSTATIONCOMMENT_LENGTH + 1];
  1128. TCHAR m_UserName[USERNAME_LENGTH + 1];
  1129. SDCLASS m_SdClass;
  1130. LARGE_INTEGER m_LogonTime;
  1131. LARGE_INTEGER m_LastInputTime;
  1132. LARGE_INTEGER m_CurrentTime;
  1133. ELAPSEDTIME m_IdleTime;
  1134. WDNAME m_WdName;
  1135. PDNAME m_PdName;
  1136. TCHAR m_ClientName[CLIENTNAME_LENGTH + 1];
  1137. ULONG m_ClientBuildNumber;
  1138. TCHAR m_ClientDir[256];
  1139. TCHAR m_ModemName[256];
  1140. TCHAR m_ClientLicense[30];
  1141. USHORT m_ClientProductId;
  1142. ULONG m_ClientSerialNumber;
  1143. TCHAR m_ClientAddress[30];
  1144. USHORT m_HostBuffers;
  1145. USHORT m_ClientBuffers;
  1146. USHORT m_BufferLength;
  1147. LONG m_OutstandingThreads; // the number of outstanding threads
  1148. HTREEITEM m_hTreeItem; // tree item for this WinStation in the servers tree view
  1149. HTREEITEM m_hFavTree;
  1150. HTREEITEM m_hTreeThisComputer;
  1151. USHORT m_VRes; // Vertical resolution
  1152. USHORT m_HRes; // Horizontal resolution
  1153. TCHAR m_Colors[4]; // Number of colors (as an ASCII string)
  1154. clock_t m_LastUpdateClock; // Tick count when we last update this WinStation's info
  1155. USHORT m_ProtocolType; // Protocol - PROTOCOL_ICA or PROTOCOL_RDP
  1156. BYTE m_EncryptionLevel; // security level of encryption pd
  1157. ULONG m_WinStationFlags;
  1158. // Pointer to information stored by the extension DLL
  1159. void *m_pExtensionInfo;
  1160. ExtWinStationInfo *m_pExtWinStationInfo;
  1161. ExtModuleInfo *m_pExtModuleInfo;
  1162. ULONG m_NumModules;
  1163. TCHAR m_clientDigProductId[CLIENT_PRODUCT_ID_LENGTH];
  1164. };
  1165. // Process flags
  1166. const ULONG PF_SYSTEM = 0x00000001;
  1167. const ULONG PF_SELECTED = 0x00000002;
  1168. const ULONG PF_TERMINATING = 0x00000004; // Currently trying to terminate it
  1169. const ULONG PF_CHANGED = 0x00000008; // Changed during last enumeration
  1170. const ULONG PF_CURRENT = 0x00000010; // Still active during last enumeration
  1171. const ULONG PF_NEW = 0x00000020; // New this enumeration
  1172. class CProcess : public CObject
  1173. {
  1174. public:
  1175. // Constructor
  1176. CProcess(ULONG PID,
  1177. ULONG LogonId,
  1178. CServer *pServer,
  1179. PSID pSID,
  1180. CWinStation *pWinStation,
  1181. TCHAR *ImageName);
  1182. // Updates a process with new information from another process
  1183. BOOL Update(CProcess *pProcess);
  1184. // Returns a pointer to the server that this Process if running on
  1185. CServer *GetServer() { return m_pServer; }
  1186. // Sets the Server
  1187. void SetServer(CServer *pServer) { m_pServer = pServer; }
  1188. // Returns a pointer to the WinStation that owns this process
  1189. CWinStation *GetWinStation() { return m_pWinStation; }
  1190. // Sets the Winstation
  1191. void SetWinStation(CWinStation *pWinStation) { m_pWinStation = pWinStation; }
  1192. // Returns the PID of this process
  1193. ULONG GetPID() { return m_PID; }
  1194. // Returns the LogonId for this process
  1195. ULONG GetLogonId() { return m_LogonId; }
  1196. // Returns a pointer to the image name
  1197. TCHAR *GetImageName() { return m_ImageName; }
  1198. // Returns a pointer to the user name
  1199. TCHAR *GetUserName() { return m_UserName; }
  1200. // Returns TRUE if this process belongs to the current user
  1201. // BOOL IsCurrentUsers() { return (m_pServer->IsCurrentServer()
  1202. // && wcscmp(m_UserName, ((CWinAdminApp*)AfxGetApp())->GetCurrentUserName())==0); }
  1203. BOOL IsCurrentUsers() { return(m_pServer->IsCurrentServer() && m_LogonId == ((CWinAdminApp*)AfxGetApp())->GetCurrentLogonId()); }
  1204. BOOLEAN IsSystemProcess() { return (m_Flags & PF_SYSTEM) > 0; }
  1205. void SetSystemProcess() { m_Flags |= PF_SYSTEM; }
  1206. void ClearSystemProcess() { m_Flags &= ~PF_SYSTEM; }
  1207. BOOLEAN IsSelected() { return (m_Flags & PF_SELECTED) > 0; }
  1208. void SetSelected() { m_Flags |= PF_SELECTED; m_pServer->IncrementNumProcessesSelected(); }
  1209. void ClearSelected() { m_Flags &= ~PF_SELECTED; m_pServer->DecrementNumProcessesSelected(); }
  1210. BOOLEAN IsTerminating() { return (m_Flags & PF_TERMINATING) > 0; }
  1211. void SetTerminating() { m_Flags |= PF_TERMINATING; }
  1212. void ClearTerminating() { m_Flags &= ~PF_TERMINATING; }
  1213. BOOLEAN IsCurrent() { return (m_Flags & PF_CURRENT) > 0; }
  1214. void SetCurrent() { m_Flags |= PF_CURRENT; }
  1215. void ClearCurrent() { m_Flags &= ~PF_CURRENT; }
  1216. BOOLEAN IsChanged() { return (m_Flags & PF_CHANGED) > 0; }
  1217. void SetChanged() { m_Flags |= PF_CHANGED; }
  1218. void ClearChanged() { m_Flags &= ~PF_CHANGED; }
  1219. BOOLEAN IsNew() { return (m_Flags & PF_NEW) > 0; }
  1220. void SetNew() { m_Flags |= PF_NEW; }
  1221. void ClearNew() { m_Flags &= ~PF_NEW; }
  1222. private:
  1223. // Determine whether or not this is a system process
  1224. BOOL QuerySystemProcess();
  1225. // Determine which user owns a process
  1226. void DetermineProcessUser(PSID pSid);
  1227. ULONG m_PID;
  1228. ULONG m_LogonId;
  1229. USHORT m_SidCrc;
  1230. TCHAR m_ImageName[20];//[MAX_PROCESSNAME+1];
  1231. TCHAR m_UserName[USERNAME_LENGTH+1];
  1232. CServer *m_pServer;
  1233. CWinStation *m_pWinStation;
  1234. ULONG m_Flags;
  1235. };
  1236. class CAdminView : public CView
  1237. {
  1238. public:
  1239. virtual void Reset(void *) { }
  1240. virtual LRESULT OnTabbed( WPARAM , LPARAM ){ return 0;}
  1241. };
  1242. //=------------------------------------------------
  1243. class CMyTabCtrl : public CTabCtrl
  1244. {
  1245. public:
  1246. CMyTabCtrl()
  1247. {
  1248. }
  1249. protected:
  1250. afx_msg void OnSetFocus( CWnd* );
  1251. DECLARE_MESSAGE_MAP()
  1252. };
  1253. //=------------------------------------------------
  1254. class CAdminPage : public CFormView
  1255. {
  1256. friend class CServerView;
  1257. friend class CWinStationView;
  1258. friend class CAllServersView;
  1259. friend class CDomainView;
  1260. public:
  1261. CAdminPage(UINT nIDTemplate);
  1262. CAdminPage();
  1263. DECLARE_DYNCREATE(CAdminPage)
  1264. virtual void Reset(void *) { }
  1265. virtual void ClearSelections() { }
  1266. };
  1267. typedef struct _columndefs {
  1268. UINT stringID;
  1269. int format;
  1270. int width;
  1271. } ColumnDef;
  1272. // Commonly used column definitions
  1273. #define CD_SERVER { IDS_COL_SERVER, LVCFMT_LEFT, 115 }
  1274. #define CD_USER { IDS_COL_USER, LVCFMT_LEFT, 100 }
  1275. #define CD_USER2 { IDS_COL_USER, LVCFMT_LEFT, 80 }
  1276. #define CD_USER3 { IDS_COL_USER, LVCFMT_LEFT, 90 }
  1277. #define CD_SESSION { IDS_COL_WINSTATION, LVCFMT_LEFT, 80 }
  1278. #define CD_SESSION2 { IDS_COL_WINSTATION, LVCFMT_LEFT, 100 }
  1279. #define CD_ID { IDS_COL_ID, LVCFMT_RIGHT, 30 }
  1280. #define CD_STATE { IDS_COL_STATE, LVCFMT_LEFT, 50 }
  1281. #define CD_TYPE { IDS_COL_TYPE, LVCFMT_LEFT, 80 }
  1282. #define CD_CLIENT_NAME { IDS_COL_CLIENT_NAME, LVCFMT_LEFT, 80 }
  1283. #define CD_IDLETIME { IDS_COL_IDLETIME, LVCFMT_RIGHT, 80 }
  1284. #define CD_LOGONTIME { IDS_COL_LOGONTIME, LVCFMT_LEFT, 90 }
  1285. #define CD_COMMENT { IDS_COL_COMMENT, LVCFMT_LEFT, 200 }
  1286. // Server Columns
  1287. #define CD_TCPADDRESS { IDS_COL_TCPADDRESS, LVCFMT_LEFT, 90 }
  1288. #define CD_IPXADDRESS { IDS_COL_IPXADDRESS, LVCFMT_LEFT, 110 }
  1289. #define CD_NUM_SESSIONS { IDS_COL_NUM_WINSTATIONS, LVCFMT_RIGHT, 70 }
  1290. // License Columns
  1291. #define CD_LICENSE_DESC { IDS_COL_LICENSE_DESC, LVCFMT_LEFT, 200 }
  1292. #define CD_LICENSE_REG { IDS_COL_LICENSE_REGISTERED, LVCFMT_CENTER, 80 }
  1293. #define CD_USERCOUNT { IDS_COL_USERCOUNT, LVCFMT_RIGHT, 80 }
  1294. #define CD_POOLCOUNT { IDS_COL_POOLCOUNT, LVCFMT_RIGHT, 80 }
  1295. #define CD_LICENSE_NUM { IDS_COL_LICENSE_NUMBER, LVCFMT_LEFT, 240 }
  1296. // Process Columns
  1297. #define CD_PROC_ID { IDS_COL_ID, LVCFMT_RIGHT, 30 }
  1298. #define CD_PROC_PID { IDS_COL_PID, LVCFMT_RIGHT, 50 }
  1299. #define CD_PROC_IMAGE { IDS_COL_IMAGE, LVCFMT_LEFT, 100 }
  1300. // Hotfix Columns
  1301. #define CD_HOTFIX { IDS_COL_HOTFIX, LVCFMT_LEFT, 90 }
  1302. #define CD_INSTALLED_BY { IDS_COL_INSTALLED_BY, LVCFMT_LEFT, 90 }
  1303. #define CD_INSTALLED_ON { IDS_COL_INSTALLED_ON, LVCFMT_LEFT, 150 }
  1304. // Definitions of PageDef flags
  1305. const UINT PF_PICASSO_ONLY = 0x0001;
  1306. const UINT PF_NO_TAB = 0x0002;
  1307. typedef struct _pagedef {
  1308. CAdminPage *m_pPage;
  1309. CRuntimeClass *m_pRuntimeClass;
  1310. UINT tabStringID;
  1311. int page;
  1312. UINT flags;
  1313. } PageDef;
  1314. //defines for help
  1315. //=================================================================================
  1316. #define ID_HELP_FILE L"tsadmin.hlp"
  1317. //==================================================================================
  1318. #define HIDC_MESSAGE_TITLE 0x500FB
  1319. #define HIDC_SHADOWSTART_HOTKEY 0x500F1
  1320. #define HIDC_SHADOWSTART_SHIFT 0x500F2
  1321. #define HIDC_SHADOWSTART_CTRL 0x500F3
  1322. #define HIDC_SHADOWSTART_ALT 0x500F4
  1323. #define HIDC_MESSAGE_TITLE 0x500FB
  1324. #define HIDC_MESSAGE_MESSAGE 0x500FC
  1325. #define HIDC_COMMON_USERNAME 0x5012C
  1326. #define HIDC_COMMON_WINSTATIONNAME 0x5012D
  1327. #define HIDC_COMMON_IBYTES 0x5012E
  1328. #define HIDC_COMMON_OBYTES 0x5012F
  1329. #define HIDC_COMMON_IFRAMES 0x50130
  1330. #define HIDC_COMMON_OFRAMES 0x50131
  1331. #define HIDC_COMMON_IBYTESPERFRAME 0x50132
  1332. #define HIDC_COMMON_OBYTESPERFRAME 0x50133
  1333. #define HIDC_COMMON_IFRAMEERRORS 0x50134
  1334. #define HIDC_COMMON_OFRAMEERRORS 0x50135
  1335. #define HIDC_COMMON_IPERCENTFRAMEERRORS 0x50136
  1336. #define HIDC_COMMON_OPERCENTFRAMEERRORS 0x50137
  1337. #define HIDC_COMMON_ITIMEOUTERRORS 0x50138
  1338. #define HIDC_COMMON_OTIMEOUTERRORS 0x50139
  1339. #define HIDC_COMMON_ICOMPRESSIONRATIO 0x5013A
  1340. #define HIDC_COMMON_OCOMPRESSIONRATIO 0x5013B
  1341. #define HIDC_REFRESHNOW 0x50140
  1342. #define HIDC_RESETCOUNTERS 0x50141
  1343. #define HIDC_MOREINFO 0x50142
  1344. #define HIDC_ASYNC_DEVICE 0x5015F
  1345. #define HIDC_ASYNC_BAUD 0x50160
  1346. #define HIDC_ASYNC_DTR 0x50161
  1347. #define HIDC_ASYNC_RTS 0x50162
  1348. #define HIDC_ASYNC_CTS 0x50163
  1349. #define HIDC_ASYNC_DSR 0x50164
  1350. #define HIDC_ASYNC_DCD 0x50165
  1351. #define HIDC_ASYNC_RI 0x50166
  1352. #define HIDC_ASYNC_IFRAMING 0x50167
  1353. #define HIDC_ASYNC_IOVERRUN 0x50168
  1354. #define HIDC_ASYNC_IOVERFLOW 0x50169
  1355. #define HIDC_ASYNC_IPARITY 0x5016A
  1356. #define HIDC_ASYNC_OFRAMING 0x5016B
  1357. #define HIDC_ASYNC_OOVERRUN 0x5016C
  1358. #define HIDC_ASYNC_OOVERFLOW 0x5016D
  1359. #define HIDC_ASYNC_OPARITY 0x5016E
  1360. #define HIDC_NETWORK_LANADAPTER 0x50173
  1361. #define HIDC_PREFERENCES_PROC_MANUAL 0x503EF
  1362. #define HIDC_PREFERENCES_PROC_EVERY 0x503F0
  1363. #define HIDC_PREFERENCES_PROC_SECONDS 0x503F1
  1364. #define HIDC_PREFERENCES_STATUS_MANUAL 0x503F3
  1365. #define HIDC_PREFERENCES_STATUS_EVERY 0x503F4
  1366. #define HIDC_PREFERENCES_STATUS_SECONDS 0x503F5
  1367. #define HIDC_PREFERENCES_CONFIRM 0x503F7
  1368. #define HIDC_PREFERENCES_SAVE 0x503F8
  1369. #define HIDC_PREFERENCES_REMEMBER 0X50443
  1370. #define HIDD_SERVER_WINSTATIONS 0x20084
  1371. #define HIDD_SERVER_PROCESSES 0x20085
  1372. #define HIDD_SERVER_USERS 0x20086
  1373. #define HIDD_SERVER_LICENSES 0x20087
  1374. #define HIDD_WINSTATION_INFO 0x20099
  1375. #define HIDD_WINSTATION_PROCESSES 0x2009A
  1376. #define HIDD_PREFERENCES 0x2009C
  1377. #define HIDD_SERVER_INFO 0x2009D
  1378. #define HIDD_MESSAGE 0x200FA
  1379. #define HIDD_ASYNC_STATUS 0x2015E
  1380. #define HIDD_NETWORK_STATUS 0x20172
  1381. #define HIDD_CONNECT_PASSWORD 0x201B8
  1382. #define HIDD_ALL_SERVER_PROCESSES 0x201BA
  1383. #define HIDD_ALL_SERVER_USERS 0x201BB
  1384. #define HIDD_ALL_SERVER_SESSIONS 0x201BC
  1385. #define HIDD_BAD_SERVER 0x201BE
  1386. #define HIDD_LISTENER 0x201BF
  1387. #define HIDD_WINSTATION_NOINFO 0x201C0
  1388. #define HIDD_BUSY_SERVER 0x201C1
  1389. #define HIDD_WINSTATION_CACHE 0x201C2
  1390. #define HIDD_BAD_WINSTATION 0x201C3
  1391. //==========================================================================================
  1392. //Global variable for help
  1393. static const DWORD aMenuHelpIDs[] =
  1394. {
  1395. IDC_MESSAGE_TITLE, HIDC_MESSAGE_TITLE,
  1396. IDC_MESSAGE_MESSAGE,HIDC_MESSAGE_MESSAGE,
  1397. IDC_SHADOWSTART_HOTKEY,HIDC_SHADOWSTART_HOTKEY,
  1398. IDC_SHADOWSTART_SHIFT ,HIDC_SHADOWSTART_SHIFT,
  1399. IDC_SHADOWSTART_CTRL ,HIDC_SHADOWSTART_CTRL,
  1400. IDC_SHADOWSTART_ALT ,HIDC_SHADOWSTART_ALT,
  1401. IDC_COMMON_USERNAME ,HIDC_COMMON_USERNAME,
  1402. IDC_COMMON_WINSTATIONNAME ,HIDC_COMMON_WINSTATIONNAME,
  1403. IDC_COMMON_IBYTES,HIDC_COMMON_IBYTES,
  1404. IDC_COMMON_OBYTES ,HIDC_COMMON_OBYTES,
  1405. IDC_COMMON_IFRAMES ,HIDC_COMMON_IFRAMES,
  1406. IDC_COMMON_OFRAMES ,HIDC_COMMON_OFRAMES,
  1407. IDC_COMMON_IBYTESPERFRAME ,HIDC_COMMON_IBYTESPERFRAME,
  1408. IDC_COMMON_OBYTESPERFRAME ,HIDC_COMMON_OBYTESPERFRAME,
  1409. IDC_COMMON_IFRAMEERRORS ,HIDC_COMMON_IFRAMEERRORS,
  1410. IDC_COMMON_OFRAMEERRORS ,HIDC_COMMON_OFRAMEERRORS,
  1411. IDC_COMMON_IPERCENTFRAMEERRORS ,HIDC_COMMON_IPERCENTFRAMEERRORS,
  1412. IDC_COMMON_OPERCENTFRAMEERRORS ,HIDC_COMMON_OPERCENTFRAMEERRORS,
  1413. IDC_COMMON_ITIMEOUTERRORS ,HIDC_COMMON_ITIMEOUTERRORS,
  1414. IDC_COMMON_OTIMEOUTERRORS,HIDC_COMMON_OTIMEOUTERRORS,
  1415. IDC_COMMON_ICOMPRESSIONRATIO ,HIDC_COMMON_ICOMPRESSIONRATIO,
  1416. IDC_COMMON_OCOMPRESSIONRATIO ,HIDC_COMMON_OCOMPRESSIONRATIO,
  1417. IDC_REFRESHNOW ,HIDC_REFRESHNOW,
  1418. IDC_RESETCOUNTERS,HIDC_RESETCOUNTERS,
  1419. IDC_MOREINFO,HIDC_MOREINFO,
  1420. IDC_ASYNC_DEVICE, HIDC_ASYNC_DEVICE ,
  1421. IDC_ASYNC_BAUD ,HIDC_ASYNC_BAUD ,
  1422. IDC_ASYNC_DTR , HIDC_ASYNC_DTR ,
  1423. IDC_ASYNC_RTS , HIDC_ASYNC_RTS ,
  1424. IDC_ASYNC_CTS , HIDC_ASYNC_CTS ,
  1425. IDC_ASYNC_DSR , HIDC_ASYNC_DSR ,
  1426. IDC_ASYNC_DCD , HIDC_ASYNC_DCD ,
  1427. IDC_ASYNC_RI , HIDC_ASYNC_RI ,
  1428. IDC_ASYNC_IFRAMING , HIDC_ASYNC_IFRAMING ,
  1429. IDC_ASYNC_IOVERRUN , HIDC_ASYNC_IOVERRUN ,
  1430. IDC_ASYNC_IOVERFLOW , HIDC_ASYNC_IOVERFLOW,
  1431. IDC_ASYNC_IPARITY , HIDC_ASYNC_IPARITY ,
  1432. IDC_ASYNC_OFRAMING , HIDC_ASYNC_OFRAMING ,
  1433. IDC_ASYNC_OOVERRUN , HIDC_ASYNC_OOVERRUN ,
  1434. IDC_ASYNC_OOVERFLOW , HIDC_ASYNC_OOVERFLOW ,
  1435. IDC_ASYNC_OPARITY , HIDC_ASYNC_OPARITY ,
  1436. IDC_NETWORK_LANADAPTER, HIDC_NETWORK_LANADAPTER,
  1437. IDC_PREFERENCES_PROC_MANUAL ,HIDC_PREFERENCES_PROC_MANUAL ,
  1438. IDC_PREFERENCES_PROC_EVERY , HIDC_PREFERENCES_PROC_EVERY ,
  1439. IDC_PREFERENCES_PROC_SECONDS , HIDC_PREFERENCES_PROC_SECONDS,
  1440. IDC_PREFERENCES_STATUS_MANUAL , HIDC_PREFERENCES_STATUS_MANUAL,
  1441. IDC_PREFERENCES_STATUS_EVERY , HIDC_PREFERENCES_STATUS_EVERY,
  1442. IDC_PREFERENCES_STATUS_SECONDS , HIDC_PREFERENCES_STATUS_SECONDS ,
  1443. IDC_PREFERENCES_STATUS_SECONDS ,HIDC_PREFERENCES_STATUS_SECONDS ,
  1444. IDC_PREFERENCES_CONFIRM ,HIDC_PREFERENCES_CONFIRM ,
  1445. IDD_WINSTATION_NOINFO,HIDD_WINSTATION_NOINFO,
  1446. IDC_PREFERENCES_SAVE , HIDC_PREFERENCES_SAVE,
  1447. IDC_PREFERENCES_PERSISTENT ,HIDC_PREFERENCES_REMEMBER,
  1448. };
  1449. /////////////////////////////////////////////////////////////////////////////
  1450. #endif // _WINADMIN_H