--- q_a/samples/ntsd/debug.c 2018/08/09 18:29:19 1.1 +++ q_a/samples/ntsd/debug.c 2018/08/09 18:30:02 1.1.1.3 @@ -20,15 +20,37 @@ * (#includes) * \**************************************************************************/ +#include +#include + #include #include #include + #include -#include -#include + +typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; + #include #include "mditypes.h" +// +// don't use try/except here. Otherwise, mip2coff -c chokes with the +// following fatal error on MIPS: +// tried to get local variable absolute addr with no procedure +// +// NTSD will catch the fault anyway +// +// Alternatively, we can get rid of the -c switch on mip2coff in the +// module that use try/except, but we won't have any locals for the module +// +// 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);\ @@ -38,14 +60,14 @@ try {\ /******************************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: @@ -53,7 +75,7 @@ try {\ * Wrote it. \**************************************************************************/ -INT APIENTRY 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); @@ -100,9 +122,6 @@ void dinfo ( EvalExpression = lpExtensionApis->lpGetExpressionRoutine; GetSymbol = lpExtensionApis->lpGetSymbolRoutine; - while (*lpArgumentString == ' ') - lpArgumentString++; - pInfo = (PINFO)EvalExpression(lpArgumentString); move(info, pInfo); Print(info.CaptionBarText);