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.

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