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.

40 lines
1.2 KiB

  1. /* Routines for debugging and error messages. */
  2. #ifdef VxD
  3. #define AssertFn IFSMgr_AssertFailed
  4. #define PrintFn IFSMgr_Printf
  5. #else
  6. #define AssertFn AssertFn
  7. #define PrintFn PrintFn
  8. #endif
  9. #ifdef DEBUG
  10. #define AssertData static char szFileAssert[] = __FILE__;
  11. #define AssertError static char szError[] = "Error";
  12. #define Assert(f) do {if (!(f)) AssertFn(szError, szFileAssert, __LINE__);} while(0)
  13. #define AssertSz(f, sz) do {if (!(f)) AssertFn(sz, szFileAssert, __LINE__);} while(0)
  14. //BUGBUG this way of handling dbgprint is not very good....it can cause side effects in some cases.
  15. //also, it doesn't work at all for NT. the whole of the sources should be munged-->KdPrint
  16. //also, this is just cookie cutter code......since it's in the vxd directory it's unlikely to be called
  17. //without defined(VxD)
  18. #define DbgPrint PrintFn
  19. #else
  20. #define Assert(f)
  21. #define AssertData
  22. #define AssertError
  23. #define AssertSz(f, sz)
  24. //BUGBUG see above
  25. #define DbgPrint
  26. #endif
  27. #ifdef Vxd
  28. void IFSMgr_AssertFailed(PCHAR pMsg, PCHAR pFile, ULONG uLine);
  29. void IFSMgr_Printf(PCHAR pFmt, ...);
  30. #else
  31. VOID AssertFn(PCHAR pMsg, PCHAR pFile, ULONG uLine);
  32. VOID PrintFn(PCHAR pFmt, ...);
  33. #endif
  34.