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.

129 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000.
  5. //
  6. // File: dbgmod.cxx
  7. //
  8. // Contents: Support for visual debug values
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 12-Mar-93 KevinRo Created
  15. //
  16. // This module handles debug values, such as breakpoints and settable
  17. // values. By using this module, the values can be examined and changed
  18. // in a debugging window. The debugging window uses its own thread, so
  19. // changes can be effected asynchronously.
  20. //
  21. //--------------------------------------------------------------------------
  22. #include <pch.cxx>
  23. #pragma hdrstop
  24. //
  25. // NOTE: This file is surrounded by if CIDBG == 1, which means that these
  26. // routines are in the debugging version ONLY
  27. //
  28. #if CIDBG == 1
  29. #include <dbgpoint.hxx>
  30. //
  31. // The following Mutex provides a lock for registering the InfoLevelGroup
  32. //
  33. //CMutexSem mtxInfoLevelLock;
  34. //+-------------------------------------------------------------------------
  35. //
  36. // Function: dbgGetIniInfoLevels
  37. //
  38. // Synopsis: Called by the CInfoLevel constructor to get the default
  39. // value for an InfoLevel from win.ini
  40. //
  41. // Arguments:
  42. // [pwzName] -- Name of InfoLevel
  43. // [ulDefault] -- Default value if not found in win.ini
  44. //
  45. // Requires:
  46. //
  47. // Returns: Returns the value read from profile, or default if the value
  48. // didn't exist in the correct section.
  49. //
  50. //--------------------------------------------------------------------------
  51. WCHAR *pwzInfoLevelSectionName = L"Cairo InfoLevels";
  52. WCHAR *pwzInfoLevelDefault = L"$";
  53. #define INIT_VALUE_SIZE 16
  54. extern "C"
  55. EXPORTIMP
  56. ULONG APINOT dbgGetIniInfoLevel(WCHAR const *pwzName,ULONG ulDefault)
  57. {
  58. WCHAR awcInitValue[INIT_VALUE_SIZE];
  59. ULONG ulRet;
  60. ulRet = GetProfileString(pwzInfoLevelSectionName,
  61. pwzName,
  62. pwzInfoLevelDefault,
  63. awcInitValue,
  64. INIT_VALUE_SIZE);
  65. if(ulRet == (INIT_VALUE_SIZE - 1))
  66. {
  67. return(ulDefault);
  68. }
  69. if(awcInitValue[0] == L'$')
  70. {
  71. return(ulDefault);
  72. }
  73. if(swscanf(awcInitValue,L"%x",&ulRet) != 1)
  74. {
  75. return(ulDefault);
  76. }
  77. return(ulRet);
  78. }
  79. // stubs
  80. extern "C"
  81. EXPORTIMP
  82. void APINOT dbgRemoveGroup(HANDLE hGroup)
  83. {}
  84. extern "C"
  85. EXPORTIMP
  86. void APINOT dbgRegisterGroup(WCHAR const *pwzName,HANDLE *phGroup)
  87. {}
  88. extern "C"
  89. EXPORTIMP
  90. void APINOT dbgNotifyChange(HANDLE hGroup,CDebugBaseClass *pdv)
  91. {}
  92. extern "C"
  93. EXPORTIMP
  94. void APINOT dbgRegisterValue(WCHAR const *pwzName,
  95. HANDLE hGroup,
  96. CDebugBaseClass *pdv)
  97. {}
  98. extern "C"
  99. EXPORTIMP
  100. void APINOT dbgRemoveValue(HANDLE hGroup,CDebugBaseClass *pdv)
  101. {}
  102. #endif // if CIDBG == 1