Source code of Windows XP (NT5)
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.

188 lines
3.7 KiB

  1. #ifndef _EXVECTOR_
  2. #define _EXVECTOR_
  3. #define NDIS_WIN 1
  4. #define EXPORT
  5. /* NOINC */
  6. #ifndef _STDCALL
  7. #define _STDCALL 1
  8. #endif
  9. #ifdef _STDCALL
  10. #define _API __stdcall
  11. #else
  12. #define _API
  13. #endif
  14. //
  15. // Segment definition macros. These assume the segment groupings used by
  16. // Chicago/MS-DOS 7.
  17. //
  18. #define _LCODE code_seg("_LTEXT", "LCODE")
  19. #define _LDATA data_seg("_LDATA", "LCODE")
  20. #ifdef DEBUG
  21. #define _PCODE NDIS_LCODE
  22. #define _PDATA NDIS_LDATA
  23. #else
  24. #define _PCODE code_seg("_PTEXT", "PCODE")
  25. #define _PDATA data_seg("_PDATA", "PCODE")
  26. #endif
  27. #define _ICODE NDIS_PCODE
  28. #define _IDATA NDIS_PDATA
  29. #ifndef _SEG_MACROS
  30. #define ICODE NDIS_ICODE
  31. #define IDATA NDIS_IDATA
  32. #define PCODE NDIS_PCODE
  33. #define PDATA NDIS_PDATA
  34. #define LCODE NDIS_LCODE
  35. #define LDATA NDIS_LDATA
  36. #endif
  37. #define _INIT_FUNCTION(f) alloc_text(_ITEXT,f)
  38. #define _PAGEABLE_FUNCTION(f) alloc_text(_PTEXT,f)
  39. #define _LOCKED_FUNCTION(f) alloc_text(_LTEXT,f)
  40. /* INC */
  41. #define _MAJOR_VERSION 0x01
  42. #define _MINOR_VERSION 0x00
  43. /* NOINC */
  44. /* INC */
  45. /* ASM
  46. ;===========================================================================
  47. ; Segment definition macros. These assume the segment groupings used by
  48. ; Chicago/MS-DOS 7.
  49. ;
  50. ;===========================================================================
  51. LCODE_SEG TEXTEQU <VXD_LOCKED_CODE_SEG>
  52. LCODE_ENDS TEXTEQU <VXD_LOCKED_CODE_ENDS>
  53. LDATA_SEG TEXTEQU <VXD_LOCKED_DATA_SEG>
  54. LDATA_ENDS TEXTEQU <VXD_LOCKED_DATA_ENDS>
  55. IFDEF DEBUG
  56. PCODE_SEG TEXTEQU <LCODE_SEG>
  57. PCODE_ENDS TEXTEQU <LCODE_ENDS>
  58. PDATA_SEG TEXTEQU <LDATA_SEG>
  59. PDATA_ENDS TEXTEQU <LDATA_ENDS>
  60. ELSE
  61. PCODE_SEG TEXTEQU <VXD_PAGEABLE_CODE_SEG>
  62. PCODE_ENDS TEXTEQU <VXD_PAGEABLE_CODE_ENDS>
  63. PDATA_SEG TEXTEQU <VXD_PAGEABLE_DATA_SEG>
  64. PDATA_ENDS TEXTEQU <VXD_PAGEABLE_DATA_ENDS>
  65. ENDIF
  66. ICODE_SEG TEXTEQU <PCODE_SEG>
  67. ICODE_ENDS TEXTEQU <PCODE_ENDS>
  68. IDATA_SEG TEXTEQU <PDATA_SEG>
  69. IDATA_ENDS TEXTEQU <PDATA_ENDS>
  70. */
  71. #ifndef i386
  72. #define i386
  73. #endif
  74. /* NOINC */
  75. #ifdef DEBUG
  76. #define DEVL 1
  77. #endif
  78. /* INC */
  79. #ifndef TRUE
  80. #define TRUE 1
  81. #define FALSE 0
  82. #endif
  83. /* NOINC */
  84. #include <basedef.h>
  85. #define ASSERT(a) if (!(a)) DbgBreakPoint()
  86. #ifdef DEBUG
  87. #define DbgBreakPoint() __asm { \
  88. __asm int 3 \
  89. }
  90. void __cdecl DbgPrint();
  91. #define DBG_PRINTF(A) DbgPrint A
  92. #else
  93. #define DbgBreakPoint()
  94. #define DBG_PRINTF(A)
  95. #endif
  96. //
  97. // Macros required by DOS to compensate for differences with NT.
  98. //
  99. #define IN
  100. #define OUT
  101. #define OPTIONAL
  102. #define INTERNAL
  103. #define UNALIGNED
  104. typedef INT NDIS_SPIN_LOCK, * PNDIS_SPIN_LOCK;
  105. typedef UCHAR BOOLEAN, *PBOOLEAN;
  106. typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
  107. typedef signed short WCH, *PWCH;
  108. typedef char CCHAR, *PCCHAR;
  109. typedef PVOID NDIS_HANDLE, *PNDIS_HANDLE;
  110. typedef DWORD DEVNODE;
  111. typedef ULONG _STATUS;
  112. typedef _STATUS *_PSTATUS;
  113. // BUGBUG for compatibility with NT, ask them to remove it from
  114. // Their drivers
  115. typedef _STATUS NTSTATUS;
  116. typedef CCHAR KIRQL;
  117. typedef KIRQL *PKIRQL;
  118. #define HIGH_LEVEL 31
  119. #define PDRIVER_OBJECT PVOID
  120. #define PUNICODE_STRING PVOID
  121. #define PDEVICE_OBJECT PVOID
  122. #define PKDPC PVOID
  123. #define STATUS_SUCCESS 0
  124. #define STATUS_UNSUCCESSFUL 0xC0000001
  125. #define INSTALL_RING_3_HANDLER 0x42424242
  126. #define SET_CONTEXT 0xc3c3c3cc
  127. BOOL
  128. VXDINLINE
  129. VWIN32_IsClientWin32( VOID )
  130. {
  131. VxDCall( _VWIN32_IsClientWin32 );
  132. }
  133. PVOID
  134. VXDINLINE
  135. VWIN32_GetCurrentProcessHandle( VOID )
  136. {
  137. VxDCall( VWIN32_GetCurrentProcessHandle );
  138. }
  139. PVOID
  140. VXDINLINE
  141. VWIN32_Set_Thread_Context(PVOID pR0ThreadHandle,
  142. PCONTEXT pContext)
  143. {
  144. VxDCall( _VWIN32_Set_Thread_Context );
  145. }
  146. #endif // _EXVECTOR_