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.

353 lines
8.0 KiB

  1. /*++
  2. Copyright (c) 1992-1999 Microsoft Corporation
  3. Module Name:
  4. VDDSVC.H
  5. Abstract:
  6. Include file contains VDM services provided for installable VDDs.
  7. --*/
  8. /**
  9. * This file contains VDM services prototype defintions only; their
  10. * related structures and macros are defined in NT_VDD.H.
  11. * If we have not included the file yet, include it and set a signal
  12. * to tell anybody the fact.
  13. **/
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifndef _NT_VDD
  18. #include "nt_vdd.h"
  19. #define _NT_VDD
  20. #endif
  21. /** Memory Accessing services **/
  22. #define GetVDMAddress(usSeg, usOff) (((ULONG)usSeg << 4) + (ULONG)usOff)
  23. #define GetVDMPointer(Address, Size, Mode) Sim32GetVDMPointer(\
  24. Address, Size, Mode)
  25. #define FlushVDMPointer(Address, Size, Buffer, Mode) Sim32FlushVDMPointer(\
  26. Address, Size, Buffer, Mode)
  27. #define FreeVDMPointer(Address, Size, Buffer, Mode) Sim32FreeVDMPointer(\
  28. Address, Size, Buffer, Mode)
  29. /** interrupt simualtion services **/
  30. #define ICA_MASTER 0
  31. #define ICA_SLAVE 1
  32. #define VDDSimulateInterrupt(ms, line, count) (call_ica_hw_interrupt)(\
  33. ms, line, 1)
  34. /** Register manipulation services **/
  35. #ifndef i386
  36. #define getEAX() (ULONG)c_getAX()
  37. #define getAX() c_getAX()
  38. #define getAL() c_getAL()
  39. #define getAH() c_getAH()
  40. #define getEBX() (ULONG)c_getBX()
  41. #define getBX() c_getBX()
  42. #define getBL() c_getBL()
  43. #define getBH() c_getBH()
  44. #define getECX() (ULONG)c_getCX()
  45. #define getCX() c_getCX()
  46. #define getCL() c_getCL()
  47. #define getCH() c_getCH()
  48. #define getEDX() (ULONG)c_getDX()
  49. #define getDX() c_getDX()
  50. #define getDL() c_getDL()
  51. #define getDH() c_getDH()
  52. #define getESP() (ULONG)c_getSP()
  53. #define getSP() c_getSP()
  54. #define getEBP() (ULONG)c_getBP()
  55. #define getBP() c_getBP()
  56. #define getESI() (ULONG)c_getSI()
  57. #define getSI() c_getSI()
  58. #define getEDI() (ULONG)c_getDI()
  59. #define getDI() c_getDI()
  60. #define getEIP() (ULONG)c_getIP()
  61. #define getIP() c_getIP()
  62. #define getCS() c_getCS()
  63. #define getSS() c_getSS()
  64. #define getDS() c_getDS()
  65. #define getES() c_getES()
  66. #define getCF() c_getCF()
  67. #define getPF() c_getPF()
  68. #define getAF() c_getAF()
  69. #define getZF() c_getZF()
  70. #define getSF() c_getSF()
  71. #define getIF() c_getIF()
  72. #define getDF() c_getDF()
  73. #define getOF() c_getOF()
  74. #define getMSW() c_getMSW()
  75. #define setEAX(value) c_setAX((WORD)value)
  76. #define setAX(value) c_setAX(value)
  77. #define setAH(value) c_setAH(value)
  78. #define setAL(value) c_setAL(value)
  79. #define setEBX(value) c_setBX((WORD)value)
  80. #define setBX(value) c_setBX(value)
  81. #define setBH(value) c_setBH(value)
  82. #define setBL(value) c_setBL(value)
  83. #define setECX(value) c_setCX((WORD)value)
  84. #define setCX(value) c_setCX(value)
  85. #define setCH(value) c_setCH(value)
  86. #define setCL(value) c_setCL(value)
  87. #define setEDX(value) c_setDX((WORD)value)
  88. #define setDX(value) c_setDX(value)
  89. #define setDH(value) c_setDH(value)
  90. #define setDL(value) c_setDL(value)
  91. #define setESP(value) c_setSP((WORD)value)
  92. #define setSP(value) c_setSP(value)
  93. #define setEBP(value) c_setBP((WORD)value)
  94. #define setBP(value) c_setBP(value)
  95. #define setESI(value) c_setSI((WORD)value)
  96. #define setSI(value) c_setSI(value)
  97. #define setEDI(value) c_setDI((WORD)value)
  98. #define setDI(value) c_setDI(value)
  99. #define setEIP(value) c_setIP((WORD)value)
  100. #define setIP(value) c_setIP(value)
  101. #define setCS(value) c_setCS(value)
  102. #define setSS(value) c_setSS(value)
  103. #define setDS(value) c_setDS(value)
  104. #define setES(value) c_setES(value)
  105. #define setCF(value) c_setCF(value)
  106. #define setPF(value) c_setPF(value)
  107. #define setAF(value) c_setAF(value)
  108. #define setZF(value) c_setZF(value)
  109. #define setSF(value) c_setSF(value)
  110. #define setIF(value) c_setIF(value)
  111. #define setDF(value) c_setDF(value)
  112. #define setOF(value) c_setOF(value)
  113. #define setMSW(value) c_setMSW(value)
  114. #endif
  115. /** Real function prototype declarations **/
  116. /** interrupt simulation functions **/
  117. VOID
  118. call_ica_hw_interrupt (
  119. int ms,
  120. BYTE line,
  121. int count
  122. );
  123. #define Sim32FreeVDMPointer(address, size, buffer, mode) TRUE
  124. /** memory address manipulation functions **/
  125. #ifdef i386
  126. #define Sim32GetVDMPointer(address, size, mode) MGetVdmPointer(address,\
  127. size, mode)
  128. #define Sim32FlushVDMPointer(addess, size, buffer, mode) TRUE
  129. PBYTE
  130. MGetVdmPointer(
  131. ULONG Address,
  132. ULONG Size,
  133. UCHAR ProtectedMode
  134. );
  135. #else
  136. PBYTE
  137. Sim32GetVDMPointer(
  138. ULONG Address,
  139. ULONG Size,
  140. UCHAR ProtectedMode
  141. );
  142. BOOLEAN
  143. Sim32FlushVDMPointer(
  144. ULONG Address,
  145. USHORT Size,
  146. PBYTE Buffer,
  147. BOOLEAN ProtectedMode
  148. );
  149. #endif
  150. /** Register manipulation functions **/
  151. #ifdef i386
  152. ULONG getEAX(VOID);
  153. USHORT getAX(VOID);
  154. UCHAR getAL(VOID);
  155. UCHAR getAH(VOID);
  156. ULONG getEBX(VOID);
  157. USHORT getBX(VOID);
  158. UCHAR getBL(VOID);
  159. UCHAR getBH(VOID);
  160. ULONG getECX(VOID);
  161. USHORT getCX(VOID);
  162. UCHAR getCL(VOID);
  163. UCHAR getCH(VOID);
  164. ULONG getEDX(VOID);
  165. USHORT getDX(VOID);
  166. UCHAR getDL(VOID);
  167. UCHAR getDH(VOID);
  168. ULONG getESP(VOID);
  169. USHORT getSP(VOID);
  170. ULONG getEBP(VOID);
  171. USHORT getBP(VOID);
  172. ULONG getESI(VOID);
  173. USHORT getSI(VOID);
  174. ULONG getEDI(VOID);
  175. USHORT getDI(VOID);
  176. ULONG getEIP(VOID);
  177. USHORT getIP(VOID);
  178. USHORT getCS(VOID);
  179. USHORT getSS(VOID);
  180. USHORT getDS(VOID);
  181. USHORT getES(VOID);
  182. USHORT getFS(VOID);
  183. USHORT getGS(VOID);
  184. ULONG getCF(VOID);
  185. ULONG getPF(VOID);
  186. ULONG getAF(VOID);
  187. ULONG getZF(VOID);
  188. ULONG getSF(VOID);
  189. ULONG getIF(VOID);
  190. ULONG getDF(VOID);
  191. ULONG getOF(VOID);
  192. USHORT getMSW(VOID);
  193. VOID setEAX(ULONG);
  194. VOID setAX(USHORT);
  195. VOID setAH(UCHAR);
  196. VOID setAL(UCHAR);
  197. VOID setEBX(ULONG);
  198. VOID setBX(USHORT);
  199. VOID setBH(UCHAR);
  200. VOID setBL(UCHAR);
  201. VOID setECX(ULONG);
  202. VOID setCX(USHORT);
  203. VOID setCH(UCHAR);
  204. VOID setCL(UCHAR);
  205. VOID setEDX(ULONG);
  206. VOID setDX(USHORT);
  207. VOID setDH(UCHAR);
  208. VOID setDL(UCHAR);
  209. VOID setESP(ULONG);
  210. VOID setSP(USHORT);
  211. VOID setEBP(ULONG);
  212. VOID setBP(USHORT);
  213. VOID setESI(ULONG);
  214. VOID setSI(USHORT);
  215. VOID setEDI(ULONG);
  216. VOID setDI(USHORT);
  217. VOID setEIP(ULONG);
  218. VOID setIP(USHORT);
  219. VOID setCS(USHORT);
  220. VOID setSS(USHORT);
  221. VOID setDS(USHORT);
  222. VOID setES(USHORT);
  223. VOID setFS(USHORT);
  224. VOID setGS(USHORT);
  225. VOID setCF(ULONG);
  226. VOID setPF(ULONG);
  227. VOID setAF(ULONG);
  228. VOID setZF(ULONG);
  229. VOID setSF(ULONG);
  230. VOID setIF(ULONG);
  231. VOID setDF(ULONG);
  232. VOID setOF(ULONG);
  233. VOID setMSW(USHORT);
  234. #else
  235. UCHAR c_getAL(VOID);
  236. UCHAR c_getCL(VOID);
  237. UCHAR c_getDL(VOID);
  238. UCHAR c_getBL(VOID);
  239. UCHAR c_getAH(VOID);
  240. UCHAR c_getCH(VOID);
  241. UCHAR c_getDH(VOID);
  242. UCHAR c_getBH(VOID);
  243. USHORT c_getAX(VOID);
  244. USHORT c_getCX(VOID);
  245. USHORT c_getDX(VOID);
  246. USHORT c_getBX(VOID);
  247. USHORT c_getSP(VOID);
  248. USHORT c_getBP(VOID);
  249. USHORT c_getSI(VOID);
  250. USHORT c_getDI(VOID);
  251. USHORT c_getIP(VOID);
  252. USHORT c_getES(VOID);
  253. USHORT c_getCS(VOID);
  254. USHORT c_getSS(VOID);
  255. USHORT c_getDS(VOID);
  256. USHORT c_getMSW(VOID);
  257. ULONG c_getAF(VOID);
  258. ULONG c_getCF(VOID);
  259. ULONG c_getDF(VOID);
  260. ULONG c_getIF(VOID);
  261. ULONG c_getOF(VOID);
  262. ULONG c_getPF(VOID);
  263. ULONG c_getSF(VOID);
  264. ULONG c_getZF(VOID);
  265. VOID c_setAL(UCHAR val);
  266. VOID c_setCL(UCHAR val);
  267. VOID c_setDL(UCHAR val);
  268. VOID c_setBL(UCHAR val);
  269. VOID c_setAH(UCHAR val);
  270. VOID c_setCH(UCHAR val);
  271. VOID c_setDH(UCHAR val);
  272. VOID c_setBH(UCHAR val);
  273. VOID c_setAX(USHORT val);
  274. VOID c_setCX(USHORT val);
  275. VOID c_setDX(USHORT val);
  276. VOID c_setBX(USHORT val);
  277. VOID c_setSP(USHORT val);
  278. VOID c_setBP(USHORT val);
  279. VOID c_setSI(USHORT val);
  280. VOID c_setDI(USHORT val);
  281. VOID c_setIP(USHORT val);
  282. VOID c_setES(USHORT val);
  283. VOID c_setCS(USHORT val);
  284. VOID c_setSS(USHORT val);
  285. VOID c_setDS(USHORT val);
  286. VOID c_setMSW(USHORT val);
  287. VOID c_setAF(ULONG val);
  288. VOID c_setCF(ULONG val);
  289. VOID c_setDF(ULONG val);
  290. VOID c_setIF(ULONG val);
  291. VOID c_setOF(ULONG val);
  292. VOID c_setPF(ULONG val);
  293. VOID c_setSF(ULONG val);
  294. VOID c_setZF(ULONG val);
  295. #endif
  296. /* end of VDDSVC.H */