home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (C) 1997-1998, Tall Tree Software Co.
- *
- * This code is provided AS-IS, with no warranty expressed or implied.
- * in no way shall Tall Tree Software Co. be held liable for damages
- * brought about by the use of this software.
- */
-
- #ifndef HookTestDebug_h
-
- #ifdef _DEBUG
- static void StopForDebug()
- {
- static bool alreadyStopped = false;
- static HMODULE main = 0;
- if ( main == 0 && !alreadyStopped ) {
- main = GetModuleHandle( 0 );
- FARPROC f = GetProcAddress( main, "DebugModeOn" );
- if ( f != 0 ) {
- if ( (*(bool (*)())f)() ) {
- alreadyStopped = true;
- _asm { int 3 }
- // You can step past that statement
- // now that you're in the debugger.
- }
- }
- }
- }
- #else
- #define StopForDebug()
- #endif
-
- #endif
-