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.

585 lines
18 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999-2002 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dndbg.c
  6. * Content: debug support for DirectPlay8
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 05-20-99 aarono Created
  12. * 07-16-99 johnkan Fixed include of OSInd.h, defined WSPRINTF macro
  13. * 07-19-99 vanceo Explicitly declared OutStr as returning void for NT
  14. * Build environment.
  15. * 07-22-99 a-evsch Check for multiple Inits, and release CritSec when DebugPrintf
  16. * returns early.
  17. * 08-02-99 a-evsch Added LOGPF support. LW entries only go into shared-file log
  18. * 08-31-99 johnkan Removed include of <OSIND.H>
  19. * 02-17-00 rodtoll Added Memory / String validation routines
  20. * 05-23-00 RichGr IA64: Changed some DWORDs to DWORD_PTRs to make va_arg work OK.
  21. * 07-16-00 jchauvin IA64: Added %p parsing to change back to %x for Win9x machines in DebugPrintf, DebugPrintfNoLock, LogPrintf
  22. * 07-24-00 RichGr IA64: As there's no separate build for Win9x, added code to detect Win9x for the %p parse-and-replace.
  23. * 07-29-00 masonb Rewrite to add logging by subcomponent, perf improvements, process ID
  24. * 08/28/2000 masonb Voice Merge: Modified asm in DebugPrintf to preserve registers that may have affected Voice
  25. * 03/29/2001 RichGr If DPINST is defined for Performance Instrumentation, allow free build to pick up the code.
  26. *
  27. * Notes:
  28. *
  29. * Use /Oi compiler option for strlen()
  30. *
  31. ***************************************************************************/
  32. #include "dncmni.h"
  33. #include "memlog.h"
  34. #if defined(DBG) || defined(DPINST)
  35. void DebugPrintfInit(void);
  36. void DebugPrintfFini(void);
  37. // The constructor of this will be called prior to DllMain and the destructor
  38. // after DllMain, so we can be assured of having the logging code properly
  39. // initialized and deinitialized for the life of the module.
  40. struct _InitDbg
  41. {
  42. _InitDbg() { DebugPrintfInit(); }
  43. ~_InitDbg() { DebugPrintfFini(); }
  44. } DbgInited;
  45. //===============
  46. // Debug support
  47. //===============
  48. /*******************************************************************************
  49. This file contains support for the following types of logging:
  50. 1. Logging to a VXD (Win9x only)
  51. 2. Logging to a shared memory region
  52. 3. Logging to the Debug Output
  53. 4. Logging to a message box
  54. 5. FUTURE: Logging to a file
  55. General:
  56. ========
  57. Debug Logging and playback is designed to operate on both Win9x and
  58. Windows NT (Windows 2000). A shared file is used to capture information
  59. and can be played back using dp8log.exe.
  60. Under NT you can use the 'dt' command of NTSD to dump structures. For
  61. example:
  62. dt DIRECTPLAYOBJECT <some memory address>
  63. will show all of the members of the DIRECTPLAYOBJECT structure at the
  64. specified address. Some features are available only in post-Win2k
  65. versions of NTSD which can be obtained at http://dbg.
  66. Logging:
  67. ========
  68. Debug Logging is controlled by settings in the WIN.INI file, under
  69. the section heading [DirectPlay8]. There are several settings:
  70. debug=9
  71. controls the default debug level. All messages, at or below that debug level
  72. are printed. You can control logging by each component specified in the
  73. g_rgszSubCompName member by adding its name to the end of the 'debug' setting:
  74. debug.addr=9
  75. sets the logging level for the addressing subcomponent to 9, leaving all
  76. others at either their specified level or the level specified by 'debug'
  77. if there is no specific level specified.
  78. The second setting controls where the log is seen. If not specified, all
  79. debug logs are sent through the standard DebugPrint and will appear in a
  80. debugger if it is attached.
  81. log=0 {no debug output}
  82. log=1 {spew to console only}
  83. log=2 {spew to shared memory log only}
  84. log=3 {spew to console and shared memory log}
  85. log=4 {spew to message box}
  86. This setting can also be divided by subcomponent, so:
  87. log=3
  88. log.protocol=2
  89. sends logs for the 'protocol' subcomponent to the shared memory log only, and
  90. all other logs to both locations.
  91. example win.ini...
  92. [DirectPlay8]
  93. Debug=7 ; lots of spew
  94. log=2 ; don't spew to debug window
  95. [DirectPlay8]
  96. Debug=0 ; only fatal errors spewed to debug window
  97. Asserts:
  98. ========
  99. Asserts are used to validate assumptions in the code. For example
  100. if you know that the variable jojo should be > 700 and are depending
  101. on it in subsequent code, you SHOULD put an assert before the code
  102. that acts on that assumption. The assert would look like:
  103. DNASSERT(jojo>700);
  104. Asserts generally will produce 3 lines of debug spew to highlight the
  105. breaking of the assumption. You can add text to your asserts by ANDing:
  106. DNASSERT(jojo>700 && "Jojo was too low");
  107. Will show the specified text when the assert occurs. For testing, you might
  108. want to set the system to break in on asserts. This is done in the
  109. [DirectPlay8] section of WIN.INI by setting BreakOnAssert=TRUE:
  110. [DirectPlay8]
  111. Debug=0
  112. BreakOnAssert=1
  113. Verbose=1
  114. The Verbose setting enables logging of file, function, and line information.
  115. Debug Breaks:
  116. =============
  117. When something really severe happens and you want the system to break in
  118. so that you can debug it later, you should put a debug break in the code
  119. path. Some people use the philosophy that all code paths must be
  120. verified by hand tracing each one in the debugger. If you abide by this
  121. you should place a DEBUG_BREAK() in every code path and remove them
  122. from the source as you trace each. When you have good coverage but
  123. some unhit paths (error conditions) you should force those paths in
  124. the debugger.
  125. Debug Logging to Shared Memory Region:
  126. ======================================
  127. All processes will share the same memory region, and will log the specified amount
  128. of activity. The log can be viewed with the DPLOG.EXE utility.
  129. Debug Logging to Debug Output:
  130. ==============================
  131. This option uses OutputDebugString to log the specified amount of activity.
  132. Debug Logging to Message Box:
  133. ==============================
  134. This option uses MessageBox to log the specified amount of activity.
  135. ==============================================================================*/
  136. #undef DPF_SUBCOMP
  137. #define DPF_SUBCOMP DN_SUBCOMP_COMMON
  138. #define ASSERT_BUFFER_SIZE 8192
  139. #define ASSERT_BANNER_STRING "************************************************************"
  140. #define ASSERT_MESSAGE_LEVEL 0
  141. #define PROF_SECT _T("DirectPlay8")
  142. DWORD g_dwMemLogNumEntries = DPLOG_DEFAULT_ENTRIES; // Default Num entries for MEM log, settable in win.ini
  143. DWORD g_dwMemLogLineSize = DPLOG_MAX_STRING; // Default number of bytes per log entry
  144. //
  145. // Globals for shared memory based logging
  146. //
  147. #ifndef DPNBUILD_SINGLEPROCESS
  148. HANDLE g_hMemLogFile = 0; // NOTE: This is 0 because CreateFileMapping returns 0 on failure
  149. HANDLE g_hMemLogMutex = 0; // NOTE: This is 0 because CreateMutex returns 0 on failure
  150. #endif // ! DPNBUILD_SINGLEPROCESS
  151. PSHARED_LOG_FILE g_pMemLog = 0;
  152. BOOL g_fMemLogInited = FALSE;
  153. #ifndef DPNBUILD_SINGLEPROCESS
  154. DWORD g_fAssertGrabMutex = FALSE;
  155. #endif // ! DPNBUILD_SINGLEPROCESS
  156. // Values for g_rgDestination
  157. #define LOG_TO_DEBUG 1
  158. #define LOG_TO_MEM 2
  159. #define LOG_TO_MSGBOX 4
  160. LPTSTR g_rgszSubCompName[] =
  161. {
  162. _T("UNK"), // DN_SUBCOMP_GLOBAL 0
  163. _T("CORE"), // DN_SUBCOMP_CORE 1
  164. _T("ADDR"), // DN_SUBCOMP_ADDR 2
  165. _T("LOBBY"), // DN_SUBCOMP_LOBBY 3
  166. _T("PROTOCOL"), // DN_SUBCOMP_PROTOCOL 4
  167. _T("VOICE"), // DN_SUBCOMP_VOICE 5
  168. _T("DPNSVR"), // DN_SUBCOMP_DPNSVR 6
  169. _T("WSOCK"), // DN_SUBCOMP_WSOCK 7
  170. _T("MODEM"), // DN_SUBCOMP_MODEM 8
  171. _T("COMMON"), // DN_SUBCOMP_COMMON 9
  172. _T("NATHELP"), // DN_SUBCOMP_NATHELP 10
  173. _T("TOOLS"), // DN_SUBCOMP_TOOLS 11
  174. _T("THREADPOOL"), // DN_SUBCOMP_THREADPOOL 12
  175. _T("BLUETOOTH"), // DN_SUBCOMP_BLUETOOTH 13
  176. _T("MAX"), // DN_SUBCOMP_MAX 14 // NOTE: this should never get used, but
  177. // is needed due to the way DebugPrintfInit
  178. // is written, since it reads one past the end.
  179. };
  180. #define MAX_SUBCOMPS (sizeof(g_rgszSubCompName)/sizeof(g_rgszSubCompName[0]) - 1)
  181. UINT g_rgLevel[MAX_SUBCOMPS] = {0};
  182. UINT g_rgDestination[MAX_SUBCOMPS] = {LOG_TO_DEBUG | LOG_TO_MEM};
  183. UINT g_rgBreakOnAssert[MAX_SUBCOMPS] = {1};// if non-zero, causes DEBUG_BREAK on false asserts.
  184. // if TRUE, file/line/module information is printed and logged.
  185. DWORD g_fLogFileAndLine = FALSE;
  186. // Create a shared file for logging information on the fly
  187. // This support allows the current log to be dumped from the
  188. // user mode DP8LOG.EXE application. This is useful when debugging
  189. // in MSSTUDIO or in NTSD. When DP8LOG.EXE is invoked, note that
  190. // the application will get halted until the log is completely dumped
  191. // so it is best to dump the log to a file.
  192. #undef DPF_MODNAME
  193. #define DPF_MODNAME "InitMemLogString"
  194. static BOOL InitMemLogString(VOID)
  195. {
  196. if(!g_fMemLogInited)
  197. {
  198. BOOL fInitLogFile = TRUE;
  199. #ifdef DPNBUILD_SINGLEPROCESS
  200. g_pMemLog = (PSHARED_LOG_FILE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (DPLOG_HEADERSIZE + (DPLOG_ENTRYSIZE*g_dwMemLogNumEntries)));
  201. if (!g_pMemLog)
  202. {
  203. return FALSE;
  204. }
  205. #else // ! DPNBUILD_SINGLEPROCESS
  206. g_hMemLogFile = CreateFileMapping(INVALID_HANDLE_VALUE, DNGetNullDacl(), PAGE_READWRITE, 0, (DPLOG_HEADERSIZE + (DPLOG_ENTRYSIZE*g_dwMemLogNumEntries)), GLOBALIZE_STR _T(BASE_LOG_MEMFILENAME));
  207. if (!g_hMemLogFile)
  208. {
  209. return FALSE;
  210. }
  211. if (GetLastError() == ERROR_ALREADY_EXISTS)
  212. {
  213. fInitLogFile = FALSE;
  214. }
  215. g_hMemLogMutex = CreateMutex(DNGetNullDacl(), FALSE, GLOBALIZE_STR _T(BASE_LOG_MUTEXNAME));
  216. if (!g_hMemLogMutex)
  217. {
  218. CloseHandle(g_hMemLogFile);
  219. g_hMemLogFile = 0;
  220. return FALSE;
  221. }
  222. g_pMemLog = (PSHARED_LOG_FILE)MapViewOfFile(g_hMemLogFile, FILE_MAP_ALL_ACCESS,0,0,0);
  223. if (!g_pMemLog)
  224. {
  225. CloseHandle(g_hMemLogMutex);
  226. g_hMemLogMutex = 0;
  227. CloseHandle(g_hMemLogFile);
  228. g_hMemLogFile = 0;
  229. return FALSE;
  230. }
  231. #endif // ! DPNBUILD_SINGLEPROCESS
  232. // NOTE: The above 3 functions do return NULL in the case of a failure,
  233. // not INVALID_HANDLE_VALUE
  234. if (fInitLogFile)
  235. {
  236. g_pMemLog->nEntries = g_dwMemLogNumEntries;
  237. g_pMemLog->cbLine = g_dwMemLogLineSize;
  238. g_pMemLog->iWrite = 0;
  239. }
  240. else
  241. {
  242. // This happens when someone before us has already created the mem log. Could be a previous DPlay instance or TestNet.
  243. g_dwMemLogNumEntries = g_pMemLog->nEntries;
  244. g_dwMemLogLineSize = g_pMemLog->cbLine;
  245. }
  246. if (g_dwMemLogNumEntries && g_dwMemLogLineSize)
  247. {
  248. g_fMemLogInited = TRUE;
  249. }
  250. }
  251. return g_fMemLogInited;
  252. }
  253. // Log a string to a shared file. This file can be dumped using the
  254. // DPLOG.EXE utility.
  255. //
  256. // dwLength is in bytes and does not include the '\0'
  257. //
  258. void MemLogString(LPCTSTR str, size_t dwLength)
  259. {
  260. PMEMLOG_ENTRY pEntry;
  261. size_t cbCopy;
  262. // If this isn't inited, InitMemLogString failed earlier
  263. if(!g_fMemLogInited)
  264. {
  265. return;
  266. }
  267. #ifndef DPNBUILD_SINGLEPROCESS
  268. WaitForSingleObject(g_hMemLogMutex, INFINITE);
  269. #endif // ! DPNBUILD_SINGLEPROCESS
  270. pEntry = (PMEMLOG_ENTRY)(((PUCHAR)(g_pMemLog + 1)) + (g_pMemLog->iWrite * (sizeof(MEMLOG_ENTRY) + g_dwMemLogLineSize)));
  271. g_pMemLog->iWrite = (g_pMemLog->iWrite + 1) % g_dwMemLogNumEntries;
  272. #ifndef DPNBUILD_SINGLEPROCESS
  273. ReleaseMutex(g_hMemLogMutex);
  274. #endif // ! DPNBUILD_SINGLEPROCESS
  275. pEntry->tLogged = GETTIMESTAMP();
  276. cbCopy = dwLength + sizeof(TCHAR); // Add the terminating NULL
  277. if(cbCopy > g_dwMemLogLineSize)
  278. {
  279. cbCopy = g_dwMemLogLineSize;
  280. }
  281. memcpy(pEntry->str, str, cbCopy);
  282. pEntry->str[(cbCopy / sizeof(TCHAR)) - 2] = _T('\n'); // Ensure we always end with a return
  283. pEntry->str[(cbCopy / sizeof(TCHAR)) - 1] = _T('\0'); // Ensure we always NULL terminate
  284. }
  285. // DebugPrintfInit() - initialize DPF support.
  286. void DebugPrintfInit()
  287. {
  288. BOOL fUsingMemLog = FALSE;
  289. TCHAR szLevel[32] = {0};
  290. _tcscpy(szLevel, _T("debug"));
  291. TCHAR szDest[32] = {0};
  292. _tcscpy(szDest, _T("log"));
  293. TCHAR szBreak[32] = {0};
  294. _tcscpy(szBreak, _T("breakonassert"));
  295. // Loop through all the subcomps, and get the level and destination for each
  296. for (int iSubComp = 0; iSubComp < MAX_SUBCOMPS; iSubComp++)
  297. {
  298. // NOTE: The setting under "debug" sets the default and will be used if you
  299. // don't specify settings for each subcomp
  300. g_rgLevel[iSubComp] = DNGetProfileInt(PROF_SECT, szLevel, g_rgLevel[0]);
  301. g_rgDestination[iSubComp] = DNGetProfileInt(PROF_SECT, szDest, g_rgDestination[0]);
  302. g_rgBreakOnAssert[iSubComp] = DNGetProfileInt( PROF_SECT, szBreak, g_rgBreakOnAssert[0]);
  303. if (g_rgDestination[iSubComp] & LOG_TO_MEM)
  304. {
  305. fUsingMemLog = TRUE;
  306. }
  307. // Set up for the next subcomp
  308. _tcscpy(szLevel + 5, _T(".")); // 5 is strlen of "debug", we are building debug.addr, etc.
  309. _tcscpy(szLevel + 6, g_rgszSubCompName[iSubComp + 1]);
  310. _tcscpy(szDest + 3, _T(".")); // 3 is strlen of "log", we are building log.addr, etc.
  311. _tcscpy(szDest + 4, g_rgszSubCompName[iSubComp + 1]);
  312. _tcscpy(szBreak + 13, _T(".")); // 13 is strlen of "breakonassert", we are building breakonassert.addr, etc.
  313. _tcscpy(szBreak + 14, g_rgszSubCompName[iSubComp + 1]);
  314. }
  315. g_dwMemLogNumEntries = DNGetProfileInt( PROF_SECT, _T("MemLogEntries"), DPLOG_DEFAULT_ENTRIES);
  316. g_fLogFileAndLine = DNGetProfileInt( PROF_SECT, _T("Verbose"), 0);
  317. #ifndef DPNBUILD_SINGLEPROCESS
  318. g_fAssertGrabMutex = DNGetProfileInt( PROF_SECT, _T("AssertGrabMutex"), 0);
  319. #endif // ! DPNBUILD_SINGLEPROCESS
  320. if (fUsingMemLog)
  321. {
  322. // Open the shared log file
  323. InitMemLogString();
  324. }
  325. }
  326. // DebugPrintfFini() - release resources used by DPF support.
  327. void DebugPrintfFini()
  328. {
  329. if(g_pMemLog)
  330. {
  331. #ifdef DPNBUILD_SINGLEPROCESS
  332. HeapFree(GetProcessHeap(), 0, g_pMemLog);
  333. #else // ! DPNBUILD_SINGLEPROCESS
  334. UnmapViewOfFile(g_pMemLog);
  335. #endif // ! DPNBUILD_SINGLEPROCESS
  336. g_pMemLog = NULL;
  337. }
  338. #ifndef DPNBUILD_SINGLEPROCESS
  339. if(g_hMemLogMutex)
  340. {
  341. CloseHandle(g_hMemLogMutex);
  342. g_hMemLogMutex = 0;
  343. }
  344. if(g_hMemLogFile)
  345. {
  346. CloseHandle(g_hMemLogFile);
  347. g_hMemLogFile = 0;
  348. }
  349. #endif // ! DPNBUILD_SINGLEPROCESS
  350. g_fMemLogInited = FALSE;
  351. }
  352. void DebugPrintfX(LPCTSTR szFile, DWORD dwLine, LPCTSTR szModName, DWORD dwSubComp, DWORD dwDetail, ...)
  353. {
  354. DNASSERT(dwSubComp < MAX_SUBCOMPS);
  355. if(g_rgLevel[dwSubComp] < dwDetail)
  356. {
  357. return;
  358. }
  359. TCHAR cMsg[ ASSERT_BUFFER_SIZE ];
  360. va_list argptr;
  361. LPTSTR pszCursor = cMsg;
  362. va_start(argptr, dwDetail);
  363. #ifdef UNICODE
  364. WCHAR szFormat[ASSERT_BUFFER_SIZE];
  365. LPSTR szaFormat;
  366. szaFormat = (LPSTR) va_arg(argptr, DWORD_PTR);
  367. STR_jkAnsiToWide(szFormat, szaFormat, ASSERT_BUFFER_SIZE);
  368. #else
  369. LPSTR szFormat;
  370. szFormat = (LPSTR) va_arg(argptr, DWORD_PTR);
  371. #endif // UNICODE
  372. cMsg[0] = 0;
  373. #ifdef WIN95
  374. TCHAR *psz = NULL;
  375. CHAR cTemp[ ASSERT_BUFFER_SIZE ];
  376. strcpy(cTemp, szFormat); // Copy to a local string that we can modify.
  377. szFormat = cTemp; // Point szFormat at the local string
  378. while (psz = strstr(szFormat, "%p")) // Look for each "%p".
  379. *(psz+1) = 'x'; // Substitute 'x' for 'p'. Don't try to expand
  380. #endif // WIN95
  381. // Prints out / logs as:
  382. // 1. Verbose
  383. // subcomp:dwDetail:ProcessId:ThreadId:File:Function:Line:DebugString
  384. // e.g.
  385. // ADDR:2:0450:0378:(c:\somefile.cpp)BuildURLA(L25)Can you believe it?
  386. //
  387. // 2. Regular
  388. // subcomp:dwDetail:ProcessId:ThreadId:Function:DebugString
  389. #ifndef DPNBUILD_SINGLEPROCESS
  390. pszCursor += wsprintf(pszCursor,_T("%s:%1d:%04x:%04x:"),g_rgszSubCompName[dwSubComp],dwDetail,GetCurrentProcessId(),GetCurrentThreadId());
  391. #else
  392. pszCursor += wsprintf(pszCursor,_T("%s:%1d:%04x:"),g_rgszSubCompName[dwSubComp],dwDetail,GetCurrentThreadId());
  393. #endif // ! DPNBUILD_SINGLEPROCESS
  394. if (g_fLogFileAndLine)
  395. {
  396. LPCTSTR c;
  397. int i = _tcslen(szFile);
  398. if (i < 25)
  399. {
  400. c = szFile;
  401. }
  402. else
  403. {
  404. c = szFile + i - 25;
  405. }
  406. pszCursor += wsprintf(pszCursor, _T("(%s)(L%d)"), c, dwLine);
  407. }
  408. pszCursor += wsprintf(pszCursor, _T("%s: "), szModName);
  409. pszCursor += wvsprintf(pszCursor, szFormat, argptr);
  410. _tcscpy(pszCursor, _T("\n"));
  411. pszCursor += _tcslen(pszCursor);
  412. if(g_rgDestination[dwSubComp] & LOG_TO_DEBUG)
  413. {
  414. // log to debugger output
  415. OutputDebugString(cMsg);
  416. }
  417. if(g_rgDestination[dwSubComp] & LOG_TO_MEM)
  418. {
  419. // log to shared file, pass length not including '\0'
  420. MemLogString(cMsg, ((PBYTE)pszCursor - (PBYTE)cMsg));
  421. }
  422. #ifndef _XBOX
  423. if(g_rgDestination[dwSubComp] & LOG_TO_MSGBOX)
  424. {
  425. // log to Message Box
  426. MessageBox(NULL, cMsg, _T("DirectPlay Log"), MB_OK);
  427. }
  428. #endif // ! _XBOX
  429. va_end(argptr);
  430. return;
  431. }
  432. //
  433. // NOTE: I don't want to get into error checking for buffer overflows when
  434. // trying to issue an assertion failure message. So instead I just allocate
  435. // a buffer that is "bug enough" (I know, I know...)
  436. //
  437. void _DNAssert( LPCTSTR szFile, DWORD dwLine, LPCTSTR szFnName, DWORD dwSubComp, LPCTSTR szCondition, DWORD dwLevel )
  438. {
  439. TCHAR buffer[ASSERT_BUFFER_SIZE];
  440. // For level 1 we always print the message to the log, but we may not actually break. For other levels
  441. // we either print and break or do neither.
  442. if (dwLevel <= g_rgBreakOnAssert[dwSubComp] || dwLevel == 1)
  443. {
  444. // Build the debug stream message
  445. wsprintf( buffer, _T("ASSERTION FAILED! File: %s Line: %d: %s"), szFile, dwLine, szCondition);
  446. // Actually issue the message. These messages are considered error level
  447. // so they all go out at error level priority.
  448. DebugPrintfX(szFile, dwLine, szFnName, dwSubComp, ASSERT_MESSAGE_LEVEL, ASSERT_BANNER_STRING );
  449. DebugPrintfX(szFile, dwLine, szFnName, dwSubComp, ASSERT_MESSAGE_LEVEL, "%s", buffer );
  450. DebugPrintfX(szFile, dwLine, szFnName, dwSubComp, ASSERT_MESSAGE_LEVEL, ASSERT_BANNER_STRING );
  451. // Should we drop into the debugger?
  452. if(g_rgBreakOnAssert[dwSubComp])
  453. {
  454. #ifndef DPNBUILD_SINGLEPROCESS
  455. // Don't let dpnsvr keep writing to the log
  456. if (g_hMemLogMutex && g_fAssertGrabMutex)
  457. {
  458. WaitForSingleObject(g_hMemLogMutex, INFINITE);
  459. }
  460. #endif // ! DPNBUILD_SINGLEPROCESS
  461. // Into the debugger we go...
  462. DEBUG_BREAK();
  463. #ifndef DPNBUILD_SINGLEPROCESS
  464. if (g_hMemLogMutex && g_fAssertGrabMutex)
  465. {
  466. ReleaseMutex(g_hMemLogMutex);
  467. }
  468. #endif // ! DPNBUILD_SINGLEPROCESS
  469. }
  470. }
  471. }
  472. #endif // DBG