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.

185 lines
4.8 KiB

  1. /********************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. drvdefs.h
  5. Abstract:
  6. header file containing pieces of code from msinfo codebase
  7. Revision History:
  8. Brijesh Krishnaswami (brijeshk) 05/25/99
  9. - created
  10. ********************************************************************/
  11. #ifndef _DRV16_H
  12. #define _DRV16_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. // defines and structs for getting User Mode drivers
  17. #define GND_FORWARD 0
  18. #define GND_FIRSTINSTANCEONLY 1
  19. #define GND_REVERSE 2
  20. #define IOCTL_CONNECT 1
  21. #define IOCTL_DISCONNECT 2
  22. #define IOCTL_GETINFO 3
  23. #define IOCTL_GETVXDLIST 4
  24. #define IOCTL_MAPFLAT 5
  25. #define LAR_PAGEGRAN 0x00800000 /* Is page granular */
  26. #define LAR_32BIT 0x00400000 /* Is 32-bit */
  27. #define LAR_PRESENT 0x00008000 /* Is present */
  28. #define LAR_APPL 0x00004000 /* Is normal (not a task gate) ;Internal */
  29. #define LAR_TYPEMASK 0x00000E00 /* Selector type mask */
  30. #define LAR_CODE 0x00000800 /* Is a code selector */
  31. #define LAR_EXPANDDOWN 0x00000400 /* Is expand-down (data) */
  32. #define LAR_READ 0x00000200 /* Is readable (code) */
  33. #define LAR_WRITE 0x00000200 /* Is writeable (data) */
  34. #define LAR_INVALID 0xff0000ff /* Invalid (bottom bit important) */
  35. // general util macros
  36. #define cA(a) (sizeof(a)/sizeof(a[0]))
  37. #define OBJAT(T, pv) (*(T *)(pv))
  38. #define PUN(T, v) OBJAT(T, &(v))
  39. #define pvAddPvCb(pv, cb) ((PVOID)((PBYTE)pv + (cb)))
  40. typedef WORD HMODULE16;
  41. typedef struct DRIVERINFOSTRUCT16 {
  42. WORD length;
  43. WORD hDriver;
  44. WORD hModule;
  45. char szAliasName[128];
  46. } DRIVERINFOSTRUCT16;
  47. // defines and structs used for getting MSDos drivers
  48. #define DIFL_PSP 0x0001 /* It's a PSP */
  49. #define DIFL_TSR 0x0002 /* It's a TSR (or might be) */
  50. #define DIFL_DRV 0x0004 /* It's a device driver */
  51. #pragma pack(1)
  52. typedef struct ARENA { /* DOS arena header */
  53. BYTE bType;
  54. WORD segOwner;
  55. WORD csegSize;
  56. BYTE rgbPad[3];
  57. char rgchOwner[8];
  58. } ARENA, *PARENA;
  59. typedef struct VXDOUT {
  60. DWORD dwHighLinear;
  61. PVOID pvVmmDdb;
  62. } VXDOUT, *PVXDOUT;
  63. typedef struct VXDINFO {
  64. HWND hwnd;
  65. FARPROC lpfnGetCurrentTibFS;
  66. FARPROC lpfnGetCurrentProcessId;
  67. FARPROC lpfnGetCurrentThreadId;
  68. FARPROC GetCommandLineA;
  69. FARPROC UnhandledExceptionFilter;
  70. } VXDINFO;
  71. typedef struct RMIREGS {
  72. union {
  73. struct { /* DWORD registers */
  74. DWORD edi;
  75. DWORD esi;
  76. DWORD ebp;
  77. DWORD res1;
  78. DWORD ebx;
  79. DWORD edx;
  80. DWORD ecx;
  81. DWORD eax;
  82. };
  83. struct { /* WORD registers */
  84. WORD di;
  85. WORD res2;
  86. WORD si;
  87. WORD res3;
  88. WORD bp;
  89. WORD res4;
  90. DWORD res5;
  91. WORD bx;
  92. WORD res6;
  93. WORD dx;
  94. WORD res7;
  95. WORD cx;
  96. WORD res8;
  97. WORD ax;
  98. WORD res9;
  99. };
  100. struct { /* BYTE registers */
  101. DWORD res10[4]; /* edi, esi, ebp, esp */
  102. BYTE bl;
  103. BYTE bh;
  104. WORD res11;
  105. BYTE dl;
  106. BYTE dh;
  107. WORD res12;
  108. BYTE cl;
  109. BYTE ch;
  110. WORD res13;
  111. BYTE al;
  112. BYTE ah;
  113. WORD res14;
  114. };
  115. };
  116. WORD flags;
  117. WORD es;
  118. WORD ds;
  119. WORD fs;
  120. WORD gs;
  121. WORD ip;
  122. WORD cs;
  123. WORD sp;
  124. WORD ss;
  125. } RMIREGS, *PRMIREGS;
  126. #pragma pack()
  127. // 16-bit function prototypes
  128. LPVOID WINAPI MapLS(LPVOID);
  129. void WINAPI UnMapLS(LPVOID);
  130. LPVOID NTAPI MapSL(LPVOID);
  131. void NTAPI UnMapSLFix(LPVOID pv);
  132. HMODULE16 NTAPI GetModuleHandle16(LPCSTR);
  133. int NTAPI GetModuleFileName16(HMODULE16 hmod, LPSTR sz, int cch);
  134. int NTAPI GetModuleName16(HMODULE16 hmod, LPSTR sz, int cch);
  135. WORD NTAPI GetExpWinVer16(HMODULE16 hmod);
  136. BOOL GetDriverInfo16(WORD hDriver, DRIVERINFOSTRUCT16* pdis);
  137. WORD GetNextDriver16(WORD hDriver, DWORD fdwFlag);
  138. UINT AllocCodeSelector16(void);
  139. UINT SetSelectorBase16(UINT sel, DWORD dwBase);
  140. DWORD GetSelectorLimit16(UINT sel);
  141. UINT SetSelectorLimit16(UINT sel, DWORD dwLimit);
  142. UINT FreeSelector16(UINT sel);
  143. UINT NTAPI FreeLibrary16(HINSTANCE);
  144. void _cdecl QT_Thunk(void);
  145. HINSTANCE WINAPI LoadLibrary16(LPCSTR);
  146. FARPROC WINAPI GetProcAddress16(HINSTANCE, LPCSTR);
  147. void WINAPI GetpWin16Lock(LPVOID *);
  148. void ThunkInit(void);
  149. UINT Int86x(UINT, PRMIREGS);
  150. LPTSTR Token_Find(LPTSTR *);
  151. #ifdef __cplusplus
  152. }
  153. #endif
  154. #endif