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.

860 lines
22 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. eventlog.c
  5. Abstract:
  6. This module provides common eventlog services for the File Replication service
  7. Stolen from the routine of the same name in the cluster service.
  8. Author:
  9. John Vert (jvert) 9/13/1996
  10. RohanK - Added Filter
  11. Davidor - Rewrite init using FrsRegistryKeyTable and CfgReg read/write functions.
  12. Revision History:
  13. --*/
  14. #include <ntreppch.h>
  15. #pragma hdrstop
  16. #include <frs.h>
  17. #include <debug.h>
  18. //
  19. // Event Log Sources (NULL Terminated)
  20. //
  21. WORD FrsMessageIdToEventType[] = {
  22. EVENTLOG_SUCCESS,
  23. EVENTLOG_INFORMATION_TYPE,
  24. EVENTLOG_WARNING_TYPE,
  25. EVENTLOG_ERROR_TYPE
  26. };
  27. #define MESSAGEID_TO_EVENTTYPE(_id_) (FrsMessageIdToEventType[_id_ >> 30])
  28. BOOL EventLogRunning = FALSE;
  29. DWORD
  30. ELHashFunction (
  31. IN PVOID Qkey,
  32. IN ULONG len
  33. )
  34. /*++
  35. Routine Description:
  36. This is the hashing function used by the functions that Lookup,
  37. Add or Delete entries from the Hash Tables. The Key is a 64 bit
  38. number and the hashing function casts it to a 32 bit number and
  39. returns it as the hash value.
  40. Arguments:
  41. QKey - Pointer to the Key to be hashed.
  42. len - Length of QKey (unused here).
  43. Return Value:
  44. The hashed value of the Key.
  45. --*/
  46. {
  47. #undef DEBSUB
  48. #define DEBSUB "ELHashFunction:"
  49. ULONG key; // hashed key value to be returned
  50. PULONGLONG p; // hash the key to PULONGLONG
  51. p = (PULONGLONG)Qkey;
  52. key = (ULONG)*p;
  53. return (key);
  54. }
  55. BOOL
  56. FrsEventLogFilter(
  57. IN DWORD EventMessageId,
  58. IN PWCHAR *ArrOfPtrToArgs,
  59. IN DWORD NumOfArgs
  60. )
  61. /*++
  62. Routine Description:
  63. This function is used to filter out eventlogs messages
  64. which have been already written to the EventLog in the
  65. last EVENTLOG_FILTER_TIME sec.
  66. This is done so that the eventlog does not get filled
  67. up with noisy similar messages.
  68. Arguments:
  69. EventMessageId - Supplies the message ID to be logged.
  70. ArrOfPtrToArgs - Array of pointers to Arguments passed
  71. in to the FrsEventLogx functions.
  72. NumOfArgs - The number of elements in the above
  73. array
  74. Return Value:
  75. TRUE - Print the entry in the eventlog
  76. FALSE - Do not print the entry
  77. --*/
  78. {
  79. #undef DEBSUB
  80. #define DEBSUB "FrsEventLogFilter:"
  81. DWORD i, j, sc = 0; // sc = shiftcount while calc the hash value
  82. ULONGLONG QKey = 0; // The hash key value
  83. ULONGLONG QVal = 0;
  84. DWORD GStatus;
  85. ULONGLONG Data;
  86. ULONG_PTR Flags;
  87. FILETIME CurrentTime;
  88. LARGE_INTEGER CT;
  89. LONGLONG TimeDiff = 0;
  90. DPRINT2(5, "ELOG:Filter Request came in with %08x args and an ID value of %08x\n",
  91. NumOfArgs, EventMessageId);
  92. //
  93. // Quit if event log not yet initialized.
  94. //
  95. if (!EventLogRunning) {
  96. return FALSE;
  97. }
  98. //
  99. // Calculate the hash key using the arguments that came in.
  100. // Assign the Id value to the QKey to start with.
  101. //
  102. QKey = EventMessageId;
  103. //
  104. // To calculate the value of QKey, every character of every argument
  105. // is taken, cast to a ULONGLONG left shifted by (0, 4, 8....60) and then
  106. // added to the value of QKey
  107. //
  108. for (i = 0; i < NumOfArgs; i++) {
  109. if (ArrOfPtrToArgs[i]) {
  110. for (j = 0; ArrOfPtrToArgs[i][j] != L'\0'; j++) {
  111. QVal = (ULONGLONG)ArrOfPtrToArgs[i][j];
  112. QVal = QVal << sc;
  113. sc += 4;
  114. if (sc >= 60) {
  115. sc = 0;
  116. }
  117. QKey += QVal;
  118. }
  119. }
  120. }
  121. //
  122. // QKey should never be zero
  123. //
  124. if (QKey == 0) {
  125. QKey = EventMessageId;
  126. }
  127. //
  128. // Lookup this entry in the table. If it exists, get the time associated
  129. // with this entry. If the difference between the current time and the
  130. // time associated with the entry is greater than EVENTLOG_FILTER_TIME
  131. // sec, update the entry and return TRUE, otherwise return FALSE If the
  132. // entry for this key does not exist in the hash table, then this is the
  133. // first time this key is being written to the eventlog. In this case,
  134. // add the entry to the hash table, associate the current time with it and
  135. // return TRUE
  136. //
  137. GStatus = QHashLookup(HTEventLogTimes, &(QKey), &Data, &Flags);
  138. if (GStatus == GHT_STATUS_SUCCESS) {
  139. //
  140. // Key exists, now compare the time values
  141. //
  142. GetSystemTimeAsFileTime(&CurrentTime);
  143. CT.LowPart = CurrentTime.dwLowDateTime;
  144. CT.HighPart = CurrentTime.dwHighDateTime;
  145. TimeDiff = ((((LONGLONG)CT.QuadPart) / (LONGLONG)CONVERTTOSEC) - (LONGLONG)Data);
  146. DPRINT1(5, "ELOG:The value of TimeDiff is %08x %08x\n", PRINTQUAD(TimeDiff));
  147. if (TimeDiff > EVENTLOG_FILTER_TIME) {
  148. //
  149. // UpDate the hash table entry. GetSystemTimeAsFileTime
  150. // retuns the time in 100 nano (100 * 10^9) sec units. Hence
  151. // to get it in sec we need to divide by (10^7)
  152. //
  153. Data = (((ULONGLONG)CT.QuadPart) / (ULONGLONG)CONVERTTOSEC);
  154. GStatus = QHashUpdate(HTEventLogTimes, &(QKey), &Data, Flags);
  155. if (GStatus == GHT_STATUS_FAILURE) {
  156. DPRINT2(5, "ELOG:QHashUpdate failed while updating ID %08x with QKey %08x %08x\n",
  157. EventMessageId, PRINTQUAD(QKey));
  158. } else {
  159. DPRINT2(5, "ELOG:Update was successful for eventlog entry with ID %08x and QKey %08x %08x\n",
  160. EventMessageId, PRINTQUAD(QKey));
  161. }
  162. return TRUE;
  163. }
  164. else {
  165. //
  166. // This event log entry should not be written
  167. //
  168. DPRINT2(5, "ELOG: Did not add the ID %08x with QKey %08x %08x to the EventLog\n",
  169. EventMessageId, PRINTQUAD(QKey));
  170. return FALSE;
  171. }
  172. } else {
  173. //
  174. // Key does not exist
  175. // Create a new entry for it
  176. //
  177. DPRINT2(5, "ELOG:Got a new eventlog entry with ID %08x and QKey %08x %08x\n",
  178. EventMessageId, PRINTQUAD(QKey));
  179. //
  180. // Get the current system time
  181. //
  182. GetSystemTimeAsFileTime(&CurrentTime);
  183. CT.LowPart = CurrentTime.dwLowDateTime;
  184. CT.HighPart = CurrentTime.dwHighDateTime;
  185. //
  186. // GetSystemTimeAsFileTime retuns the time in 100 nano
  187. // (100 * 10^9) sec units. Hence to get it in sec we need to
  188. // divide by (10^7)
  189. //
  190. Data = (((ULONGLONG)CT.QuadPart) / (ULONGLONG)CONVERTTOSEC);
  191. //
  192. // Insert the new entry into the hash table
  193. //
  194. GStatus = QHashInsert(HTEventLogTimes, &QKey, &Data, 0, FALSE);
  195. if (GStatus == GHT_STATUS_FAILURE) {
  196. DPRINT2(5, "ELOG:QHashInsert failed while Inserting ID %08x with QKey %08x %08x\n",
  197. EventMessageId, PRINTQUAD(QKey));
  198. } else {
  199. DPRINT2(5, "ELOG:Insert was successful for eventlog entry with ID %08x and QKey %08x %08x\n",
  200. EventMessageId, PRINTQUAD(QKey));
  201. }
  202. return TRUE;
  203. }
  204. }
  205. VOID
  206. InitializeEventLog(
  207. VOID
  208. )
  209. /*++
  210. Routine Description:
  211. Create the event log entry and setup the event log handle.
  212. Arguments:
  213. None.
  214. Return Value:
  215. None.
  216. --*/
  217. {
  218. #undef DEBSUB
  219. #define DEBSUB "InitializeEventLog:"
  220. DWORD WStatus;
  221. PWCHAR Path = NULL;
  222. HANDLE hEventLog;
  223. HKEY EventLogKey = 0;
  224. HKEY FrsEventLogKey = 0;
  225. HKEY FrsSourceKey = 0;
  226. //
  227. // create the hash table and assign the hash function. The table
  228. // is used for storing eventlog times of similar messages. These
  229. // values of time are used in filtering these similar messages
  230. //
  231. HTEventLogTimes = FrsAllocTypeSize(QHASH_TABLE_TYPE, ELHASHTABLESIZE);
  232. SET_QHASH_TABLE_HASH_CALC(HTEventLogTimes, ELHashFunction);
  233. //
  234. // EventLog Key - <SERVICE_ROOT>\EventLog
  235. //
  236. WStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
  237. EVENTLOG_ROOT,
  238. 0,
  239. KEY_ALL_ACCESS,
  240. &EventLogKey);
  241. CLEANUP1_WS(0, "WARN - Cannot open %ws;", EVENTLOG_ROOT, WStatus, CLEANUP);
  242. //
  243. // Set new eventlog source in the registry
  244. //
  245. WStatus = RegCreateKey(EventLogKey, SERVICE_LONG_NAME, &FrsEventLogKey);
  246. CLEANUP1_WS(0, "WARN - Cannot create %ws;", FRS_EVENTLOG_SECTION, WStatus, CLEANUP);
  247. //
  248. // Add the following values to the Reg key HKLM.....\EventLog\File Replication Service
  249. // 1. File 2. Retention 3. MaxSize
  250. //
  251. // If the values already exist then preserve them.
  252. //
  253. //
  254. // Event log file name -- "%SystemRoot%\system32\config\NtFrs.Evt"
  255. //
  256. CfgRegWriteString(FKC_EVENTLOG_FILE,
  257. SERVICE_LONG_NAME,
  258. FRS_RKF_FORCE_DEFAULT_VALUE | FRS_RKF_KEEP_EXISTING_VALUE,
  259. 0);
  260. //
  261. // Retention
  262. //
  263. CfgRegWriteDWord(FKC_EVENTLOG_RETENTION,
  264. SERVICE_LONG_NAME,
  265. FRS_RKF_FORCE_DEFAULT_VALUE | FRS_RKF_KEEP_EXISTING_VALUE,
  266. 0);
  267. //
  268. // MaxSize
  269. //
  270. CfgRegWriteDWord(FKC_EVENTLOG_MAXSIZE,
  271. SERVICE_LONG_NAME,
  272. FRS_RKF_FORCE_DEFAULT_VALUE | FRS_RKF_KEEP_EXISTING_VALUE,
  273. 0);
  274. //
  275. // DisplayNameID
  276. //
  277. CfgRegWriteDWord(FKC_EVENTLOG_DISPLAY_NAMEID,
  278. SERVICE_LONG_NAME,
  279. FRS_RKF_FORCE_DEFAULT_VALUE | FRS_RKF_KEEP_EXISTING_VALUE,
  280. 0);
  281. //
  282. // DisplayNameFile
  283. //
  284. CfgRegWriteString(FKC_EVENTLOG_DISPLAY_FILENAME,
  285. SERVICE_LONG_NAME,
  286. FRS_RKF_FORCE_DEFAULT_VALUE | FRS_RKF_KEEP_EXISTING_VALUE,
  287. NULL);
  288. //
  289. // Event Message File
  290. //
  291. WStatus = RegSetValueEx(FrsEventLogKey,
  292. L"Sources",
  293. 0,
  294. REG_MULTI_SZ,
  295. (PCHAR)(SERVICE_NAME L"\0"
  296. SERVICE_LONG_NAME L"\0"),
  297. (wcslen(SERVICE_NAME) +
  298. wcslen(SERVICE_LONG_NAME) +
  299. 3) * sizeof(WCHAR));
  300. CLEANUP1_WS(0, "WARN - Cannot set event log value Sources for %ws;",
  301. SERVICE_LONG_NAME, WStatus, CLEANUP);
  302. //
  303. // Get the message file path. (expanding any environment vars).
  304. //
  305. CfgRegReadString(FKC_FRS_MESSAGE_FILE_PATH, NULL, 0, &Path);
  306. //
  307. // Add values for message file and event types for each event log source.
  308. //
  309. CfgRegWriteString(FKC_EVENTLOG_EVENT_MSG_FILE, SERVICE_NAME, 0, Path);
  310. CfgRegWriteString(FKC_EVENTLOG_EVENT_MSG_FILE, SERVICE_LONG_NAME, 0, Path);
  311. CfgRegWriteDWord(FKC_EVENTLOG_TYPES_SUPPORTED,
  312. SERVICE_NAME,
  313. FRS_RKF_FORCE_DEFAULT_VALUE,
  314. 0);
  315. CfgRegWriteDWord(FKC_EVENTLOG_TYPES_SUPPORTED,
  316. SERVICE_LONG_NAME,
  317. FRS_RKF_FORCE_DEFAULT_VALUE,
  318. 0);
  319. //
  320. // Unfortunately, this call will succeed with the Application log file
  321. // instead of the File Replication Log file if the EventLog service has not
  322. // yet reacted to the change notify of the updated registry keys above.
  323. // Hence, the source will be re-registered for each event so that ntfrs
  324. // events eventually show up in the file replication service log. The
  325. // register/deregister pair allows EventLog some extra time so that MAYBE
  326. // the first event will show up in the right log.
  327. //
  328. // The eventlog folk may someday supply an interface to see if
  329. // the register was kicked into Application.
  330. //
  331. hEventLog = RegisterEventSource(NULL, SERVICE_NAME);
  332. if (hEventLog) {
  333. DeregisterEventSource(hEventLog);
  334. }
  335. WStatus = ERROR_SUCCESS;
  336. EventLogRunning = TRUE;
  337. DPRINT(0, "Event Log is running\n");
  338. CLEANUP:
  339. DPRINT_WS(0, "ERROR - Cannot start event logging;", WStatus);
  340. if (EventLogKey) {
  341. RegCloseKey(EventLogKey);
  342. }
  343. if (FrsEventLogKey) {
  344. RegCloseKey(FrsEventLogKey);
  345. }
  346. FrsFree(Path);
  347. }
  348. DWORD
  349. FrsReportEvent(
  350. IN DWORD EventMessageId,
  351. IN PWCHAR *ArgArray,
  352. IN DWORD NumOfArgs
  353. )
  354. /*++
  355. Routine Description:
  356. This function is used to register the event source and post the event.
  357. WARNING -- this function may be called from inside of DPRINTs. So
  358. do not call DPRINT (or any function referenced by
  359. DPRINT) from this function.
  360. Arguments:
  361. EventMessageId - Supplies the message ID to be logged.
  362. ArgArray - Array of pointers to Arguments passed
  363. in to the FrsEventLogx functions.
  364. NumOfArgs - The number of elements in the above
  365. array
  366. Return Value:
  367. Win32 Status.
  368. --*/
  369. {
  370. #undef DEBSUB
  371. #define DEBSUB "FrsReportEvent:"
  372. DWORD WStatus = ERROR_SUCCESS;
  373. HANDLE hEventLog;
  374. UINT i;
  375. PWCHAR ResStr;
  376. WORD EventType;
  377. hEventLog = RegisterEventSource(NULL, SERVICE_NAME);
  378. if (!HANDLE_IS_VALID(hEventLog)) {
  379. WStatus = GetLastError();
  380. //DPRINT_WS(0, "WARN - Cannot register event source;", WStatus);
  381. return WStatus;
  382. }
  383. //
  384. // Check if any argument exceeds the 32K size limit. If it does then truncate it
  385. // and indicate that the event log message size has been exceeded.
  386. //
  387. for (i=0;i<NumOfArgs;++i) {
  388. if (wcslen(ArgArray[i]) > 32000/sizeof(WCHAR)) { //Each string has a limit of 32K bytes.
  389. ResStr = FrsGetResourceStr(IDS_EVENT_LOG_MSG_SIZE_EXCEEDED);
  390. wcscpy(&ArgArray[i][32000/sizeof(WCHAR) - 500], ResStr);
  391. FrsFree(ResStr);
  392. }
  393. }
  394. //
  395. //
  396. // The Event Type is is part of the message and should be one of the following:
  397. // EVENTLOG_ERROR_TYPE Error event
  398. // EVENTLOG_WARNING_TYPE Warning event
  399. // EVENTLOG_INFORMATION_TYPE Information event
  400. // EVENTLOG_AUDIT_SUCCESS Success Audit event
  401. // EVENTLOG_AUDIT_FAILURE Failure Audit event
  402. //
  403. EventType = MESSAGEID_TO_EVENTTYPE(EventMessageId);
  404. //
  405. // Report the event.
  406. //
  407. if (!ReportEvent(hEventLog, // handle returned by RegisterEventSource
  408. EventType, // event type to log
  409. 0, // event category
  410. EventMessageId, // event identifier
  411. NULL, // user security identifier (optional)
  412. (WORD) NumOfArgs, // number of strings to merge with message
  413. 0, // size of binary data, in bytes
  414. ArgArray, // array of strings to merge with message
  415. NULL)) { // address of binary data
  416. WStatus = GetLastError();
  417. }
  418. DeregisterEventSource(hEventLog);
  419. //DPRINT_WS(0, "Failed to report event log message. ID = %d (0x%08x).",
  420. // EventMessageId, EventMessageId, WStatus);
  421. return WStatus;
  422. }
  423. /*++
  424. Routine Description:
  425. The following functions Log an event to the event log with
  426. from zero to six insertion strings.
  427. WARNING -- these functions may be called from inside of DPRINTs. So
  428. do not call DPRINT (or any function referenced by
  429. DPRINT) from this function.
  430. Arguments:
  431. EventMessageId - Supplies the message ID to be logged.
  432. EventMessage1..6 - Insertion strings
  433. Return Value:
  434. None.
  435. --*/
  436. VOID
  437. FrsEventLog0(
  438. IN DWORD EventMessageId
  439. )
  440. {
  441. #undef DEBSUB
  442. #define DEBSUB "FrsEventLog0:"
  443. //
  444. // Check to see if this eventlog request can be filtered.
  445. //
  446. if (FrsEventLogFilter(EventMessageId, NULL, 0)) {
  447. FrsReportEvent(EventMessageId, NULL, 0);
  448. }
  449. }
  450. VOID
  451. FrsEventLog1(
  452. IN DWORD EventMessageId,
  453. IN PWCHAR EventMessage1
  454. )
  455. {
  456. #undef DEBSUB
  457. #define DEBSUB "FrsEventLog1:"
  458. PWCHAR ArgArray[1];
  459. //
  460. // Check to see if this eventlog request can be filtered.
  461. //
  462. ArgArray[0] = EventMessage1;
  463. if (FrsEventLogFilter(EventMessageId, ArgArray, 1)) {
  464. FrsReportEvent(EventMessageId, ArgArray, 1);
  465. }
  466. }
  467. VOID
  468. FrsEventLog2(
  469. IN DWORD EventMessageId,
  470. IN PWCHAR EventMessage1,
  471. IN PWCHAR EventMessage2
  472. )
  473. {
  474. #undef DEBSUB
  475. #define DEBSUB "FrsEventLog2:"
  476. PWCHAR ArgArray[2];
  477. //
  478. // Check to see if this eventlog request can be filtered.
  479. //
  480. ArgArray[0] = EventMessage1;
  481. ArgArray[1] = EventMessage2;
  482. if (FrsEventLogFilter(EventMessageId, ArgArray, 2)) {
  483. FrsReportEvent(EventMessageId, ArgArray, 2);
  484. }
  485. }
  486. VOID
  487. FrsEventLog3(
  488. IN DWORD EventMessageId,
  489. IN PWCHAR EventMessage1,
  490. IN PWCHAR EventMessage2,
  491. IN PWCHAR EventMessage3
  492. )
  493. {
  494. #undef DEBSUB
  495. #define DEBSUB "FrsEventLog3:"
  496. PWCHAR ArgArray[3];
  497. //
  498. // Check to see if this eventlog request can be filtered.
  499. //
  500. ArgArray[0] = EventMessage1;
  501. ArgArray[1] = EventMessage2;
  502. ArgArray[2] = EventMessage3;
  503. if (FrsEventLogFilter(EventMessageId, ArgArray, 3)) {
  504. FrsReportEvent(EventMessageId, ArgArray, 3);
  505. }
  506. }
  507. VOID
  508. FrsEventLog4(
  509. IN DWORD EventMessageId,
  510. IN PWCHAR EventMessage1,
  511. IN PWCHAR EventMessage2,
  512. IN PWCHAR EventMessage3,
  513. IN PWCHAR EventMessage4
  514. )
  515. {
  516. #undef DEBSUB
  517. #define DEBSUB "FrsEventLog4:"
  518. PWCHAR ArgArray[4];
  519. //
  520. // Check to see if this eventlog request can be filtered.
  521. //
  522. ArgArray[0] = EventMessage1;
  523. ArgArray[1] = EventMessage2;
  524. ArgArray[2] = EventMessage3;
  525. ArgArray[3] = EventMessage4;
  526. if (FrsEventLogFilter(EventMessageId, ArgArray, 4)) {
  527. FrsReportEvent(EventMessageId, ArgArray, 4);
  528. }
  529. }
  530. VOID
  531. FrsEventLog5(
  532. IN DWORD EventMessageId,
  533. IN PWCHAR EventMessage1,
  534. IN PWCHAR EventMessage2,
  535. IN PWCHAR EventMessage3,
  536. IN PWCHAR EventMessage4,
  537. IN PWCHAR EventMessage5
  538. )
  539. {
  540. #undef DEBSUB
  541. #define DEBSUB "FrsEventLog5:"
  542. PWCHAR ArgArray[5];
  543. //
  544. // Check to see if this eventlog request can be filtered.
  545. //
  546. ArgArray[0] = EventMessage1;
  547. ArgArray[1] = EventMessage2;
  548. ArgArray[2] = EventMessage3;
  549. ArgArray[3] = EventMessage4;
  550. ArgArray[4] = EventMessage5;
  551. if (FrsEventLogFilter(EventMessageId, ArgArray, 5)) {
  552. FrsReportEvent(EventMessageId, ArgArray, 5);
  553. }
  554. }
  555. VOID
  556. FrsEventLog6(
  557. IN DWORD EventMessageId,
  558. IN PWCHAR EventMessage1,
  559. IN PWCHAR EventMessage2,
  560. IN PWCHAR EventMessage3,
  561. IN PWCHAR EventMessage4,
  562. IN PWCHAR EventMessage5,
  563. IN PWCHAR EventMessage6
  564. )
  565. {
  566. #undef DEBSUB
  567. #define DEBSUB "FrsEventLog6:"
  568. PWCHAR ArgArray[6];
  569. //
  570. // Check to see if this eventlog request can be filtered.
  571. //
  572. ArgArray[0] = EventMessage1;
  573. ArgArray[1] = EventMessage2;
  574. ArgArray[2] = EventMessage3;
  575. ArgArray[3] = EventMessage4;
  576. ArgArray[4] = EventMessage5;
  577. ArgArray[5] = EventMessage6;
  578. if (FrsEventLogFilter(EventMessageId, ArgArray, 6)) {
  579. FrsReportEvent(EventMessageId, ArgArray, 6);
  580. }
  581. }
  582. VOID
  583. FrsEventLog7(
  584. IN DWORD EventMessageId,
  585. IN PWCHAR EventMessage1,
  586. IN PWCHAR EventMessage2,
  587. IN PWCHAR EventMessage3,
  588. IN PWCHAR EventMessage4,
  589. IN PWCHAR EventMessage5,
  590. IN PWCHAR EventMessage6,
  591. IN PWCHAR EventMessage7
  592. )
  593. {
  594. #undef DEBSUB
  595. #define DEBSUB "FrsEventLog7:"
  596. PWCHAR ArgArray[7];
  597. //
  598. // Check to see if this eventlog request can be filtered.
  599. //
  600. ArgArray[0] = EventMessage1;
  601. ArgArray[1] = EventMessage2;
  602. ArgArray[2] = EventMessage3;
  603. ArgArray[3] = EventMessage4;
  604. ArgArray[4] = EventMessage5;
  605. ArgArray[5] = EventMessage6;
  606. ArgArray[6] = EventMessage7;
  607. if (FrsEventLogFilter(EventMessageId, ArgArray, 7)) {
  608. FrsReportEvent(EventMessageId, ArgArray, 7);
  609. }
  610. }
  611. VOID
  612. FrsEventLog8(
  613. IN DWORD EventMessageId,
  614. IN PWCHAR EventMessage1,
  615. IN PWCHAR EventMessage2,
  616. IN PWCHAR EventMessage3,
  617. IN PWCHAR EventMessage4,
  618. IN PWCHAR EventMessage5,
  619. IN PWCHAR EventMessage6,
  620. IN PWCHAR EventMessage7,
  621. IN PWCHAR EventMessage8
  622. )
  623. {
  624. #undef DEBSUB
  625. #define DEBSUB "FrsEventLog8:"
  626. PWCHAR ArgArray[8];
  627. //
  628. // Check to see if this eventlog request can be filtered.
  629. //
  630. ArgArray[0] = EventMessage1;
  631. ArgArray[1] = EventMessage2;
  632. ArgArray[2] = EventMessage3;
  633. ArgArray[3] = EventMessage4;
  634. ArgArray[4] = EventMessage5;
  635. ArgArray[5] = EventMessage6;
  636. ArgArray[6] = EventMessage7;
  637. ArgArray[7] = EventMessage8;
  638. if (FrsEventLogFilter(EventMessageId, ArgArray, 8)) {
  639. FrsReportEvent(EventMessageId, ArgArray, 8);
  640. }
  641. }
  642. VOID
  643. FrsEventLog9(
  644. IN DWORD EventMessageId,
  645. IN PWCHAR EventMessage1,
  646. IN PWCHAR EventMessage2,
  647. IN PWCHAR EventMessage3,
  648. IN PWCHAR EventMessage4,
  649. IN PWCHAR EventMessage5,
  650. IN PWCHAR EventMessage6,
  651. IN PWCHAR EventMessage7,
  652. IN PWCHAR EventMessage8,
  653. IN PWCHAR EventMessage9
  654. )
  655. {
  656. #undef DEBSUB
  657. #define DEBSUB "FrsEventLog9:"
  658. PWCHAR ArgArray[9];
  659. //
  660. // Check to see if this eventlog request can be filtered.
  661. //
  662. ArgArray[0] = EventMessage1;
  663. ArgArray[1] = EventMessage2;
  664. ArgArray[2] = EventMessage3;
  665. ArgArray[3] = EventMessage4;
  666. ArgArray[4] = EventMessage5;
  667. ArgArray[5] = EventMessage6;
  668. ArgArray[6] = EventMessage7;
  669. ArgArray[7] = EventMessage8;
  670. ArgArray[8] = EventMessage9;
  671. if (FrsEventLogFilter(EventMessageId, ArgArray, 9)) {
  672. FrsReportEvent(EventMessageId, ArgArray, 9);
  673. }
  674. }