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.

108 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1989 - 1999 Microsoft Corporation
  3. Module Name:
  4. minip.h
  5. Abstract:
  6. Macros and definitions private to the null mini driver.
  7. Notes:
  8. This module has been built and tested only in UNICODE environment
  9. --*/
  10. #ifndef _NULLMINIP_H_
  11. #define _NULLMINIP_H_
  12. NTHALAPI
  13. VOID
  14. KeStallExecutionProcessor (
  15. IN ULONG MicroSeconds
  16. );
  17. #ifndef min
  18. #define min(a, b) ((a) > (b) ? (b) : (a))
  19. #endif
  20. #if DBG
  21. #ifdef SUPPRESS_WRAPPER_TRACE
  22. #define RxTraceEnter(func) \
  23. PCHAR __pszFunction = func; \
  24. BOOLEAN fEnable = FALSE; \
  25. if( RxNextGlobalTraceSuppress ) { \
  26. RxNextGlobalTraceSuppress = RxGlobalTraceSuppress = FALSE; \
  27. fEnable = TRUE; \
  28. } \
  29. RxDbgTrace(0,Dbg,("Entering %s\n",__pszFunction));
  30. #define RxTraceLeave(status) \
  31. if( fEnable ) { \
  32. RxNextGlobalTraceSuppress = RxGlobalTraceSuppress = TRUE; \
  33. } \
  34. RxDbgTrace(0,Dbg,("Leaving %s Status -> %08lx\n",__pszFunction,status));
  35. #else
  36. #define RxTraceEnter(func) \
  37. PCHAR __pszFunction = func; \
  38. RxDbgTrace(0,Dbg,("Entering %s\n",__pszFunction));
  39. #define RxTraceLeave(status) \
  40. RxDbgTrace(0,Dbg,("Leaving %s Status -> %08lx\n",__pszFunction,status));
  41. #endif
  42. #else
  43. #define RxTraceEnter(func)
  44. #define RxTraceLeave(status)
  45. #endif
  46. #define RX_VERIFY( f ) if( (f) ) ; else ASSERT( 1==0 )
  47. //
  48. // Set or Validate equal
  49. //
  50. #define SetOrValidate(x,y,f) \
  51. if( f ) (x) = (y); else ASSERT( (x) == (y) )
  52. //
  53. // RXCONTEXT data - mini-rdr context stored for async completions
  54. // NOTE: sizeof this struct should be == MRX_CONTEXT_SIZE !!
  55. //
  56. typedef struct _NULMRX_COMPLETION_CONTEXT {
  57. //
  58. // IoStatus.Information
  59. //
  60. ULONG Information;
  61. //
  62. // IoStatus.Status
  63. //
  64. NTSTATUS Status;
  65. //
  66. // Outstanding I/Os
  67. //
  68. ULONG OutstandingIOs;
  69. //
  70. // I/O type
  71. //
  72. ULONG IoType;
  73. } NULMRX_COMPLETION_CONTEXT, *PNULMRX_COMPLETION_CONTEXT;
  74. #define IO_TYPE_SYNCHRONOUS 0x00000001
  75. #define IO_TYPE_ASYNC 0x00000010
  76. #define NulMRxGetMinirdrContext(pRxContext) \
  77. ((PNULMRX_COMPLETION_CONTEXT)(&(pRxContext)->MRxContext[0]))
  78. #endif // _NULLMINIP_H_