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.

55 lines
1.3 KiB

  1. #define UTEST (1)
  2. #include <nt.h>
  3. #include <ntrtl.h>
  4. #include <nturtl.h>
  5. #include <windows.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #if defined (UTEST)
  10. typedef struct _KDEVICE_QUEUE_ENTRY {
  11. LIST_ENTRY DeviceListEntry;
  12. ULONG SortKey;
  13. BOOLEAN Inserted;
  14. } KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY;
  15. #define KSPIN_LOCK CRITICAL_SECTION
  16. #define KLOCK_QUEUE_HANDLE PCRITICAL_SECTION
  17. #define PKLOCK_QUEUE_HANDLE PCRITICAL_SECTION*
  18. #define KeInitializeSpinLock InitializeCriticalSection
  19. #define KeAcquireInStackQueuedSpinLockAtDpcLevel(Lock, Handle)\
  20. do { \
  21. *Handle = Lock; \
  22. EnterCriticalSection(Lock); \
  23. } while (0)
  24. #define KeReleaseInStackQueuedSpinLockFromDpcLevel(Handle)\
  25. LeaveCriticalSection(*Handle)
  26. #define INLINE __inline
  27. #define REVIEW()\
  28. do { \
  29. OutputDebugString ("Math needs to review this\n"); \
  30. DebugBreak(); \
  31. } while (0)
  32. #endif
  33. #undef ASSERT
  34. #define ASSERT(exp)\
  35. if (!(exp)) { \
  36. static BOOL Ignore = FALSE; \
  37. printf ("ASSERT failed, \"%s\" %s %d\n", \
  38. #exp, \
  39. __FILE__, \
  40. __LINE__); \
  41. \
  42. if (!Ignore) { \
  43. DebugBreak(); \
  44. } \
  45. }