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.

138 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. util.h
  5. Abstract:
  6. Definitions of Utility routines
  7. Author:
  8. Cliff Van Dyke (cliffv) 11-Apr-2001
  9. --*/
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. //
  15. // Global definitions
  16. //
  17. /////////////////////////////////////////////////////////////////////////////
  18. extern LIST_ENTRY AzGlAllocatedBlocks;
  19. extern SAFE_CRITICAL_SECTION AzGlAllocatorCritSect;
  20. extern GUID AzGlZeroGuid;
  21. /////////////////////////////////////////////////////////////////////////////
  22. //
  23. // Procedure definitions
  24. //
  25. /////////////////////////////////////////////////////////////////////////////
  26. PVOID
  27. AzpAllocateHeap(
  28. IN SIZE_T Size,
  29. IN LPSTR pDescr OPTIONAL
  30. );
  31. VOID
  32. AzpFreeHeap(
  33. IN PVOID Buffer
  34. );
  35. DWORD
  36. AzpHresultToWinStatus(
  37. HRESULT hr
  38. );
  39. DWORD
  40. AzpConvertSelfRelativeToAbsoluteSD(
  41. IN PSECURITY_DESCRIPTOR pSelfRelativeSd,
  42. OUT PSECURITY_DESCRIPTOR *ppAbsoluteSd,
  43. OUT PACL *ppDacl,
  44. OUT PACL *ppSacl
  45. );
  46. /////////////////////////////////////////////////////////////////////////////
  47. //
  48. // Debugging Support
  49. //
  50. /////////////////////////////////////////////////////////////////////////////
  51. #if DBG
  52. #define AZROLESDBG 1
  53. #endif // DBG
  54. #ifdef AZROLESDBG
  55. #define AzPrint(_x_) AzpPrintRoutine _x_
  56. VOID
  57. AzpPrintRoutine(
  58. IN DWORD DebugFlag,
  59. IN LPSTR FORMATSTRING, // PRINTF()-STYLE FORMAT STRING.
  60. ... // OTHER ARGUMENTS ARE POSSIBLE.
  61. );
  62. VOID
  63. AzpDumpGuid(
  64. IN DWORD DebugFlag,
  65. IN GUID *Guid
  66. );
  67. //
  68. // Values of DebugFlag
  69. // The values of this flag are organized into bytes:
  70. // The least significant byte are flags that one always wants on
  71. // The next byte are flags that provider a reasonable level of verbosity
  72. // The next byte are flags that correspond to levels from the 2nd byte but are more verbose
  73. // The most significant byte are flags that are generally very verbose
  74. //
  75. #define AZD_CRITICAL 0x00000001 // Debug most common errors
  76. #define AZD_INVPARM 0x00000002 // Invalid Parameter
  77. #define AZD_PERSIST 0x00000100 // Persistence code
  78. #define AZD_ACCESS 0x00000200 // Debug access check
  79. #define AZD_SCRIPT 0x00000400 // Debug bizrule scripts
  80. #define AZD_DISPATCH 0x00000800 // Debug IDispatch interface code
  81. #define AZD_XML 0x00001000 // xml store
  82. #define AZD_PERSIST_MORE 0x00010000 // Persistence code (verbose mode)
  83. #define AZD_ACCESS_MORE 0x00020000 // Debug access check (verbose mode)
  84. #define AZD_SCRIPT_MORE 0x00040000 // Debug bizrule scripts (verbose mode)
  85. #define AZD_HANDLE 0x01000000 // Debug handle open/close
  86. #define AZD_OBJLIST 0x02000000 // Object list linking
  87. #define AZD_REF 0x04000000 // Debug object ref count
  88. #define AZD_DOMREF 0x08000000 // Debug domain ref count
  89. #define AZD_ALL 0xFFFFFFFF
  90. //
  91. // Globals
  92. //
  93. extern SAFE_CRITICAL_SECTION AzGlLogFileCritSect;
  94. extern ULONG AzGlDbFlag;
  95. #else
  96. // Non debug version
  97. #define AzPrint(_x_)
  98. #define AzpDumpGuid(_x_, _y_)
  99. #define AzpDumpGoRef(_x_, _y_)
  100. #endif
  101. #ifdef __cplusplus
  102. }
  103. #endif