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.

298 lines
5.2 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // dbgkdapi.h
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997-2001.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef _DBGKDAPI_H_
  9. #define _DBGKDAPI_H_
  10. extern BOOL DbgKdApi64;
  11. extern ULONG g_KdMaxPacketType;
  12. extern ULONG g_KdMaxStateChange;
  13. extern ULONG g_KdMaxManipulate;
  14. NTSTATUS
  15. DbgKdCrash(
  16. DWORD BugCheckCode
  17. );
  18. NTSTATUS
  19. DbgKdWaitStateChange(
  20. OUT PDBGKD_ANY_WAIT_STATE_CHANGE StateChange,
  21. OUT PVOID Buffer,
  22. IN ULONG BufferLength,
  23. IN BOOL SuspendEngine
  24. );
  25. NTSTATUS
  26. DbgKdSetSpecialCalls (
  27. IN ULONG NumSpecialCalls,
  28. IN PULONG64 Calls
  29. );
  30. NTSTATUS
  31. DbgKdReadVirtualMemoryNow(
  32. IN ULONG64 TargetBaseAddress,
  33. OUT PVOID UserInterfaceBuffer,
  34. IN ULONG TransferCount,
  35. OUT PULONG ActualBytesRead
  36. );
  37. NTSTATUS
  38. NTAPI
  39. DbgKdWriteVirtualMemoryNow(
  40. IN ULONG64 TargetBaseAddress,
  41. OUT PVOID UserInterfaceBuffer,
  42. IN ULONG TransferCount,
  43. OUT PULONG ActualBytesWritten OPTIONAL
  44. );
  45. NTSTATUS
  46. DbgKdReadVirtualTranslatedMemory(
  47. IN ULONG64 TargetBaseAddress,
  48. OUT PVOID UserInterfaceBuffer,
  49. IN ULONG TransferCount,
  50. OUT PULONG ActualBytesRead
  51. );
  52. NTSTATUS
  53. DbgKdWriteVirtualTranslatedMemory(
  54. IN ULONG64 TargetBaseAddress,
  55. OUT PVOID UserInterfaceBuffer,
  56. IN ULONG TransferCount,
  57. OUT PULONG ActualBytesWritten OPTIONAL
  58. );
  59. NTSTATUS
  60. NTAPI
  61. DbgKdReadPhysicalMemory(
  62. IN ULONGLONG TargetBaseAddress,
  63. OUT PVOID UserInterfaceBuffer,
  64. IN ULONG TransferCount,
  65. OUT PULONG ActualBytesRead OPTIONAL
  66. );
  67. NTSTATUS
  68. NTAPI
  69. DbgKdWritePhysicalMemory(
  70. IN ULONGLONG TargetBaseAddress,
  71. OUT PVOID UserInterfaceBuffer,
  72. IN ULONG TransferCount,
  73. OUT PULONG ActualBytesWritten OPTIONAL
  74. );
  75. NTSTATUS
  76. NTAPI
  77. DbgKdCheckLowMemory(
  78. );
  79. NTSTATUS
  80. NTAPI
  81. DbgKdGetVersion(
  82. PDBGKD_GET_VERSION64 GetVersion
  83. );
  84. NTSTATUS
  85. DbgKdReadIoSpace(
  86. IN ULONG64 IoAddress,
  87. OUT PVOID ReturnedData,
  88. IN ULONG DataSize
  89. );
  90. NTSTATUS
  91. DbgKdWriteIoSpace(
  92. IN ULONG64 IoAddress,
  93. IN ULONG DataValue,
  94. IN ULONG DataSize
  95. );
  96. NTSTATUS
  97. DbgKdReadIoSpaceExtended(
  98. IN ULONG64 IoAddress,
  99. OUT PVOID ReturnedData,
  100. IN ULONG DataSize,
  101. IN INTERFACE_TYPE InterfaceType,
  102. IN ULONG BusNumber,
  103. IN ULONG AddressSpace
  104. );
  105. NTSTATUS
  106. DbgKdWriteIoSpaceExtended(
  107. IN ULONG64 IoAddress,
  108. IN ULONG DataValue,
  109. IN ULONG DataSize,
  110. IN INTERFACE_TYPE InterfaceType,
  111. IN ULONG BusNumber,
  112. IN ULONG AddressSpace
  113. );
  114. NTSTATUS
  115. DbgKdReadControlSpace(
  116. IN ULONG Processor,
  117. IN ULONG OffsetAddress,
  118. OUT PVOID UserInterfaceBuffer,
  119. IN ULONG TransferCount,
  120. OUT PULONG ActualBytesRead
  121. );
  122. NTSTATUS
  123. DbgKdWriteControlSpace(
  124. IN ULONG Processor,
  125. IN ULONG OffsetAddress,
  126. OUT PVOID UserInterfaceBuffer,
  127. IN ULONG TransferCount,
  128. OUT PULONG ActualBytesWritten
  129. );
  130. NTSTATUS
  131. DbgKdGetBusData(
  132. IN ULONG BusDataType,
  133. IN ULONG BusNumber,
  134. IN ULONG SlotNumber,
  135. OUT PVOID Buffer,
  136. IN ULONG Offset,
  137. IN OUT PULONG Length
  138. );
  139. NTSTATUS
  140. DbgKdSetBusData(
  141. IN ULONG BusDataType,
  142. IN ULONG BusNumber,
  143. IN ULONG SlotNumber,
  144. IN PVOID Buffer,
  145. IN ULONG Offset,
  146. IN OUT PULONG Length
  147. );
  148. NTSTATUS
  149. DbgKdSetInternalBp(
  150. ULONG64 Addr,
  151. ULONG Flags
  152. );
  153. NTSTATUS
  154. DbgKdGetInternalBp (
  155. ULONG64 addr,
  156. PULONG flags,
  157. PULONG calls,
  158. PULONG minInstr,
  159. PULONG maxInstr,
  160. PULONG totInstr,
  161. PULONG maxCPS
  162. );
  163. NTSTATUS
  164. DbgKdClearAllInternalBreakpoints(
  165. void
  166. );
  167. NTSTATUS
  168. DbgKdReadDebuggerDataHeader(
  169. ULONG64 Address,
  170. PDBGKD_DEBUG_DATA_HEADER64 Header
  171. );
  172. NTSTATUS
  173. DbgKdReadDebuggerDataBlock(
  174. ULONG64 Address,
  175. PDBGKD_DEBUG_DATA_HEADER64 DataBlock,
  176. ULONG SizeToRead
  177. );
  178. BOOL
  179. ChangeBaudRate(
  180. DWORD NewRate
  181. );
  182. NTSTATUS
  183. DbgKdSearchMemory(
  184. IN ULONG64 SearchAddress,
  185. IN ULONG64 SearchLength,
  186. IN PUCHAR Pattern,
  187. IN ULONG PatternLength,
  188. OUT PULONG64 FoundAddress
  189. );
  190. NTSTATUS
  191. DbgKdWriteBreakPoint(
  192. IN ULONG64 BreakPointAddress,
  193. OUT PULONG_PTR BreakPointHandle
  194. );
  195. NTSTATUS
  196. DbgKdRestoreBreakPoint(
  197. IN ULONG_PTR BreakPointHandle
  198. );
  199. NTSTATUS
  200. DbgKdSwitchActiveProcessor(ULONG);
  201. NTSTATUS
  202. DbgKdContinue (
  203. IN NTSTATUS ContinueStatus
  204. );
  205. NTSTATUS
  206. DbgKdContinue2 (
  207. IN NTSTATUS ContinueStatus,
  208. IN DBGKD_ANY_CONTROL_SET ControlSet
  209. );
  210. NTSTATUS
  211. DbgKdReadMsr(
  212. IN ULONG MsrReg,
  213. OUT PULONGLONG MsrValue
  214. );
  215. NTSTATUS
  216. DbgKdWriteMsr(
  217. IN ULONG MsrReg,
  218. IN ULONGLONG MsrValue
  219. );
  220. NTSTATUS
  221. DbgKdGetContext(
  222. IN ULONG Processor,
  223. IN PCROSS_PLATFORM_CONTEXT Context
  224. );
  225. NTSTATUS
  226. DbgKdSetContext(
  227. IN ULONG Processor,
  228. IN PCROSS_PLATFORM_CONTEXT Context
  229. );
  230. NTSTATUS
  231. DbgKdRestoreBreakPoint(
  232. IN ULONG_PTR BreakPointHandle
  233. );
  234. NTSTATUS
  235. DbgKdReboot(
  236. VOID
  237. );
  238. NTSTATUS
  239. DbgKdFillMemory(
  240. IN ULONG Flags,
  241. IN ULONG64 Start,
  242. IN ULONG Size,
  243. IN PVOID Pattern,
  244. IN ULONG PatternSize,
  245. OUT PULONG Filled
  246. );
  247. NTSTATUS
  248. DbgKdQueryMemory(
  249. IN ULONG64 Address,
  250. IN ULONG InSpace,
  251. OUT PULONG OutSpace,
  252. OUT PULONG OutFlags
  253. );
  254. #endif // #ifndef _DBGKDAPI_H_