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.

761 lines
20 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. pdhp.h
  5. Abstract:
  6. PDH private APIs. Converts WMI event trace data to perf counters
  7. Author:
  8. Melur Raghuraman (mraghu) 03-Oct-1997
  9. Environment:
  10. Revision History:
  11. --*/
  12. #ifndef __PDHP__
  13. #define __PDHP__
  14. #include <wchar.h>
  15. #include <pdh.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /*****************************************************************************\
  20. Private Pdh Section
  21. \*****************************************************************************/
  22. typedef struct _PDH_RELOG_INFO_A {
  23. LPSTR strLog;
  24. DWORD dwFileFormat;
  25. DWORD dwFlags;
  26. PDH_TIME_INFO TimeInfo;
  27. FILETIME ftInterval;
  28. ULONG Reserved1;
  29. ULONG Reserved2;
  30. } PDH_RELOG_INFO_A, *PPDH_RELOG_INFO_A;
  31. typedef struct _PDH_RELOG_INFO_W {
  32. LPWSTR strLog;
  33. DWORD dwFileFormat;
  34. DWORD dwFlags;
  35. PDH_TIME_INFO TimeInfo;
  36. FILETIME ftInterval;
  37. ULONG Reserved1;
  38. ULONG Reserved2;
  39. } PDH_RELOG_INFO_W, *PPDH_RELOG_INFO_W;
  40. PDH_FUNCTION
  41. PdhRelogA(
  42. HLOG hLogIn,
  43. PPDH_RELOG_INFO_A pRelogInfo
  44. );
  45. PDH_FUNCTION
  46. PdhRelogW(
  47. HLOG hLogIn,
  48. PPDH_RELOG_INFO_W pRelogInfo
  49. );
  50. #ifdef UNICODE
  51. #define PdhRelog PdhRelogW
  52. #define PDH_RELOG_INFO PDH_RELOG_INFO_W
  53. #define PPDH_RELOG_INFO PPDH_RELOG_INFO_W
  54. #else
  55. #define PdhRelog PdhRelogA
  56. #define PDH_RELOG_INFO PDH_RELOG_INFO_A
  57. #define PPDH_RELOG_INFO PPDH_RELOG_INFO_A
  58. #endif
  59. /*****************************************************************************\
  60. Performance Logs and Alerts Section
  61. \*****************************************************************************/
  62. #ifdef UNICODE
  63. #define PdhPlaStart PdhPlaStartW
  64. #define PdhPlaStop PdhPlaStopW
  65. #define PdhPlaSchedule PdhPlaScheduleW
  66. #define PdhPlaCreate PdhPlaCreateW
  67. #define PdhPlaDelete PdhPlaDeleteW
  68. #define PdhPlaAddItem PdhPlaAddItemW
  69. #define PdhPlaSetItemList PdhPlaSetItemListW
  70. #define PdhPlaRemoveAllItems PdhPlaRemoveAllItemsW
  71. #define PdhPlaGetInfo PdhPlaGetInfoW
  72. #define PdhPlaSetInfo PdhPlaSetInfoW
  73. #define PdhPlaSetRunAs PdhPlaSetRunAsW
  74. #define PdhPlaEnumCollections PdhPlaEnumCollectionsW
  75. #define PdhPlaValidateInfo PdhPlaValidateInfoW
  76. #define PDH_PLA_INFO PDH_PLA_INFO_W
  77. #define PPDH_PLA_INFO PPDH_PLA_INFO_W
  78. #define PDH_PLA_ITEM PDH_PLA_ITEM_W
  79. #define PPDH_PLA_ITEM PPDH_PLA_ITEM_W
  80. #define PdhTranslate009Counter PdhTranslate009CounterW
  81. #define PdhTranslateLocaleCounter PdhTranslateLocaleCounterW
  82. #define PdhAdd009Counter PdhAdd009CounterW
  83. #define PdhGetLogFileType PdhGetLogFileTypeW
  84. #define PdhPlaGetLogFileName PdhPlaGetLogFileNameW
  85. #define PdhPlaGetSchedule PdhPlaGetScheduleW
  86. #define PdhiPlaFormatBlanks PdhiPlaFormatBlanksW
  87. #else
  88. #define PdhPlaStart PdhPlaStartA
  89. #define PdhPlaStop PdhPlaStopA
  90. #define PdhPlaSchedule PdhPlaScheduleW
  91. #define PdhPlaCreate PdhPlaCreateA
  92. #define PdhPlaDelete PdhPlaDeleteA
  93. #define PdhPlaAddItem PdhPlaAddItemA
  94. #define PdhPlaSetItemList PdhPlaSetItemListA
  95. #define PdhPlaRemoveAllItems PdhPlaRemoveAllItemA
  96. #define PdhPlaGetInfo PdhPlaGetInfoA
  97. #define PdhPlaSetInfo PdhPlaSetInfoA
  98. #define PdhPlaSetRunAs PdhPlaSetRunAsA
  99. #define PdhPlaEnumCollections PdhPlaEnumCollectionsA
  100. #define PdhPlaValidateInfo PdhPlaValidateInfoA
  101. #define PDH_PLA_INFO PDH_PLA_INFO_A
  102. #define PPDH_PLA_INFO PPDH_PLA_INFO_A
  103. #define PDH_PLA_ITEM PDH_PLA_ITEM_A
  104. #define PPDH_PLA_ITEM PPDH_PLA_ITEM_A
  105. #define PdhTranslate009Counter PdhTranslate009CounterA
  106. #define PdhTranslateLocaleCounter PdhTranslateLocaleCounterA
  107. #define PdhAdd009Counter PdhAdd009CounterA
  108. #define PdhGetLogFileType PdhGetLogFileTypeA
  109. #define PdhPlaGetLogFileName PdhPlaGetLogFileNameA
  110. #define PdhPlaGetSchedule PdhPlaGetScheduleA
  111. #define PdhiPlaFormatBlanks PdhiPlaFormatBlanksA
  112. #endif
  113. // wDataType values
  114. #define PLA_TT_DTYPE_DATETIME ((WORD)0x0001)
  115. #define PLA_TT_DTYPE_UNITS ((WORD)0x0002)
  116. // dwMode values
  117. #define PLA_AUTO_MODE_NONE ((DWORD)0x00000000) // Manual
  118. #define PLA_AUTO_MODE_SIZE ((DWORD)0x00000001) // Size
  119. #define PLA_AUTO_MODE_AT ((DWORD)0x00000002) // Time
  120. #define PLA_AUTO_MODE_AFTER ((DWORD)0x00000003) // Value & unit type
  121. #define PLA_AUTO_MODE_CALENDAR ((DWORD)0x00000004) // Schedule Calender
  122. // wTimeType values
  123. #define PLA_TT_TTYPE_START ((WORD)0x0001)
  124. #define PLA_TT_TTYPE_STOP ((WORD)0x0002)
  125. #define PLA_TT_TTYPE_RESTART ((WORD)0x0003)
  126. #define PLA_TT_TTYPE_SAMPLE ((WORD)0x0004)
  127. #define PLA_TT_TTYPE_LAST_MODIFIED ((WORD)0x0005)
  128. #define PLA_TT_TTYPE_CREATENEWFILE ((WORD)0x0006)
  129. #define PLA_TT_TTYPE_REPEAT_SCHEDULE ((WORD)0x0007)
  130. // dwUnitType values
  131. #define PLA_TT_UTYPE_SECONDS ((DWORD)0x00000001)
  132. #define PLA_TT_UTYPE_MINUTES ((DWORD)0x00000002)
  133. #define PLA_TT_UTYPE_HOURS ((DWORD)0x00000003)
  134. #define PLA_TT_UTYPE_DAYS ((DWORD)0x00000004)
  135. #define PLA_TT_UTYPE_DAYSOFWEEK ((DWORD)0x00000005)
  136. #pragma warning ( disable : 4201 )
  137. typedef struct _PLA_TIME_INFO {
  138. WORD wDataType;
  139. WORD wTimeType;
  140. DWORD dwAutoMode;
  141. union {
  142. LONGLONG llDateTime; // filetime stored as a LONGLONG
  143. struct {
  144. DWORD dwValue;
  145. DWORD dwUnitType;
  146. };
  147. };
  148. } PLA_TIME_INFO, *PPLA_TIME_INFO;
  149. typedef struct _PDH_PLA_ITEM_W {
  150. DWORD dwType;
  151. union {
  152. LPWSTR strCounters;
  153. struct {
  154. LPWSTR strProviders;
  155. LPWSTR strFlags;
  156. LPWSTR strLevels;
  157. };
  158. };
  159. } PDH_PLA_ITEM_W, *PPDH_PLA_ITEM_W;
  160. typedef struct _PDH_PLA_ITEM_A {
  161. DWORD dwType;
  162. union {
  163. LPSTR strCounters;
  164. struct {
  165. LPSTR strProviders;
  166. LPSTR strFlags;
  167. LPSTR strLevels;
  168. };
  169. };
  170. } PDH_PLA_ITEM_A, *PPDH_PLA_ITEM_A;
  171. #pragma warning ( default : 4201 )
  172. // Generic Fields
  173. #define PLA_INFO_FLAG_USER 0x00000001
  174. #define PLA_INFO_FLAG_FORMAT 0x00000002
  175. #define PLA_INFO_FLAG_MAXLOGSIZE 0x00000004
  176. #define PLA_INFO_FLAG_RUNCOMMAND 0x00000008
  177. #define PLA_INFO_FLAG_FILENAME 0x00000010
  178. #define PLA_INFO_FLAG_AUTOFORMAT 0x00000020
  179. #define PLA_INFO_FLAG_DATASTORE 0x00000040
  180. #define PLA_INFO_FLAG_REPEAT 0x00000080
  181. #define PLA_INFO_FLAG_STATUS 0x00000100
  182. #define PLA_INFO_FLAG_TYPE 0x00000200
  183. #define PLA_INFO_FLAG_BEGIN 0x00000400
  184. #define PLA_INFO_FLAG_END 0x00000800
  185. #define PLA_INFO_FLAG_CRTNEWFILE 0x00001000
  186. #define PLA_INFO_FLAG_DEFAULTDIR 0x00002000
  187. #define PLA_INFO_FLAG_SRLNUMBER 0x00004000
  188. #define PLA_INFO_FLAG_SQLNAME 0x00008000
  189. #define PLA_INFO_FLAG_ALL 0xFFFFFFFF
  190. // Trace Fields
  191. #define PLA_INFO_FLAG_BUFFERSIZE 0x00010000
  192. #define PLA_INFO_FLAG_LOGGERNAME 0x00020000
  193. #define PLA_INFO_FLAG_MODE 0x00040000
  194. #define PLA_INFO_FLAG_MINBUFFERS 0x00080000
  195. #define PLA_INFO_FLAG_MAXBUFFERS 0x00100000
  196. #define PLA_INFO_FLAG_FLUSHTIMER 0x00200000
  197. #define PLA_INFO_FLAG_PROVIDERS 0x00400000
  198. #define PLA_INFO_FLAG_TRACE 0x00FFFFFF
  199. // Performance Fields
  200. #define PLA_INFO_FLAG_INTERVAL 0x01000000
  201. #define PLA_INFO_FLAG_COUNTERS 0x02000000
  202. #define PLA_INFO_FLAG_PERF 0xFF00FFFF
  203. #define PLA_INFO_CREATE_FILENAME \
  204. (PLA_INFO_FLAG_FORMAT| \
  205. PLA_INFO_FLAG_FILENAME| \
  206. PLA_INFO_FLAG_AUTOFORMAT| \
  207. PLA_INFO_FLAG_TYPE| \
  208. PLA_INFO_FLAG_CRTNEWFILE| \
  209. PLA_INFO_FLAG_DEFAULTDIR| \
  210. PLA_INFO_FLAG_SRLNUMBER| \
  211. PLA_INFO_FLAG_SQLNAME| \
  212. PLA_INFO_FLAG_STATUS ) \
  213. typedef struct _PDH_PLA_INFO_W {
  214. DWORD dwMask;
  215. LPWSTR strUser;
  216. LPWSTR strPassword;
  217. DWORD dwType;
  218. DWORD dwMaxLogSize;
  219. DWORD dwFlags;
  220. DWORD dwLogQuota;
  221. LPWSTR strLogFileCaption;
  222. LPWSTR strDefaultDir;
  223. LPWSTR strBaseFileName;
  224. LPWSTR strSqlName;
  225. DWORD dwFileFormat;
  226. DWORD dwAutoNameFormat;
  227. DWORD dwLogFileSerialNumber;
  228. LPWSTR strCommandFileName;
  229. DWORD dwDatastoreAttributes;
  230. PLA_TIME_INFO ptLogBeginTime;
  231. PLA_TIME_INFO ptLogEndTime;
  232. PLA_TIME_INFO ptCreateNewFile;
  233. PLA_TIME_INFO ptRepeat;
  234. DWORD dwStatus;
  235. DWORD dwReserved1;
  236. DWORD dwReserved2;
  237. union {
  238. struct {
  239. PDH_PLA_ITEM_W piCounterList;
  240. DWORD dwAutoNameInterval;
  241. DWORD dwAutoNameUnits;
  242. PLA_TIME_INFO ptSampleInterval;
  243. } Perf;
  244. struct {
  245. PDH_PLA_ITEM_W piProviderList;
  246. LPWSTR strLoggerName;
  247. DWORD dwMode;
  248. DWORD dwNumberOfBuffers;
  249. DWORD dwMaximumBuffers;
  250. DWORD dwMinimumBuffers;
  251. DWORD dwBufferSize;
  252. DWORD dwFlushTimer;
  253. } Trace;
  254. };
  255. } PDH_PLA_INFO_W, *PPDH_PLA_INFO_W;
  256. typedef struct _PDH_PLA_INFO_A {
  257. DWORD dwMask;
  258. // NOT YET IMPLEMENTED
  259. } PDH_PLA_INFO_A, *PPDH_PLA_INFO_A;
  260. typedef struct _PLA_VERSION_ {
  261. DWORD dwMajorVersion;
  262. DWORD dwMinorVersion;
  263. DWORD dwBuild;
  264. DWORD dwSubBuild;
  265. } PLA_VERSION, *PPLA_VERSION;
  266. HRESULT
  267. PdhiPlaFormatBlanksA(
  268. LPSTR strComputer,
  269. LPSTR strFormat
  270. );
  271. HRESULT
  272. PdhiPlaFormatBlanksW(
  273. LPWSTR strComputer,
  274. LPWSTR strFormat
  275. );
  276. PDH_FUNCTION
  277. PdhPlaGetScheduleA(
  278. LPSTR strName,
  279. LPSTR strComputer,
  280. LPDWORD pdwTypeStart,
  281. LPDWORD pdwTypeStop,
  282. PPDH_TIME_INFO pInfo
  283. );
  284. PDH_FUNCTION
  285. PdhPlaGetScheduleW(
  286. LPWSTR strName,
  287. LPWSTR strComputer,
  288. LPDWORD pdwTypeStart,
  289. LPDWORD pdwTypeStop,
  290. PPDH_TIME_INFO pInfo
  291. );
  292. PDH_FUNCTION
  293. PlaTimeInfoToMilliSeconds(
  294. PLA_TIME_INFO* pTimeInfo,
  295. LONGLONG* pllmsecs
  296. );
  297. PDH_FUNCTION
  298. PdhPlaValidateInfoA(
  299. LPSTR strName,
  300. LPSTR strComputer,
  301. PPDH_PLA_INFO_A pInfo
  302. );
  303. PDH_FUNCTION
  304. PdhPlaValidateInfoW(
  305. LPWSTR strName,
  306. LPWSTR strComputer,
  307. PPDH_PLA_INFO_W pInfo
  308. );
  309. PDH_FUNCTION
  310. PdhPlaSetRunAsA(
  311. LPSTR strName,
  312. LPSTR strComputer,
  313. LPSTR strUser,
  314. LPSTR strPassword
  315. );
  316. PDH_FUNCTION
  317. PdhPlaSetRunAsW(
  318. LPWSTR strName,
  319. LPWSTR strComputer,
  320. LPWSTR strUser,
  321. LPWSTR strPassword
  322. );
  323. PDH_FUNCTION
  324. PdhPlaScheduleA(
  325. LPSTR strName,
  326. LPSTR strComputer,
  327. DWORD fType,
  328. PPDH_TIME_INFO pInfo
  329. );
  330. PDH_FUNCTION
  331. PdhPlaScheduleW(
  332. LPWSTR strName,
  333. LPWSTR strComputer,
  334. DWORD fType,
  335. PPDH_TIME_INFO pInfo
  336. );
  337. PDH_FUNCTION
  338. PdhPlaStartA(
  339. LPSTR strName,
  340. LPSTR strComputer
  341. );
  342. PDH_FUNCTION
  343. PdhPlaStartW(
  344. LPWSTR strName,
  345. LPWSTR strComputer
  346. );
  347. PDH_FUNCTION
  348. PdhPlaStopA(
  349. LPSTR strName,
  350. LPSTR strComputer
  351. );
  352. PDH_FUNCTION
  353. PdhPlaStopW(
  354. LPWSTR strName,
  355. LPWSTR strComputer
  356. );
  357. PDH_FUNCTION
  358. PdhPlaCreateA(
  359. LPSTR strName,
  360. LPSTR strComputer,
  361. PPDH_PLA_INFO_A pInfo
  362. );
  363. PDH_FUNCTION
  364. PdhPlaCreateW(
  365. LPWSTR strName,
  366. LPWSTR strComputer,
  367. PPDH_PLA_INFO_W pInfo
  368. );
  369. PDH_FUNCTION
  370. PdhPlaDeleteA(
  371. LPSTR strName,
  372. LPSTR strComputer
  373. );
  374. PDH_FUNCTION
  375. PdhPlaDeleteW(
  376. LPWSTR strName,
  377. LPWSTR strComputer
  378. );
  379. PDH_FUNCTION
  380. PdhPlaAddItemA(
  381. LPSTR strName,
  382. LPSTR strComputer,
  383. PPDH_PLA_ITEM_A pItem
  384. );
  385. PDH_FUNCTION
  386. PdhPlaAddItemW(
  387. LPWSTR strName,
  388. LPWSTR strComputer,
  389. PPDH_PLA_ITEM_W pItem
  390. );
  391. PDH_FUNCTION
  392. PdhPlaSetItemListA(
  393. LPSTR strName,
  394. LPSTR strComputer,
  395. PPDH_PLA_ITEM_A pItems
  396. );
  397. PDH_FUNCTION
  398. PdhPlaSetItemListW(
  399. LPWSTR strName,
  400. LPWSTR strComputer,
  401. PPDH_PLA_ITEM_W pItems
  402. );
  403. PDH_FUNCTION
  404. PdhPlaRemoveAllItemsA(
  405. LPSTR strName,
  406. LPSTR strComputer
  407. );
  408. PDH_FUNCTION
  409. PdhPlaRemoveAllItemsW(
  410. LPWSTR strName,
  411. LPWSTR strComputer
  412. );
  413. PDH_FUNCTION
  414. PdhPlaGetInfoA(
  415. LPSTR strName,
  416. LPSTR strComputer,
  417. LPDWORD pdwBufferSize,
  418. PPDH_PLA_INFO_A pInfo
  419. );
  420. PDH_FUNCTION
  421. PdhPlaGetInfoW(
  422. LPWSTR strName,
  423. LPWSTR strComputer,
  424. LPDWORD pdwBufferSize,
  425. PPDH_PLA_INFO_W pInfo
  426. );
  427. PDH_FUNCTION
  428. PdhPlaSetInfoA(
  429. LPSTR strName,
  430. LPSTR strComputer,
  431. PPDH_PLA_INFO_A pInfo
  432. );
  433. PDH_FUNCTION
  434. PdhPlaSetInfoW(
  435. LPWSTR strName,
  436. LPWSTR strComputer,
  437. PPDH_PLA_INFO_W pInfo
  438. );
  439. PDH_FUNCTION
  440. PdhPlaSetRunAsA(
  441. LPSTR strName,
  442. LPSTR strComputer,
  443. LPSTR strUser,
  444. LPSTR strPassword
  445. );
  446. PDH_FUNCTION
  447. PdhPlaSetRunAsW(
  448. LPWSTR strName,
  449. LPWSTR strComputer,
  450. LPWSTR strUser,
  451. LPWSTR strPassword
  452. );
  453. PDH_FUNCTION
  454. PdhiPlaSetRunAs(
  455. LPWSTR strName,
  456. LPWSTR strComputer,
  457. LPWSTR strUser,
  458. LPWSTR strPassword
  459. );
  460. PDH_FUNCTION
  461. PdhiPlaRunAs(
  462. LPWSTR strName,
  463. LPWSTR strComputer,
  464. HANDLE* hToken
  465. );
  466. PDH_FUNCTION
  467. PdhiPlaGetVersion(
  468. LPCWSTR strComputer,
  469. PPLA_VERSION pVersion
  470. );
  471. PDH_FUNCTION
  472. PdhPlaEnumCollectionsA(
  473. LPSTR strComputer,
  474. LPDWORD pdwBufferSize,
  475. LPSTR mszCollections
  476. );
  477. PDH_FUNCTION
  478. PdhPlaEnumCollectionsW(
  479. LPWSTR strComputer,
  480. LPDWORD pdwBufferSize,
  481. LPWSTR mszCollections
  482. );
  483. PDH_FUNCTION
  484. PdhPlaGetLogFileNameA(
  485. LPWSTR strName,
  486. LPWSTR strComputer,
  487. PPDH_PLA_INFO_A pInfo,
  488. DWORD dwFlags,
  489. LPDWORD pdwBufferSize,
  490. LPWSTR strFileName
  491. );
  492. PDH_FUNCTION
  493. PdhPlaGetLogFileNameW(
  494. LPWSTR strName,
  495. LPWSTR strComputer,
  496. PPDH_PLA_INFO_W pInfo,
  497. DWORD dwFlags,
  498. LPDWORD pdwBufferSize,
  499. LPWSTR strFileName
  500. );
  501. PDH_FUNCTION
  502. PdhTranslate009CounterW(
  503. IN LPWSTR szLocalePath,
  504. IN LPWSTR pszFullPathName,
  505. IN LPDWORD pcchPathLength);
  506. PDH_FUNCTION
  507. PdhTranslate009CounterA(
  508. IN LPSTR szLocalePath,
  509. IN LPSTR pszFullPathName,
  510. IN LPDWORD pcchPathLength);
  511. PDH_FUNCTION
  512. PdhTranslateLocaleCounterW(
  513. IN LPWSTR sz009Path,
  514. IN LPWSTR pszFullPathName,
  515. IN LPDWORD pcchPathLength);
  516. PDH_FUNCTION
  517. PdhTranslateLocaleCounterA(
  518. IN LPSTR sz009Path,
  519. IN LPSTR pszFullPathName,
  520. IN LPDWORD pcchPathLength);
  521. PDH_FUNCTION
  522. PdhAdd009CounterW(
  523. IN HQUERY hQuery,
  524. IN LPWSTR szFullPath,
  525. IN DWORD_PTR dwUserData,
  526. OUT HCOUNTER * phCounter);
  527. PDH_FUNCTION
  528. PdhAdd009CounterA(
  529. IN HQUERY hQuery,
  530. IN LPSTR szFullPath,
  531. IN DWORD_PTR dwUserData,
  532. OUT HCOUNTER * phCounter);
  533. PDH_FUNCTION
  534. PdhGetLogFileTypeW(
  535. IN LPCWSTR LogFileName,
  536. IN LPDWORD LogFileType);
  537. PDH_FUNCTION
  538. PdhGetLogFileTypeA(
  539. IN LPCSTR LogFileName,
  540. IN LPDWORD LogFileType);
  541. PDH_FUNCTION
  542. PdhListLogFileHeaderW (
  543. IN LPCWSTR szFileName,
  544. IN LPWSTR mszHeaderList,
  545. IN LPDWORD pcchHeaderListSize
  546. );
  547. PDH_FUNCTION
  548. PdhListLogFileHeaderA (
  549. IN LPCSTR szFileName,
  550. IN LPSTR mszHeaderList,
  551. IN LPDWORD pcchHeaderListSize
  552. );
  553. #define PLA_SECONDS_IN_DAY 86400
  554. #define PLA_SECONDS_IN_HOUR 3600
  555. #define PLA_SECONDS_IN_MINUTE 60
  556. #define _PLA_CONFIG_DLL_NAME_W_ L"SmLogCfg.dll"
  557. #define _PLA_SERVICE_EXE_NAME_W_ L"SmLogSvc.exe"
  558. // Communication between smlogcfg and smlogsvc
  559. #define PLA_MAX_AUTO_NAME_LEN ((DWORD)0x0000000B)
  560. #define PLA_MAX_COLLECTION_NAME ((DWORD)(_MAX_FNAME - PLA_MAX_AUTO_NAME_LEN - 1))
  561. #define PLA_FILENAME_USE_SUBEXT 0x00000001
  562. #define PLA_FILENAME_GET_SUBFMT 0x00000002
  563. #define PLA_FILENAME_GET_SUBXXX 0x00000004
  564. #define PLA_FILENAME_CREATEONLY 0x00000008
  565. #define PLA_FILENAME_CURRENTLOG 0x00000010
  566. #define PLA_SERVICE_CONTROL_SYNCHRONIZE 128
  567. #define PLA_QUERY_STOPPED ((DWORD)0x00000000)
  568. #define PLA_QUERY_RUNNING ((DWORD)0x00000001)
  569. #define PLA_QUERY_START_PENDING ((DWORD)0x00000002)
  570. #define PLA_NEW_LOG ((DWORD)0xFFFFFFFF)
  571. #define PLA_FIRST_LOG_TYPE ((DWORD)0x00000000)
  572. #define PLA_COUNTER_LOG ((DWORD)0x00000000)
  573. #define PLA_TRACE_LOG ((DWORD)0x00000001)
  574. #define PLA_ALERT ((DWORD)0x00000002)
  575. #define PLA_LAST_LOG_TYPE ((DWORD)0x00000002)
  576. #define PLA_NUM_LOG_TYPES ((DWORD)0x00000003)
  577. // Sysmon log output file configuration definitions
  578. #define PLA_DATASTORE_APPEND_MASK ((DWORD)0x000000F)
  579. #define PLA_DATASTORE_OVERWRITE ((DWORD)0x0000001)
  580. #define PLA_DATASTORE_APPEND ((DWORD)0x0000002)
  581. #define PLA_DATASTORE_SIZE_MASK ((DWORD)0x00000F0)
  582. #define PLA_DATASTORE_SIZE_ONE_RECORD ((DWORD)0x0000010)
  583. #define PLA_DATASTORE_SIZE_KB ((DWORD)0x0000020)
  584. #define PLA_DATASTORE_SIZE_MB ((DWORD)0x0000040)
  585. #define PLA_FIRST_FILE_TYPE ((DWORD)0x00000000)
  586. #define PLA_CSV_FILE ((DWORD)0x00000000)
  587. #define PLA_TSV_FILE ((DWORD)0x00000001)
  588. #define PLA_BIN_FILE ((DWORD)0x00000002)
  589. #define PLA_BIN_CIRC_FILE ((DWORD)0x00000003)
  590. #define PLA_CIRC_TRACE_FILE ((DWORD)0x00000004)
  591. #define PLA_SEQ_TRACE_FILE ((DWORD)0x00000005)
  592. #define PLA_SQL_LOG ((DWORD)0x00000006)
  593. #define PLA_NUM_FILE_TYPES ((DWORD)0x00000007)
  594. #define PLA_SLF_NAME_NONE ((DWORD)0xFFFFFFFF)
  595. #define PLA_SLF_NAME_FIRST_AUTO ((DWORD)0x00000000)
  596. #define PLA_SLF_NAME_MMDDHH ((DWORD)0x00000000)
  597. #define PLA_SLF_NAME_NNNNNN ((DWORD)0x00000001)
  598. #define PLA_SLF_NAME_YYYYDDD ((DWORD)0x00000002)
  599. #define PLA_SLF_NAME_YYYYMM ((DWORD)0x00000003)
  600. #define PLA_SLF_NAME_YYYYMMDD ((DWORD)0x00000004)
  601. #define PLA_SLF_NAME_YYYYMMDDHH ((DWORD)0x00000005)
  602. #define PLA_SLF_NAME_MMDDHHMM ((DWORD)0x00000006)
  603. #define PLA_SLF_NUM_AUTO_NAME_TYPES ((DWORD)0x00000007)
  604. // Sysmon log query types and constants
  605. // Constants
  606. #define PLA_DISK_MAX_SIZE ((DWORD)-1)
  607. #define PLA_LOG_SIZE_UNIT_MB (1024*1024)
  608. #define PLA_LOG_SIZE_UNIT_KB 1024
  609. #define PLA_TLI_ENABLE_BUFFER_FLUSH ((DWORD)0x00000001)
  610. #define PLA_TLI_ENABLE_KERNEL_TRACE ((DWORD)0x00000002)
  611. #define PLA_TLI_ENABLE_MEMMAN_TRACE ((DWORD)0x00000004)
  612. #define PLA_TLI_ENABLE_FILEIO_TRACE ((DWORD)0x00000008)
  613. #define PLA_TLI_ENABLE_PROCESS_TRACE ((DWORD)0x00000010)
  614. #define PLA_TLI_ENABLE_THREAD_TRACE ((DWORD)0x00000020)
  615. #define PLA_TLI_ENABLE_DISKIO_TRACE ((DWORD)0x00000040)
  616. #define PLA_TLI_ENABLE_NETWORK_TCPIP_TRACE ((DWORD)0x00000080)
  617. #define PLA_TLI_ENABLE_MASK ((DWORD)0x000000FF)
  618. #define PLA_TLI_ENABLE_KERNEL_MASK ((DWORD)0x000000FE)
  619. // alert action flags
  620. #define PLA_ALRT_ACTION_LOG_EVENT ((DWORD)0x00000001)
  621. #define PLA_ALRT_ACTION_SEND_MSG ((DWORD)0x00000002)
  622. #define PLA_ALRT_ACTION_EXEC_CMD ((DWORD)0x00000004)
  623. #define PLA_ALRT_ACTION_START_LOG ((DWORD)0x00000008)
  624. #define PLA_ALRT_ACTION_MASK ((DWORD)0x0000000F)
  625. #define PLA_ALRT_CMD_LINE_SINGLE ((DWORD)0x00000100)
  626. #define PLA_ALRT_CMD_LINE_A_NAME ((DWORD)0x00000200)
  627. #define PLA_ALRT_CMD_LINE_C_NAME ((DWORD)0x00000400)
  628. #define PLA_ALRT_CMD_LINE_D_TIME ((DWORD)0x00000800)
  629. #define PLA_ALRT_CMD_LINE_L_VAL ((DWORD)0x00001000)
  630. #define PLA_ALRT_CMD_LINE_M_VAL ((DWORD)0x00002000)
  631. #define PLA_ALRT_CMD_LINE_U_TEXT ((DWORD)0x00004000)
  632. #define PLA_ALRT_CMD_LINE_MASK ((DWORD)0x00007F00)
  633. #define PLA_ALRT_DEFAULT_ACTION ((DWORD)0x00000001) // log event is default
  634. #define PLA_AIBF_UNDER 0L
  635. #define PLA_AIBF_OVER ((DWORD)0x00000001) // true when "over" limit is selected
  636. #define PLA_AIBF_SEEN ((DWORD)0x00000002) // set when the user has seen this value
  637. #define PLA_AIBF_SAVED ((DWORD)0x00000004) // true when user has saved this entry in an edit box
  638. typedef struct _PLA_ALERT_INFO_BLOCK {
  639. DWORD dwSize;
  640. LPTSTR szCounterPath;
  641. DWORD dwFlags;
  642. double dLimit;
  643. } PLA_ALERT_INFO_BLOCK, *PPLA_ALERT_INFO_BLOCK;
  644. #ifdef __cplusplus
  645. }
  646. #endif
  647. #endif // __PDHP__