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.

63 lines
1.5 KiB

  1. /****************************************************************************
  2. DEBUG.CPP
  3. Owner: cslim
  4. Copyright (c) 1997-1999 Microsoft Corporation
  5. Debug functions
  6. History:
  7. 14-JUL-1999 cslim Copied from IME98 source tree
  8. *****************************************************************************/
  9. #ifdef DEBUG
  10. #include "PreComp.h"
  11. #include "debug.h"
  12. #include "common.h"
  13. // ====-- SHARED SECTION START --====
  14. #pragma data_seg(".DBGSHR")
  15. DWORD vdwDebug = DBGID_OUTCOM; // Default output to COM port
  16. #pragma data_seg()
  17. // ====-- SHARED SECTION END --====
  18. VOID InitDebug(VOID)
  19. {
  20. HKEY hKey;
  21. DWORD size;
  22. BOOL rc = fFalse;
  23. if (RegOpenKeyEx(HKEY_CURRENT_USER, g_szIMERootKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
  24. {
  25. return;
  26. }
  27. size = sizeof(DWORD);
  28. if ( RegQueryValueEx( hKey, TEXT("DebugOption"), NULL, NULL, (LPBYTE)&vdwDebug, &size) == ERROR_SUCCESS)
  29. {
  30. rc = fTrue;
  31. }
  32. RegCloseKey( hKey );
  33. return;
  34. }
  35. #endif // _DEBUG
  36. /*------------------------------------------------------------------------
  37. _purecall
  38. Stub for that super-annoying symbol the compiler generates for pure
  39. virtual functions
  40. Copied from MSO9 Dbgassert.cpp
  41. ---------------------------------------------------------------- RICKP -*/
  42. int __cdecl _purecall(void)
  43. {
  44. #ifdef DEBUG
  45. DbgAssert(0);
  46. OutputDebugStringA("Called pure virtual function");
  47. #endif
  48. return 0;
  49. }