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.

66 lines
1.5 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: mydebug.h
  6. ***************************************************************************/
  7. #ifndef __MYDEBUG_H__
  8. #define __MYDEBUG_H__
  9. #ifdef DEBUG
  10. HGLOBAL
  11. My_GlobalAlloc(
  12. UINT uFlags,
  13. DWORD dwBytes
  14. );
  15. HGLOBAL
  16. My_GlobalFree(
  17. HGLOBAL hMem
  18. );
  19. #else
  20. #define My_GlobalAlloc(_a,_b) GlobalAlloc(_a,_b)
  21. #define My_GlobalFree(_a) GlobalFree(_a)
  22. #endif
  23. #define SIGNATURE(a,b,c,d) (UINT)(a+(b<<8)+(c<<16)+(d<<24))
  24. #ifdef DEBUG
  25. #define SIGN 1
  26. #define ASSERT_NACKMask(_a) \
  27. if(pSend->OpenWindow && ((_a)->NACKMask & (0xFFFFFFFF-((1<<(((_a)->OpenWindow)))-1)) ) ){ \
  28. DPF(0,"pSend %x OpenWindow %d NACKMask %x",pSend,pSend->OpenWindow, pSend->NACKMask);\
  29. DEBUG_BREAK(); \
  30. } else if (!(_a)->OpenWindow && (_a)->NACKMask){ \
  31. DPF(0,"pSend %x OpenWindow %d NACKMask %x",pSend,pSend->OpenWindow, pSend->NACKMask);\
  32. DEBUG_BREAK(); \
  33. }
  34. #else
  35. #define ASSERT_NACKMask(_a)
  36. #endif
  37. #ifdef SIGN
  38. #define SET_SIGN(a,b) ((a)->Signature=(b))
  39. #define UNSIGN(a) ((a)|=0x20202020);
  40. // #define ASSERT_SIGN(a,b) ASSERT((((UINT)(a)->Signature))==((UINT)(b)))
  41. #define ASSERT_SIGN(a,b) if(!((((UINT)(a)->Signature))==((UINT)(b))))DEBUG_BREAK();
  42. #else
  43. #define UNSIGN(a)
  44. #define SET_SIGN(a,b)
  45. #define ASSERT_SIGN(a,b)
  46. #endif
  47. #ifdef DEBUG
  48. #if !defined(ASSERT)
  49. #define ASSERT DDASSERT
  50. #endif
  51. #endif
  52. #endif /* __MYDEBUG_H__ */