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.

1013 lines
19 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. unittest.h
  5. Abstract:
  6. This is the source file for the unit test support lib
  7. Author(s):
  8. Vincent Geglia
  9. Environment:
  10. User Mode
  11. Notes:
  12. USER32.LIB, and KERNEL32.LIB must be linked with this
  13. WINDOWS.H must be #included prior to this header file
  14. Revision History:
  15. Initial version, 011119, vincentg
  16. --*/
  17. //
  18. // General includes
  19. //
  20. //
  21. // NTLOG definitions
  22. //
  23. #define TLS_LOGALL 0x0000FFFFL // Log output. Logs all the time.
  24. #define TLS_INFO 0x00002000L // Log information.
  25. #define TLS_SEV1 0x00000002L // Log at Severity 1 level
  26. #define TLS_PASS 0x00000020L // Log at Pass level
  27. #define TLS_REFRESH 0x00010000L // Create new file || trunc to zero.
  28. #define TLS_MONITOR 0x00080000L // Output to 2nd screen.
  29. #define TLS_VARIATION 0x00000200L // Log testcase level.
  30. #define TL_VARIATION TLS_VARIATION,TEXT(__FILE__),(int)__LINE__
  31. //
  32. // Define progress bits
  33. // These bits are used to track the progress through
  34. // a given function, for the purposes of providing
  35. // proper cleanup. They are also useful for debugging.
  36. //
  37. //
  38. // Progress macros
  39. //
  40. #if 0
  41. #define FORCEERRORPATH
  42. #define FORCEERRORPATHBIT 0x2
  43. #endif
  44. #if 0
  45. #ifdef DBG
  46. #define ECHOPROGRESSDATA
  47. #endif
  48. #endif
  49. #ifdef ECHOPROGRESSDATA
  50. #define PROGRESS_INIT(x) DWORD progressbits = 0; \
  51. UCHAR functionname [100]; \
  52. strcpy (functionname, x); \
  53. printf("****\nFunction: %s\n(module %s, line %d)\nPROGRESS TRACKING INITIALIZED\n****\n\n", functionname, __FILE__, __LINE__);
  54. #ifdef FORCEERRORPATH
  55. #define PROGRESS_UPDATE(x) printf("****\nFunction: %s\n(module %s, line %d)\nPROGRESS UPDATE (WAS %08lx", functionname, __FILE__, __LINE__, progressbits); \
  56. printf(", NOW %08lx).\nForcing error path %08lx\n****\n\n", progressbits |= x, FORCEERRORPATHBIT);\
  57. if (progressbits & FORCEERRORPATHBIT) {\
  58. goto exitcleanup;\
  59. }
  60. #else
  61. #define PROGRESS_UPDATE(x) printf("****\nFunction: %s\n(module %s, line %d)\nPROGRESS UPDATE (WAS %08lx", functionname, __FILE__, __LINE__, progressbits); \
  62. printf(", NOW %08lx).\n****\n\n", progressbits |= x);
  63. #endif
  64. #define PROGRESS_GET progressbits
  65. #define PROGRESS_END progressbits = 0
  66. #else
  67. #define PROGRESS_INIT(x) DWORD progressbits = 0
  68. #define PROGRESS_UPDATE(x) progressbits |= x
  69. #define PROGRESS_GET progressbits
  70. #define PROGRESS_END progressbits = 0
  71. #endif
  72. //
  73. // Globals
  74. //
  75. HANDLE g_log = INVALID_HANDLE_VALUE;
  76. BOOL g_usentlog = FALSE;
  77. BOOL g_genericresult = TRUE;
  78. typedef HANDLE (*Dll_tlCreateLog) (LPSTR, DWORD);
  79. typedef BOOL (*Dll_tlAddParticipant) (HANDLE, DWORD, int);
  80. typedef BOOL (*Dll_tlStartVariation) (HANDLE);
  81. typedef BOOL (*Dll_tlLog) (HANDLE, DWORD, LPCSTR, int,...);
  82. typedef DWORD (*Dll_tlEndVariation) (HANDLE);
  83. typedef BOOL (*Dll_tlRemoveParticipant) (HANDLE);
  84. typedef BOOL (*Dll_tlDestroyLog) (HANDLE);
  85. typedef VOID (*Dll_tlReportStats) (HANDLE);
  86. Dll_tlCreateLog _tlCreateLog;
  87. Dll_tlAddParticipant _tlAddParticipant;
  88. Dll_tlDestroyLog _tlDestroyLog;
  89. Dll_tlEndVariation _tlEndVariation;
  90. Dll_tlLog _tlLog;
  91. Dll_tlRemoveParticipant _tlRemoveParticipant;
  92. Dll_tlStartVariation _tlStartVariation;
  93. Dll_tlReportStats _tlReportStats;
  94. //
  95. // Definitions
  96. //
  97. #define LOGINFO(x) LogNTLOG (g_log, LOG_INFO, x)
  98. #define LOGENTRYTEXTLENGTH 12
  99. #define LOGENTRYTEXTPASS "\n**PASS**: \0"
  100. #define LOGENTRYTEXTFAIL "\n**FAIL**: \0"
  101. #define LOGENTRYTEXTINFO "\n**INFO**: \0"
  102. //
  103. // Structures
  104. //
  105. typedef enum {
  106. UNIT_TEST_STATUS_SUCCESS = 0,
  107. UNIT_TEST_STATUS_NOT_RUN,
  108. UNIT_TEST_STATUS_FAILURE
  109. } UNIT_TEST_STATUS;
  110. typedef enum {
  111. LOG_PASS = 0,
  112. LOG_FAIL,
  113. LOG_INFO
  114. } LOG_ENTRY_TYPE;
  115. //
  116. // Function prototypes
  117. //
  118. BOOL
  119. UtInitLog
  120. (
  121. PUCHAR Logfilename
  122. );
  123. VOID
  124. UtCloseLog
  125. (
  126. VOID
  127. );
  128. VOID
  129. UtLog
  130. (
  131. LOG_ENTRY_TYPE LogEntryType,
  132. PUCHAR LogText,
  133. ...
  134. );
  135. VOID
  136. UtLogINFO
  137. (
  138. PUCHAR LogText,
  139. ...
  140. );
  141. VOID
  142. UtLogPASS
  143. (
  144. PUCHAR LogText,
  145. ...
  146. );
  147. VOID
  148. UtLogFAIL
  149. (
  150. PUCHAR LogText,
  151. ...
  152. );
  153. PUCHAR
  154. UtParseCmdLine
  155. (
  156. PUCHAR Search,
  157. int Argc,
  158. char *Argv[]
  159. );
  160. //
  161. // Private function prototypes
  162. //
  163. BOOL
  164. UtpInitGenericLog
  165. (
  166. PUCHAR Logfilename
  167. );
  168. BOOL
  169. UtpInitNtLog
  170. (
  171. PUCHAR Logfilename
  172. );
  173. VOID
  174. UtpCloseGenericLog
  175. (
  176. VOID
  177. );
  178. VOID
  179. UtpCloseNtLog
  180. (
  181. VOID
  182. );
  183. VOID
  184. UtpLogGenericLog
  185. (
  186. LOG_ENTRY_TYPE LogEntryType,
  187. PUCHAR LogText
  188. );
  189. VOID
  190. UtpLogNtLog
  191. (
  192. LOG_ENTRY_TYPE LogEntryType,
  193. PUCHAR LogText
  194. );
  195. //
  196. // Code
  197. //
  198. BOOL
  199. UtInitLog
  200. (
  201. PUCHAR Logfilename
  202. )
  203. /*++
  204. Routine Description:
  205. This routine sets up the unit test log mechanism
  206. Arguments:
  207. None
  208. Return Value:
  209. TRUE if successful
  210. FALSE if unsuccessful
  211. N.B. - FALSE is returned if a log session already exists.
  212. --*/
  213. //
  214. // InitNTLOG progress bits
  215. //
  216. #define UtInitLog_ENTRY 0x00000001
  217. #define UtInitLog_LOADNTLOG 0x00000002
  218. #define UtInitLog_COMPLETION 0x00000004
  219. {
  220. UCHAR logfilepath [MAX_PATH];
  221. DWORD logstyle;
  222. BOOL bstatus = FALSE;
  223. HMODULE ntlogmodule = NULL;
  224. PROGRESS_INIT ("UtInitLog");
  225. PROGRESS_UPDATE (UtInitLog_ENTRY);
  226. if (g_log != INVALID_HANDLE_VALUE) {
  227. bstatus = FALSE;
  228. goto exitcleanup;
  229. }
  230. //
  231. // Try to initialize NTLOG first
  232. //
  233. PROGRESS_UPDATE (UtInitLog_LOADNTLOG);
  234. ntlogmodule = LoadLibrary ("NTLOG.DLL");
  235. if (ntlogmodule != NULL) {
  236. if (!(_tlCreateLog = (Dll_tlCreateLog) GetProcAddress (ntlogmodule, "tlCreateLog_A")) ||
  237. !(_tlAddParticipant = (Dll_tlAddParticipant) GetProcAddress (ntlogmodule, "tlAddParticipant")) ||
  238. !(_tlDestroyLog = (Dll_tlDestroyLog) GetProcAddress (ntlogmodule, "tlDestroyLog")) ||
  239. !(_tlEndVariation = (Dll_tlEndVariation) GetProcAddress (ntlogmodule, "tlEndVariation")) ||
  240. !(_tlLog = (Dll_tlLog) GetProcAddress (ntlogmodule, "tlLog_A")) ||
  241. !(_tlRemoveParticipant = (Dll_tlRemoveParticipant)GetProcAddress (ntlogmodule, "tlRemoveParticipant"))||
  242. !(_tlStartVariation = (Dll_tlStartVariation) GetProcAddress (ntlogmodule, "tlStartVariation")) ||
  243. !(_tlReportStats = (Dll_tlReportStats) GetProcAddress (ntlogmodule, "tlReportStats"))
  244. )
  245. {
  246. bstatus = FALSE;
  247. goto exitcleanup;
  248. }
  249. bstatus = UtpInitNtLog (Logfilename);
  250. if (bstatus == TRUE) {
  251. g_usentlog = TRUE;
  252. }
  253. } else {
  254. bstatus = UtpInitGenericLog (Logfilename);
  255. if (bstatus == TRUE) {
  256. g_usentlog = FALSE;
  257. g_genericresult = TRUE;
  258. }
  259. }
  260. PROGRESS_UPDATE (UtInitLog_COMPLETION);
  261. exitcleanup:
  262. //
  263. // Cleanup
  264. //
  265. PROGRESS_END;
  266. return bstatus;
  267. }
  268. VOID
  269. UtCloseLog
  270. (
  271. VOID
  272. )
  273. /*++
  274. Routine Description:
  275. This routine closes the logging session and summarizes results
  276. Arguments:
  277. None
  278. Return Value:
  279. None
  280. --*/
  281. {
  282. if (g_usentlog == TRUE) {
  283. UtpCloseNtLog ();
  284. } else {
  285. UtpCloseGenericLog ();
  286. }
  287. g_log = INVALID_HANDLE_VALUE;
  288. }
  289. VOID
  290. UtLog
  291. (
  292. LOG_ENTRY_TYPE LogEntryType,
  293. PUCHAR LogText,
  294. ...
  295. )
  296. /*++
  297. Routine Description:
  298. This routine logs an entry to a unit test logging session.
  299. Arguments:
  300. A log entry type
  301. Text to log
  302. Return Value:
  303. None
  304. --*/
  305. //
  306. // UtLog progress bits
  307. //
  308. #define UtLog_ENTRY 0x00000001
  309. #define UtLog_LOG 0x00000002
  310. #define UtLog_COMPLETION 0x00000004
  311. {
  312. va_list va;
  313. UCHAR logtext[1000];
  314. PROGRESS_INIT ("UtLog");
  315. PROGRESS_UPDATE (UtLog_ENTRY);
  316. if (g_log == INVALID_HANDLE_VALUE) {
  317. goto exitcleanup;
  318. }
  319. va_start (va, LogText);
  320. _vsnprintf (logtext, sizeof (logtext), LogText, va);
  321. va_end (va);
  322. if (g_usentlog == TRUE) {
  323. UtpLogNtLog (LogEntryType, logtext);
  324. } else {
  325. UtpLogGenericLog (LogEntryType, logtext);
  326. }
  327. PROGRESS_UPDATE (UtLog_LOG);
  328. PROGRESS_UPDATE (UtLog_COMPLETION);
  329. exitcleanup:
  330. PROGRESS_END;
  331. return;
  332. }
  333. VOID
  334. UtLogINFO
  335. (
  336. PUCHAR LogText,
  337. ...
  338. )
  339. /*++
  340. Routine Description:
  341. This routine logs an INFO entry
  342. Arguments:
  343. Text describing the entry
  344. Return Value:
  345. None
  346. --*/
  347. {
  348. va_list va;
  349. va_start (va, LogText);
  350. UtLog (LOG_INFO, LogText, va);
  351. va_end (va);
  352. }
  353. VOID
  354. UtLogPASS
  355. (
  356. PUCHAR LogText,
  357. ...
  358. )
  359. /*++
  360. Routine Description:
  361. This routine logs a PASS entry
  362. Arguments:
  363. Text describing the entry
  364. Return Value:
  365. None
  366. --*/
  367. {
  368. va_list va;
  369. va_start (va, LogText);
  370. UtLog (LOG_INFO, LogText, va);
  371. va_end (va);
  372. }
  373. VOID
  374. UtLogFAIL
  375. (
  376. PUCHAR LogText,
  377. ...
  378. )
  379. /*++
  380. Routine Description:
  381. This routine logs an FAIL entry
  382. Arguments:
  383. Text describing the entry
  384. Return Value:
  385. None
  386. --*/
  387. {
  388. va_list va;
  389. va_start (va, LogText);
  390. UtLog (LOG_FAIL, LogText, va);
  391. va_end (va);
  392. }
  393. PUCHAR
  394. UtParseCmdLine
  395. (
  396. PUCHAR Search,
  397. int Argc,
  398. char *Argv[]
  399. )
  400. /*++
  401. Routine Description:
  402. This routine parses the command line
  403. Arguments:
  404. Search - string to search for
  405. Argc - argc passed into main
  406. Argv - argv passed into main
  407. Return Value:
  408. A pointer to the first instance of the string in the parameter list or
  409. NULL if the string does not exist
  410. --*/
  411. {
  412. int count = 0;
  413. PUCHAR instance;
  414. for (count = 0; count < Argc; count ++) {
  415. instance = strstr (Argv[count], Search);
  416. if (instance) {
  417. return instance;
  418. }
  419. }
  420. return 0;
  421. }
  422. BOOL
  423. UtpInitGenericLog
  424. (
  425. PUCHAR Logfilename
  426. )
  427. /*++
  428. Routine Description:
  429. This routine initializes a generic log (no NTLOG available)
  430. Arguments:
  431. Name of log file to create
  432. Return Value:
  433. TRUE if successful
  434. FALSE if unsuccessful
  435. --*/
  436. #define UtpInitGenericLog_ENTRY 0x00000001
  437. #define UtpInitGenericLog_CREATEFILE 0x00000002
  438. #define UtpInitGenericLog_COMPLETION 0x00000004
  439. {
  440. UCHAR logfilepath [MAX_PATH];
  441. BOOL bstatus = FALSE;
  442. PROGRESS_INIT ("UtpInitGenericLog");
  443. PROGRESS_UPDATE (UtpInitGenericLog_ENTRY);
  444. if (strlen (Logfilename) > MAX_PATH) {
  445. goto exitcleanup;
  446. }
  447. strcpy (logfilepath, Logfilename);
  448. strcat (logfilepath, ".log");
  449. g_log = CreateFile (logfilepath,
  450. GENERIC_READ | GENERIC_WRITE,
  451. 0,
  452. NULL,
  453. CREATE_ALWAYS,
  454. FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH,
  455. NULL);
  456. if (g_log == INVALID_HANDLE_VALUE) {
  457. goto exitcleanup;
  458. }
  459. PROGRESS_UPDATE (UtpInitGenericLog_CREATEFILE);
  460. UtLog (LOG_INFO, "GENERICLOG: %s initialized.", logfilepath);
  461. bstatus = TRUE;
  462. PROGRESS_UPDATE (UtpInitGenericLog_COMPLETION);
  463. exitcleanup:
  464. PROGRESS_END;
  465. return bstatus;
  466. }
  467. BOOL
  468. UtpInitNtLog
  469. (
  470. PUCHAR Logfilename
  471. )
  472. /*++
  473. Routine Description:
  474. This routine initializes an NTLOG log file
  475. Arguments:
  476. Name of log file to create
  477. Return Value:
  478. TRUE if successful
  479. FALSE if unsuccessful
  480. --*/
  481. //
  482. // InitNTLOG progress bits
  483. //
  484. #define UtpInitNtLog_ENTRY 0x00000001
  485. #define UtpInitNtLog_CREATELOG 0x00000002
  486. #define UtpInitNtLog_ADDPARTICIPANT 0x00000004
  487. #define UtpInitNtLog_COMPLETION 0x00000008
  488. {
  489. UCHAR logfilepath [MAX_PATH];
  490. DWORD logstyle;
  491. BOOL bstatus = FALSE;
  492. PROGRESS_INIT ("UtpInitNtLog");
  493. PROGRESS_UPDATE (UtpInitNtLog_ENTRY);
  494. if (strlen (Logfilename) > MAX_PATH) {
  495. goto exitcleanup;
  496. }
  497. strcpy (logfilepath, Logfilename);
  498. strcat (logfilepath, ".log");
  499. logstyle = TLS_LOGALL | TLS_MONITOR | TLS_REFRESH;
  500. g_log = _tlCreateLog(logfilepath, logstyle);
  501. if (g_log == INVALID_HANDLE_VALUE) {
  502. goto exitcleanup;
  503. }
  504. PROGRESS_UPDATE (UtpInitNtLog_CREATELOG);
  505. bstatus = _tlAddParticipant (g_log, 0, 0);
  506. if (bstatus == FALSE) {
  507. goto exitcleanup;
  508. }
  509. PROGRESS_UPDATE (UtpInitNtLog_ADDPARTICIPANT);
  510. UtLog (LOG_INFO, "NTLOG: %s initialized.", logfilepath);
  511. PROGRESS_UPDATE (UtpInitNtLog_COMPLETION);
  512. bstatus = TRUE;
  513. exitcleanup:
  514. //
  515. // Cleanup
  516. //
  517. if (!(PROGRESS_GET & UtpInitNtLog_COMPLETION)) {
  518. if (PROGRESS_GET & UtpInitNtLog_ADDPARTICIPANT) {
  519. _tlRemoveParticipant (g_log);
  520. }
  521. if (PROGRESS_GET & UtpInitNtLog_CREATELOG) {
  522. _tlDestroyLog (g_log);
  523. }
  524. g_log = INVALID_HANDLE_VALUE;
  525. }
  526. if (PROGRESS_GET & UtpInitNtLog_COMPLETION) {
  527. g_usentlog = TRUE;
  528. }
  529. PROGRESS_END;
  530. return bstatus;
  531. }
  532. VOID
  533. UtpCloseGenericLog
  534. (
  535. VOID
  536. )
  537. /*++
  538. Routine Description:
  539. This routine closes a generic logging session.
  540. Arguments:
  541. None
  542. Return Value:
  543. None
  544. --*/
  545. {
  546. if (g_genericresult == TRUE) {
  547. UtLog (LOG_INFO, "** TEST PASSED **");
  548. } else {
  549. UtLog (LOG_INFO, "** TEST FAILED **");
  550. }
  551. FlushFileBuffers (g_log);
  552. CloseHandle (g_log);
  553. }
  554. VOID
  555. UtpCloseNtLog
  556. (
  557. VOID
  558. )
  559. /*++
  560. Routine Description:
  561. This routine closes an NTLOG logging session.
  562. Arguments:
  563. None
  564. Return Value:
  565. None
  566. --*/
  567. //
  568. // CloseNTLOG progress bits
  569. //
  570. #define UtpCloseNtLog_ENTRY 0x00000001
  571. #define UtpCloseNtLog_SUMMARIZE 0x00000002
  572. #define UtpCloseNtLog_REMOVEPARTICIPANT 0x00000004
  573. #define UtpCloseNtLog_DESTROYLOG 0x00000008
  574. #define UtpCloseNtLog_COMPLETION 0x00000010
  575. {
  576. BOOL bstatus = FALSE;
  577. PROGRESS_INIT ("UtpCloseNtLog");
  578. PROGRESS_UPDATE (UtpCloseNtLog_ENTRY);
  579. if (g_log == INVALID_HANDLE_VALUE) {
  580. goto exitcleanup;
  581. }
  582. _tlReportStats (g_log);
  583. PROGRESS_UPDATE (UtpCloseNtLog_SUMMARIZE);
  584. bstatus = _tlRemoveParticipant (g_log);
  585. if (bstatus == FALSE) {
  586. goto exitcleanup;
  587. }
  588. PROGRESS_UPDATE (UtpCloseNtLog_REMOVEPARTICIPANT);
  589. bstatus = _tlDestroyLog (g_log);
  590. if (bstatus == FALSE) {
  591. goto exitcleanup;
  592. }
  593. PROGRESS_UPDATE (UtpCloseNtLog_DESTROYLOG);
  594. PROGRESS_UPDATE (UtpCloseNtLog_COMPLETION);
  595. exitcleanup:
  596. PROGRESS_END;
  597. return;
  598. }
  599. VOID
  600. UtpLogGenericLog
  601. (
  602. LOG_ENTRY_TYPE LogEntryType,
  603. PUCHAR LogText
  604. )
  605. /*++
  606. Routine Description:
  607. This routine enters a log event for a generic log file
  608. Arguments:
  609. LogEntryType - The type of entry to log
  610. LogText - Text describing the logging event
  611. Return Value:
  612. None
  613. --*/
  614. #define UtpLogGenericLog_ENTRY 0x00000001
  615. #define UtpLogGenericLog_LOG 0x00000002
  616. #define UtpLogGenericLog_COMPLETION 0x00000004
  617. {
  618. UCHAR logentrytypetext [LOGENTRYTEXTLENGTH];
  619. DWORD byteswritten = 0;
  620. BOOL bstatus = FALSE;
  621. PROGRESS_INIT ("UtpLogGenericLog");
  622. PROGRESS_UPDATE (UtpLogGenericLog_ENTRY);
  623. ZeroMemory (logentrytypetext, sizeof (logentrytypetext));
  624. //
  625. // Update our generic result - if we see a variation fail, the
  626. // whole test is considered a failure.
  627. //
  628. if (g_genericresult == TRUE) {
  629. g_genericresult = LogEntryType == LOG_FAIL ? FALSE : TRUE;
  630. }
  631. switch (LogEntryType) {
  632. case LOG_PASS:
  633. strcpy (logentrytypetext, LOGENTRYTEXTPASS);
  634. break;
  635. case LOG_FAIL:
  636. strcpy (logentrytypetext, LOGENTRYTEXTFAIL);
  637. break;
  638. case LOG_INFO:
  639. strcpy (logentrytypetext, LOGENTRYTEXTINFO);
  640. break;
  641. default:
  642. break;
  643. }
  644. bstatus = WriteFile (g_log,
  645. logentrytypetext,
  646. sizeof (logentrytypetext),
  647. &byteswritten,
  648. NULL);
  649. bstatus = WriteFile (g_log,
  650. LogText,
  651. strlen (LogText),
  652. &byteswritten,
  653. NULL);
  654. printf("%s%s", logentrytypetext, LogText);
  655. PROGRESS_UPDATE (UtpLogGenericLog_LOG);
  656. PROGRESS_UPDATE (UtpLogGenericLog_COMPLETION);
  657. }
  658. VOID
  659. UtpLogNtLog
  660. (
  661. LOG_ENTRY_TYPE LogEntryType,
  662. PUCHAR LogText
  663. )
  664. /*++
  665. Routine Description:
  666. This routine enters a log event for NTLOG log files
  667. Arguments:
  668. LogEntryType - The type of entry to log
  669. LogText - Text describing the logging event
  670. Return Value:
  671. None
  672. --*/
  673. #define UtpLogNtLog_ENTRY 0x00000001
  674. #define UtpLogNtLog_LOG 0x00000002
  675. #define UtpLogNtLog_COMPLETION 0x00000004
  676. {
  677. DWORD loglevel = 0;
  678. BOOL bstatus = FALSE;
  679. PROGRESS_INIT ("UtpLogNtLog");
  680. PROGRESS_UPDATE (UtpLogNtLog_ENTRY);
  681. loglevel = (LogEntryType == LOG_PASS ? TLS_PASS : 0) |
  682. (LogEntryType == LOG_FAIL ? TLS_SEV1 : 0) |
  683. (LogEntryType == LOG_INFO ? TLS_INFO : 0);
  684. bstatus = _tlLog (g_log, loglevel | TL_VARIATION, LogText);
  685. PROGRESS_UPDATE (UtpLogNtLog_LOG);
  686. PROGRESS_UPDATE (UtpLogNtLog_COMPLETION);
  687. }