_POSTMORTEM DEBUGGING_ by Matt Pietrek [EXAMPLE 1] #include #include #include int MeaningOfLife = 0x42; // A meaningless global, // for DFA demonstration void Foo(void far *ptr) { _fstrlen(ptr); // This call will GP fault } static void Bar(void far *ptr) { void far *b; // Local var for DFA demonstration b = ptr; Foo(b); } int PASCAL WinMain( HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow ) { Bar(MK_FP(1,0)); // pass bad pointer return 0; }