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.

150 lines
3.5 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // core library header files
  4. //
  5. // 30 Nov 1999 sburns
  6. #ifndef BLCORE_HPP_INCLUDED
  7. #define BLCORE_HPP_INCLUDED
  8. #if !defined(__cplusplus)
  9. #error This module must be compiled as C++
  10. #endif
  11. #if !defined(UNICODE)
  12. #error This module must be compiled UNICODE. (add -DUNICODE to C_DEFINES in sources file)
  13. #endif
  14. // Include system headers before the burnslib headers. This is necessary
  15. // because the burnslib headers redefine things like operator new, which may
  16. // appear in system headers. We don't want to change the behavior of code
  17. // outside this library (and users of this library).
  18. #ifdef BURNSLIB_HPP_INCLUDED
  19. // This file is being included as part of burnslib.hpp, so include the
  20. // full set of system headers
  21. #include "sysfull.hpp"
  22. #else
  23. #include "syscore.hpp"
  24. #endif
  25. #include "PragmaWarning.hpp"
  26. // include Assert.hpp after syscore.hpp, as it redefines ASSERT()
  27. #include "Assert.hpp"
  28. namespace Burnslib
  29. {
  30. // For an explanation of the initialization guard thing, see Meyers,
  31. // Scott. "Effective C++ pp. 178-182 Addison-Wesley 1992. Basically, it
  32. // guarantees that this library is properly initialized before any code
  33. // that uses it is called.
  34. class InitializationGuard
  35. {
  36. public:
  37. InitializationGuard();
  38. ~InitializationGuard();
  39. private:
  40. static unsigned counter;
  41. // not defined
  42. InitializationGuard(const InitializationGuard&);
  43. const InitializationGuard& operator=(const InitializationGuard&);
  44. };
  45. }
  46. //lint -e(1502) ok that InitializationGuard has no members: we use it for
  47. // the side effects of static initialization calling the ctor
  48. static Burnslib::InitializationGuard guard;
  49. // we put mem.hpp at the top of our header list, as it redefines new. If
  50. // any project header includes code that calls new, that code will see the
  51. // redefinition. For the same reason, we #include mem.hpp after all the
  52. // system headers, as we are uninterested in calls to new that they might
  53. // make.
  54. #include "mem.hpp"
  55. #include "string.hpp"
  56. #include "stacktr.hpp"
  57. #include "log.hpp"
  58. #include "smartptr.hpp"
  59. #include "comstuff.hpp"
  60. #include "coreutil.hpp"
  61. #include "coreres.h"
  62. using namespace Burnslib;
  63. // this is defined in init.cpp
  64. extern const wchar_t* REG_ADMIN_RUNTIME_OPTIONS;
  65. //
  66. // Things you must define in your code:
  67. //
  68. // CODEWORK Putting these externs in a namespace seems to confuse the
  69. // linker.
  70. // namespace Burnslib
  71. // {
  72. // your DllMain or WinMain must set this to the HINSTANCE of the module
  73. // containing all string and other resources. Without this, no function that
  74. // loads a resource will operate correctly.
  75. extern HINSTANCE hResourceModuleHandle;
  76. // The name of the log file where LOG output is sent. This file is
  77. // placed in the %systemroot%\debug directory. The extension will be ".log"
  78. extern const wchar_t* RUNTIME_NAME;
  79. // The default debugging control options to be used, unless overriden in the
  80. // registry DWORD value LogFlags under the key
  81. // HKLM\Software\Microsoft\Windows\CurrentVersion\AdminDebug\\ + RUNTIME_NAME.
  82. // The LOWORD is a set of flag specifing output destinations, the HIWORD is
  83. // the debugging output options in effect.
  84. extern DWORD DEFAULT_LOGGING_OPTIONS;
  85. // }; // namespace Burnslib
  86. #endif // BLCORE_HPP_INCLUDED