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.

99 lines
1.9 KiB

  1. /*-----------------------------------------------------------------------------
  2. * Copyright (C) Microsoft Corporation, 1995 - 1996.
  3. * All rights reserved.
  4. *
  5. * Snipped from SChannel sources
  6. *
  7. * 1/23/96
  8. *----------------------------------------------------------------------------*/
  9. #ifndef __DEBUG_H__
  10. #define __DEBUG_H__
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define SECSTOR_INVALID_MAGIC *(DWORD *)"eerF"
  15. /* Event Logging Definitions */
  16. #define SS_LOG_ERROR 0x0001
  17. #define SS_LOG_WARNING 0x0002
  18. #define SS_LOG_TRACE 0x0004
  19. #define SS_LOG_ALLOC 0x0008
  20. #define SS_LOG_RES 0x0010
  21. // assert
  22. #if DBG
  23. void SSAssert(
  24. void *FailedAssertion,
  25. void *FileName,
  26. unsigned long LineNumber,
  27. char * Message);
  28. #define SS_ASSERT(x) \
  29. if (!(x)) \
  30. SSAssert(#x, __FILE__, __LINE__, NULL); else
  31. #else // DBG
  32. #define SS_ASSERT(x)
  33. #endif // DBG
  34. // verify
  35. #if DBG
  36. #define SS_VERIFY(x) SS_ASSERT(x)
  37. #else // DBG
  38. #define SS_VERIFY(x) (x)
  39. #endif // DBG
  40. // alloc/free
  41. #if DBG
  42. VOID *SSAlloc(DWORD cb);
  43. VOID *SSReAlloc(VOID *pv, DWORD cb);
  44. VOID SSFree(VOID *pv);
  45. SIZE_T SSSize(VOID *pv);
  46. #else // DBG
  47. #define SSAlloc(cb) LocalAlloc(LMEM_FIXED, cb)
  48. #define SSReAlloc(pv, cb) LocalReAlloc(pv, cb, LMEM_MOVEABLE) // allow ReAlloc to move
  49. #define SSFree(pv) LocalFree(pv)
  50. #define SSSize(pv) LocalSize(pv)
  51. #endif // DBG
  52. // Error logging routines
  53. #if DBG
  54. long
  55. SSPrintErrorCode(
  56. long err,
  57. const char *szFile,
  58. long lLine);
  59. #else // DBG
  60. #define SSPrintErrorCode(err, szFile, lLine)
  61. #endif // DBG
  62. #undef RtlMoveMemory
  63. NTSYSAPI
  64. VOID
  65. NTAPI
  66. RtlMoveMemory (
  67. VOID UNALIGNED *Destination,
  68. CONST VOID UNALIGNED *Source,
  69. SIZE_T Length
  70. );
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif /* __DEBUG_H__ */