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.

519 lines
20 KiB

  1. // *********************************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // Module Name:
  6. //
  7. // TaskList.h
  8. //
  9. // Abstract:
  10. //
  11. // macros and function prototypes of TList.cpp
  12. //
  13. // Author:
  14. //
  15. // Sunil G.V.N. Murali ([email protected]) 24-Sep-2000
  16. //
  17. // Revision History:
  18. //
  19. // Sunil G.V.N. Murali ([email protected]) 24-Sep-2000 : Created It.
  20. //
  21. // *********************************************************************************
  22. #ifndef _TASKLIST_H
  23. #define _TASKLIST_H
  24. // resource header file
  25. #include "resource.h"
  26. //
  27. // NOTE: THIS MODULE WILL WRITTEN IN SUCH A FASHION THAT IT WORKS ONLY
  28. // IN UNICODE BUILD COMPILATION
  29. //
  30. #ifndef UNICODE
  31. #error Must compile only in unicode build environment
  32. #endif
  33. //
  34. // general purpose macros
  35. //
  36. #define EXIT_PROCESS( exitcode ) \
  37. ReleaseGlobals(); \
  38. return exitcode; \
  39. 1
  40. #define DISPLAY_GET_REASON() ShowMessageEx( stderr, 2, FALSE, L"%1 %2", \
  41. TAG_ERROR, GetReason() )
  42. //
  43. // winstation related structures ( extract from winsta.h - internal file )
  44. //
  45. //
  46. // structures
  47. typedef struct _CITRIX_PROCESS_INFORMATION {
  48. ULONG MagicNumber;
  49. ULONG LogonId;
  50. PVOID ProcessSid;
  51. ULONG Pad;
  52. } CITRIX_PROCESS_INFORMATION, * PCITRIX_PROCESS_INFORMATION;
  53. // ...
  54. typedef struct _TS_UNICODE_STRING {
  55. USHORT Length;
  56. USHORT MaximumLength;
  57. PWSTR Buffer;
  58. } TS_UNICODE_STRING;
  59. // CAUTION:
  60. // TS_SYSTEM_PROCESS_INFORMATION is duplicated from ntexapi.h, and slightly modified.
  61. // (not nice, but necessary because the Midl compiler doesn't like PVOID !)
  62. typedef struct _TS_SYSTEM_PROCESS_INFORMATION {
  63. ULONG NextEntryOffset;
  64. ULONG NumberOfThreads;
  65. LARGE_INTEGER SpareLi1;
  66. LARGE_INTEGER SpareLi2;
  67. LARGE_INTEGER SpareLi3;
  68. LARGE_INTEGER CreateTime;
  69. LARGE_INTEGER UserTime;
  70. LARGE_INTEGER KernelTime;
  71. TS_UNICODE_STRING ImageName;
  72. LONG BasePriority; // KPRIORITY in ntexapi.h
  73. DWORD UniqueProcessId; // HANDLE in ntexapi.h
  74. DWORD InheritedFromUniqueProcessId; // HANDLE in ntexapi.h
  75. ULONG HandleCount;
  76. ULONG SessionId;
  77. ULONG SpareUl3;
  78. SIZE_T PeakVirtualSize;
  79. SIZE_T VirtualSize;
  80. ULONG PageFaultCount;
  81. ULONG PeakWorkingSetSize;
  82. ULONG WorkingSetSize;
  83. SIZE_T QuotaPeakPagedPoolUsage;
  84. SIZE_T QuotaPagedPoolUsage;
  85. SIZE_T QuotaPeakNonPagedPoolUsage;
  86. SIZE_T QuotaNonPagedPoolUsage;
  87. SIZE_T PagefileUsage;
  88. SIZE_T PeakPagefileUsage;
  89. SIZE_T PrivatePageCount;
  90. } TS_SYSTEM_PROCESS_INFORMATION, *PTS_SYSTEM_PROCESS_INFORMATION;
  91. // ...
  92. typedef struct _TS_ALL_PROCESSES_INFO {
  93. PTS_SYSTEM_PROCESS_INFORMATION pspiProcessInfo;
  94. DWORD SizeOfSid;
  95. PBYTE pSid;
  96. } TS_ALL_PROCESSES_INFO, *PTS_ALL_PROCESSES_INFO;
  97. // defines
  98. #define SERVERNAME_CURRENT ((HANDLE)NULL)
  99. #define GAP_LEVEL_BASIC 0
  100. #define CITRIX_PROCESS_INFO_MAGIC 0x23495452
  101. #define WINSTATIONNAME_LENGTH 64
  102. #define WINSTA_DLLNAME L"Winsta.dll"
  103. #define FUNCNAME_WinStationFreeMemory "WinStationFreeMemory"
  104. #define FUNCNAME_WinStationCloseServer "WinStationCloseServer"
  105. #define FUNCNAME_WinStationOpenServerW "WinStationOpenServerW"
  106. #define FUNCNAME_WinStationEnumerateProcesses "WinStationEnumerateProcesses"
  107. #define FUNCNAME_WinStationFreeGAPMemory "WinStationFreeGAPMemory"
  108. #define FUNCNAME_WinStationGetAllProcesses "WinStationGetAllProcesses"
  109. #define FUNCNAME_WinStationNameFromLogonIdW "WinStationNameFromLogonIdW"
  110. #define SIZEOF_SYSTEM_THREAD_INFORMATION sizeof( struct SYSTEM_THREAD_INFORMATION )
  111. #define SIZEOF_SYSTEM_PROCESS_INFORMATION sizeof( struct SYSTEM_PROCESS_INFORMATION )
  112. //
  113. // function prototypes
  114. typedef BOOLEAN (WINAPI * FUNC_WinStationFreeMemory)( PVOID pBuffer );
  115. typedef BOOLEAN (WINAPI * FUNC_WinStationCloseServer)( HANDLE hServer );
  116. typedef HANDLE (WINAPI * FUNC_WinStationOpenServerW)( LPWSTR pwszServerName );
  117. typedef BOOLEAN (WINAPI * FUNC_WinStationNameFromLogonIdW)( HANDLE hServer,
  118. ULONG LogonId, LPWSTR pwszWinStationName );
  119. typedef BOOLEAN (WINAPI * FUNC_WinStationEnumerateProcesses)( HANDLE hServer, PVOID *ppProcessBuffer );
  120. typedef BOOLEAN (WINAPI * FUNC_WinStationFreeGAPMemory)( ULONG Level,
  121. PVOID ProcessArray, ULONG ulCount );
  122. typedef BOOLEAN (WINAPI * FUNC_WinStationGetAllProcesses)( HANDLE hServer,
  123. ULONG Level, ULONG *pNumberOfProcesses,
  124. PVOID *ppProcessArray );
  125. //
  126. // constants / defines / enumerations
  127. //
  128. //
  129. // WMI related stuff
  130. // class name
  131. #define CLASS_PROCESS L"Win32_Process"
  132. // wmi query
  133. #define WMI_QUERY_TYPE L"WQL"
  134. #define WMI_SERVICE_QUERY L"SELECT Name FROM Win32_Service WHERE ProcessId = %d and State=\"Running\""
  135. #define WMI_MODULES_QUERY L"ASSOCIATORS OF {%s} WHERE ResultClass = CIM_DataFile"
  136. #define WMI_PROCESS_QUERY \
  137. L"SELECT " \
  138. L"__PATH, ProcessId, CSName, Caption, SessionId, ThreadCount, " \
  139. L"WorkingSetSize, KernelModeTime, UserModeTime " \
  140. L" FROM Win32_Process"
  141. // wmi query operators etc
  142. #define WMI_QUERY_FIRST_CLAUSE L"WHERE"
  143. #define WMI_QUERY_SECOND_CLAUSE L"AND"
  144. // Win32_Process class properties
  145. #define WIN32_PROCESS_SYSPROPERTY_PATH L"__PATH"
  146. #define WIN32_PROCESS_PROPERTY_HANDLE L"Handle"
  147. #define WIN32_PROCESS_PROPERTY_COMPUTER L"CSName"
  148. #define WIN32_PROCESS_PROPERTY_IMAGENAME L"Caption"
  149. #define WIN32_PROCESS_PROPERTY_PROCESSID L"ProcessId"
  150. #define WIN32_PROCESS_PROPERTY_SESSION L"SessionId"
  151. #define WIN32_PROCESS_PROPERTY_THREADS L"ThreadCount"
  152. #define WIN32_PROCESS_PROPERTY_USERMODETIME L"UserModeTime"
  153. #define WIN32_PROCESS_PROPERTY_MEMUSAGE L"WorkingSetSize"
  154. #define WIN32_PROCESS_PROPERTY_KERNELMODETIME L"KernelModeTime"
  155. // Win32_Process class method(s)
  156. #define WIN32_PROCESS_METHOD_GETOWNER L"GetOwner"
  157. // GetOwner method's return values
  158. #define GETOWNER_RETURNVALUE_USER L"User"
  159. #define GETOWNER_RETURNVALUE_DOMAIN L"Domain"
  160. // function default return value
  161. #define WMI_RETURNVALUE L"ReturnValue"
  162. // Win32_Service related stuff
  163. #define WIN32_SERVICE_PROPERTY_NAME L"Name"
  164. // CIM_DataFile related stuff
  165. #define CIM_DATAFILE_PROPERTY_FILENAME L"FileName"
  166. #define CIM_DATAFILE_PROPERTY_EXTENSION L"Extension"
  167. //
  168. // other stuff
  169. // generals
  170. #define VALUE_RUNNING GetResString( IDS_VALUE_RUNNING )
  171. #define VALUE_NOTRESPONDING GetResString( IDS_VALUE_NOTRESPONDING )
  172. #define VALUE_UNKNOWN GetResString( IDS_VALUE_UNKNOWN )
  173. #define PID_0_DOMAIN GetResString( IDS_PID_0_DOMAIN )
  174. #define PID_0_USERNAME GetResString( IDS_PID_0_USERNAME )
  175. #define FMT_MODULES_FILTER GetResString( IDS_FMT_MODULES_FILTER )
  176. // error messages
  177. #define ERROR_USERNAME_BUT_NOMACHINE GetResString( IDS_ERROR_USERNAME_BUT_NOMACHINE )
  178. #define ERROR_PASSWORD_BUT_NOUSERNAME GetResString( IDS_ERROR_PASSWORD_BUT_NOUSERNAME )
  179. #define ERROR_NODATA_AVAILABLE GetResString( IDS_ERROR_NODATA_AVAILABLE )
  180. #define ERROR_USERNAME_EMPTY GetResString( IDS_ERROR_USERNAME_EMPTY )
  181. #define ERROR_NH_NOTSUPPORTED GetResString( IDS_ERROR_NH_NOTSUPPORTED )
  182. #define ERROR_M_SVC_V_CANNOTBECOUPLED GetResString( IDS_ERROR_M_SVC_V_CANNOTBECOUPLED )
  183. #define ERROR_SERVERNAME_EMPTY GetResString( IDS_ERROR_SERVERNAME_EMPTY )
  184. #define ERROR_INVALID_USAGE_REQUEST GetResString( IDS_ERROR_INVALID_USAGE_REQUEST )
  185. #define ERROR_M_CHAR_AFTER_WILDCARD GetResString( IDS_ERROR_M_CHAR_AFTER_WILDCARD )
  186. #define ERROR_PLATFORM_SHOULD_BE_X86 GetResString( IDS_ERROR_PLATFORM_SHOULD_BE_X86 )
  187. // warnings
  188. #define WARNING_FILTERNOTSUPPORTED GetResString( IDS_WARNING_FILTERNOTSUPPORTED )
  189. // output formats
  190. #define TEXT_FORMAT_LIST GetResString( IDS_TEXT_FORMAT_LIST )
  191. #define TEXT_FORMAT_TABLE GetResString( IDS_TEXT_FORMAT_TABLE )
  192. #define TEXT_FORMAT_CSV GetResString( IDS_TEXT_FORMAT_CSV )
  193. //
  194. // column heading names and their indexes in the array ( in fact positions )
  195. #define MAX_COLUMNS 12
  196. // column headings
  197. #define COLHEAD_HOSTNAME GetResString( IDS_COLHEAD_HOSTNAME )
  198. #define COLHEAD_STATUS GetResString( IDS_COLHEAD_STATUS )
  199. #define COLHEAD_IMAGENAME GetResString( IDS_COLHEAD_IMAGENAME )
  200. #define COLHEAD_PID GetResString( IDS_COLHEAD_PID )
  201. #define COLHEAD_SESSION GetResString( IDS_COLHEAD_SESSION )
  202. #define COLHEAD_USERNAME GetResString( IDS_COLHEAD_USERNAME )
  203. #define COLHEAD_WINDOWTITLE GetResString( IDS_COLHEAD_WINDOWTITLE )
  204. #define COLHEAD_CPUTIME GetResString( IDS_COLHEAD_CPUTIME )
  205. #define COLHEAD_MEMUSAGE GetResString( IDS_COLHEAD_MEMUSAGE )
  206. #define COLHEAD_SERVICES GetResString( IDS_COLHEAD_SERVICES )
  207. #define COLHEAD_SESSIONNAME GetResString( IDS_COLHEAD_SESSIONNAME )
  208. #define COLHEAD_MODULES GetResString( IDS_COLHEAD_MODULES )
  209. // indexes
  210. #define CI_HOSTNAME TASK_HOSTNAME
  211. #define CI_STATUS TASK_STATUS
  212. #define CI_IMAGENAME TASK_IMAGENAME
  213. #define CI_PID TASK_PID
  214. #define CI_SESSION TASK_SESSION
  215. #define CI_USERNAME TASK_USERNAME
  216. #define CI_WINDOWTITLE TASK_WINDOWTITLE
  217. #define CI_CPUTIME TASK_CPUTIME
  218. #define CI_MEMUSAGE TASK_MEMUSAGE
  219. #define CI_SERVICES TASK_SERVICES
  220. #define CI_SESSIONNAME TASK_SESSIONNAME
  221. #define CI_MODULES TASK_MODULES
  222. // column widths
  223. #define COLWIDTH_HOSTNAME AsLong( GetResString( IDS_COLWIDTH_HOSTNAME ), 10 )
  224. #define COLWIDTH_STATUS AsLong( GetResString( IDS_COLWIDTH_STATUS ), 10 )
  225. #define COLWIDTH_IMAGENAME AsLong( GetResString( IDS_COLWIDTH_IMAGENAME ), 10 )
  226. #define COLWIDTH_PID AsLong( GetResString( IDS_COLWIDTH_PID ), 10 )
  227. // to avoid the RC change at this moment, we are hard coding this value in this file
  228. // #define COLWIDTH_SESSION AsLong( GetResString( IDS_COLWIDTH_SESSION ), 10 )
  229. #define COLWIDTH_SESSION 11
  230. #define COLWIDTH_USERNAME AsLong( GetResString( IDS_COLWIDTH_USERNAME ), 10 )
  231. #define COLWIDTH_WINDOWTITLE AsLong( GetResString( IDS_COLWIDTH_WINDOWTITLE ), 10 )
  232. #define COLWIDTH_CPUTIME AsLong( GetResString( IDS_COLWIDTH_CPUTIME ), 10 )
  233. #define COLWIDTH_MEMUSAGE AsLong( GetResString( IDS_COLWIDTH_MEMUSAGE ), 10 )
  234. #define COLWIDTH_SERVICES AsLong( GetResString( IDS_COLWIDTH_SERVICES ), 10 )
  235. #define COLWIDTH_SERVICES_WRAP AsLong( GetResString( IDS_COLWIDTH_SERVICES_WRAP ), 10 )
  236. #define COLWIDTH_SESSIONNAME AsLong( GetResString( IDS_COLWIDTH_SESSIONNAME ), 10 )
  237. #define COLWIDTH_MODULES AsLong( GetResString( IDS_COLWIDTH_MODULES ), 10 )
  238. #define COLWIDTH_MODULES_WRAP AsLong( GetResString( IDS_COLWIDTH_MODULES_WRAP ), 10 )
  239. //
  240. // command line options
  241. // command line options and their indexes in the array
  242. #define MAX_OPTIONS 10
  243. // options allowed ( no need to localize )
  244. #define OPTION_USAGE L"?"
  245. #define OPTION_SERVER L"s"
  246. #define OPTION_USERNAME L"u"
  247. #define OPTION_PASSWORD L"p"
  248. #define OPTION_FILTER L"fi"
  249. #define OPTION_FORMAT L"fo"
  250. #define OPTION_NOHEADER L"nh"
  251. #define OPTION_VERBOSE L"v"
  252. #define OPTION_SVC L"svc"
  253. #define OPTION_MODULES L"m"
  254. // option indexes
  255. #define OI_USAGE 0
  256. #define OI_SERVER 1
  257. #define OI_USERNAME 2
  258. #define OI_PASSWORD 3
  259. #define OI_FILTER 4
  260. #define OI_FORMAT 5
  261. #define OI_NOHEADER 6
  262. #define OI_VERBOSE 7
  263. #define OI_SVC 8
  264. #define OI_MODULES 9
  265. // values allowed for format
  266. #define OVALUES_FORMAT GetResString( IDS_OVALUES_FORMAT )
  267. //
  268. // filter details
  269. #define MAX_FILTERS 11
  270. // filter allowed
  271. #define FILTER_SESSIONNAME GetResString( IDS_FILTER_SESSIONNAME )
  272. #define FILTER_STATUS GetResString( IDS_FILTER_STATUS )
  273. #define FILTER_IMAGENAME GetResString( IDS_FILTER_IMAGENAME )
  274. #define FILTER_PID GetResString( IDS_FILTER_PID )
  275. #define FILTER_SESSION GetResString( IDS_FILTER_SESSION )
  276. #define FILTER_CPUTIME GetResString( IDS_FILTER_CPUTIME )
  277. #define FILTER_MEMUSAGE GetResString( IDS_FILTER_MEMUSAGE )
  278. #define FILTER_USERNAME GetResString( IDS_FILTER_USERNAME )
  279. #define FILTER_SERVICES GetResString( IDS_FILTER_SERVICES )
  280. #define FILTER_WINDOWTITLE GetResString( IDS_FILTER_WINDOWTITLE )
  281. #define FILTER_MODULES GetResString( IDS_FILTER_MODULES )
  282. // indexes
  283. #define FI_SESSIONNAME 0
  284. #define FI_STATUS 1
  285. #define FI_IMAGENAME 2
  286. #define FI_PID 3
  287. #define FI_SESSION 4
  288. #define FI_CPUTIME 5
  289. #define FI_MEMUSAGE 6
  290. #define FI_USERNAME 7
  291. #define FI_SERVICES 8
  292. #define FI_WINDOWTITLE 9
  293. #define FI_MODULES 10
  294. // values allowed for status
  295. #define FVALUES_STATUS GetResString( IDS_FVALUES_STATUS )
  296. // operators
  297. #define OPERATORS_STRING GetResString( IDS_OPERATORS_STRING )
  298. #define OPERATORS_NUMERIC GetResString( IDS_OPERATORS_NUMERIC )
  299. // max. columns ( information ) to be stored for one task
  300. #define MAX_TASKSINFO 17
  301. // task info indexes
  302. #define TASK_HOSTNAME 0
  303. #define TASK_IMAGENAME 1
  304. #define TASK_PID 2
  305. #define TASK_SESSIONNAME 3
  306. #define TASK_SESSION 4
  307. #define TASK_MEMUSAGE 5
  308. #define TASK_STATUS 6
  309. #define TASK_USERNAME 7
  310. #define TASK_CPUTIME 8
  311. #define TASK_WINDOWTITLE 9
  312. #define TASK_SERVICES 10
  313. #define TASK_MODULES 11
  314. // always hidden
  315. #define TASK_HWND 12
  316. #define TASK_WINSTA 13
  317. #define TASK_DESK 14
  318. #define TASK_CREATINGPROCESSID 15
  319. #define TASK_OBJPATH 16
  320. #define NULL_STRING L"\0"
  321. #define __STRING_64 WCHAR[ 64 ]
  322. #define __MAX_SIZE_STRING WCHAR[ 256 ]
  323. //
  324. // CTaskList
  325. //
  326. class CTaskList
  327. {
  328. public:
  329. // enumerators
  330. enum
  331. {
  332. twiProcessId = 0,
  333. twiWinSta = 1,
  334. twiDesktop = 2,
  335. twiHandle = 3,
  336. twiTitle = 4,
  337. twiHungInfo = 5,
  338. twiCOUNT,
  339. };
  340. // constructor / destructor
  341. public:
  342. CTaskList();
  343. ~CTaskList();
  344. // data memebers
  345. private:
  346. // WMI / COM interfaces
  347. IWbemLocator* m_pWbemLocator;
  348. IWbemServices* m_pWbemServices;
  349. IEnumWbemClassObject* m_pEnumObjects;
  350. // WMI connectivity
  351. COAUTHIDENTITY* m_pAuthIdentity;
  352. // command-line argument values
  353. BOOL m_bVerbose;
  354. BOOL m_bAllServices;
  355. BOOL m_bAllModules;
  356. DWORD m_dwFormat;
  357. TARRAY m_arrFilters;
  358. CHString m_strServer;
  359. CHString m_strUserName;
  360. CHString m_strPassword;
  361. CHString m_strModules;
  362. // others
  363. BOOL m_bNeedPassword; // infoms whether password has to read or not
  364. BOOL m_bRemoteWarning; // window title and status filters are invalid for remote systems
  365. BOOL m_bNeedModulesInfo;
  366. BOOL m_bNeedServicesInfo; // determines whether services info has to gathered or not
  367. BOOL m_bNeedUserContextInfo; // determines whether userinfo has to gathered or not
  368. BOOL m_bNeedWindowTitles; // determines whether window titles has to be gathered or not
  369. PTCOLUMNS m_pColumns; // columns config information
  370. TARRAY m_arrFiltersEx; // parsed filters info
  371. TARRAY m_arrWindowTitles; // window titles
  372. PTFILTERCONFIG m_pfilterConfigs; // filters config information
  373. CHString m_strQuery; // optimized WMI Query for filters
  374. DWORD m_dwGroupSep; // number group seperation in number formatting
  375. CHString m_strTimeSep; // time seperator
  376. CHString m_strGroupThousSep; // thousand sepeartion character in number formatting
  377. // output data
  378. TARRAY m_arrTasks;
  379. DWORD m_dwProcessId;
  380. CHString m_strImageName;
  381. // helpers .. in getting info using API
  382. CHString m_strUNCServer; // server name
  383. BOOL m_bCloseConnection;
  384. // winstation related stuff
  385. BOOL m_bIsHydra;
  386. HANDLE m_hServer;
  387. HMODULE m_hWinstaLib;
  388. PBYTE m_pProcessInfo;
  389. ULONG m_ulNumberOfProcesses;
  390. // services related stuff
  391. DWORD m_dwServicesCount;
  392. LPENUM_SERVICE_STATUS_PROCESS m_pServicesInfo;
  393. // modules related stuff ( remote only )
  394. BOOL m_bUseRemote;
  395. PPERF_DATA_BLOCK m_pdb;
  396. //
  397. // functions
  398. FUNC_WinStationFreeMemory m_pfnWinStationFreeMemory;
  399. FUNC_WinStationOpenServerW m_pfnWinStationOpenServerW;
  400. FUNC_WinStationCloseServer m_pfnWinStationCloseServer;
  401. FUNC_WinStationFreeGAPMemory m_pfnWinStationFreeGAPMemory;
  402. FUNC_WinStationGetAllProcesses m_pfnWinStationGetAllProcesses;
  403. FUNC_WinStationNameFromLogonIdW m_pfnWinStationNameFromLogonIdW;
  404. FUNC_WinStationEnumerateProcesses m_pfnWinStationEnumerateProcesses;
  405. public:
  406. // command-line argument values
  407. BOOL m_bUsage;
  408. BOOL m_bLocalSystem;
  409. // functions
  410. private:
  411. // helpers
  412. VOID SetCPUTime( LONG lIndex, IWbemClassObject* pWmiObject );
  413. VOID SetSession( LONG lIndex, IWbemClassObject* pWmiObject );
  414. VOID SetMemUsage( LONG lIndex, IWbemClassObject* pWmiObject );
  415. VOID SetUserContext( LONG lIndex, IWbemClassObject* pWmiObject );
  416. VOID SetWindowTitle( LONG lIndex );
  417. VOID SetServicesInfo( LONG lIndex );
  418. BOOL SetModulesInfo( LONG lIndex );
  419. BOOL SaveInformation( LONG lIndex, IWbemClassObject* pWmiObject );
  420. // ...
  421. BOOL LoadTasksEx();
  422. BOOL LoadModulesInfo();
  423. BOOL LoadServicesInfo();
  424. BOOL EnableDebugPriv();
  425. BOOL GetModulesOnRemote( LONG lIndex, TARRAY arrModules );
  426. BOOL GetModulesOnRemoteEx( LONG lIndex, TARRAY arrModules );
  427. BOOL LoadModulesOnLocal( TARRAY arrModules );
  428. BOOL LoadUserNameFromWinsta( CHString& strDomain, CHString& strUserName );
  429. // winsta functions
  430. BOOLEAN WinStationFreeMemory( PVOID pBuffer );
  431. BOOLEAN WinStationCloseServer( HANDLE hServer );
  432. HANDLE WinStationOpenServerW( LPWSTR pwszServerName );
  433. BOOLEAN WinStationEnumerateProcesses( HANDLE hServer, PVOID *ppProcessBuffer );
  434. BOOLEAN WinStationFreeGAPMemory( ULONG Level, PVOID ProcessArray, ULONG ulCount );
  435. BOOLEAN WinStationNameFromLogonIdW( HANDLE hServer, ULONG ulLogonId, LPWSTR pwszWinStationName );
  436. BOOLEAN WinStationGetAllProcesses( HANDLE hServer, ULONG Level,
  437. ULONG *pNumberOfProcesses, PVOID *ppProcessArray );
  438. public:
  439. VOID Usage();
  440. BOOL Initialize();
  441. VOID PrepareColumns();
  442. BOOL ValidateFilters();
  443. BOOL ProcessOptions( DWORD argc, LPCWSTR argv[] );
  444. // functionality related
  445. DWORD Show();
  446. BOOL Connect();
  447. BOOL LoadTasks();
  448. };
  449. //
  450. // public functions
  451. //
  452. #endif // _TASKLIST_H