--- q_a/samples/ntsd/debug.c 2018/08/09 18:29:36 1.1.1.2 +++ q_a/samples/ntsd/debug.c 2018/08/09 18:30:02 1.1.1.3 @@ -46,22 +46,28 @@ typedef LARGE_INTEGER PHYSICAL_ADDRESS, // // Petrus Wong 05-Oct-1992 // +// We use mcl now which eliminates the need for mip2coff so we can use +// try/except again +// +// Petrus Wong 10-Feb-1993 +// #define move(dst, src)\ -{\ +try {\ ReadProcessMemory(hCurrentProcess, (LPVOID)(src), &(dst), sizeof(dst), NULL);\ +} except (EXCEPTION_EXECUTE_HANDLER) {\ return;\ } /******************************Public*Routine******************************\ * -* LibMain +* DllMain * -* Effects: LibMain is called by Windows when +* Effects: DllMain is called by Windows when * the DLL is initialized, Thread Attached, and other times. * -* Warnings: The LibMain function should perform additional initialization +* Warnings: The DllMain function should perform additional initialization * tasks required by the DLL. In this example, no initialization -* tasks are required. LibMain should return a value of 1 if +* tasks are required. DllMain should return a value of 1 if * the initialization is successful. * * History: @@ -69,7 +75,7 @@ typedef LARGE_INTEGER PHYSICAL_ADDRESS, * Wrote it. \**************************************************************************/ -INT WINAPI LibMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReserved) +BOOL WINAPI DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReserved) { return 1; UNREFERENCED_PARAMETER(hInst); @@ -116,9 +122,6 @@ void dinfo ( EvalExpression = lpExtensionApis->lpGetExpressionRoutine; GetSymbol = lpExtensionApis->lpGetSymbolRoutine; - while (*lpArgumentString == ' ') - lpArgumentString++; - pInfo = (PINFO)EvalExpression(lpArgumentString); move(info, pInfo); Print(info.CaptionBarText);