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.

252 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1999-2002 Microsoft Corporation
  3. Module Name:
  4. impl.h
  5. Abstract:
  6. OS-specific thunks.
  7. Author:
  8. Matthew D Hendel (math) 20-Sept-1999
  9. Revision History:
  10. --*/
  11. #pragma once
  12. //
  13. // dbghelp routines
  14. //
  15. typedef
  16. BOOL
  17. (WINAPI * MINI_DUMP_READ_DUMP_STREAM) (
  18. IN PVOID Base,
  19. ULONG StreamNumber,
  20. OUT PMINIDUMP_DIRECTORY * Dir, OPTIONAL
  21. OUT PVOID * Stream, OPTIONAL
  22. OUT ULONG * StreamSize OPTIONAL
  23. );
  24. typedef
  25. BOOL
  26. (WINAPI * MINI_DUMP_WRITE_DUMP) (
  27. IN HANDLE hProcess,
  28. IN DWORD ProcessId,
  29. IN HANDLE hFile,
  30. IN MINIDUMP_TYPE DumpType,
  31. IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
  32. IN CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL
  33. IN CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL
  34. );
  35. //
  36. // PSAPI APIs.
  37. //
  38. typedef
  39. BOOL
  40. (WINAPI *
  41. ENUM_PROCESS_MODULES) (
  42. HANDLE hProcess,
  43. HMODULE *lphModule,
  44. DWORD cb,
  45. LPDWORD lpcbNeeded
  46. );
  47. typedef
  48. DWORD
  49. (WINAPI *
  50. GET_MODULE_FILE_NAME_EX_W) (
  51. HANDLE hProcess,
  52. HMODULE hModule,
  53. LPWSTR lpFilename,
  54. DWORD nSize
  55. );
  56. //
  57. // NT APIs.
  58. //
  59. typedef
  60. NTSTATUS
  61. (WINAPI *
  62. NT_OPEN_THREAD) (
  63. PHANDLE ThreadHandle,
  64. ULONG Mask,
  65. PVOID Attributes,
  66. PVOID ClientId
  67. );
  68. typedef
  69. NTSTATUS
  70. (WINAPI *
  71. NT_QUERY_SYSTEM_INFORMATION) (
  72. IN INT SystemInformationClass,
  73. OUT PVOID SystemInformation,
  74. IN ULONG SystemInformationLength,
  75. OUT PULONG ReturnLength OPTIONAL
  76. );
  77. typedef
  78. NTSTATUS
  79. (WINAPI *
  80. NT_QUERY_INFORMATION_PROCESS) (
  81. IN HANDLE ProcessHandle,
  82. IN INT ProcessInformationClass,
  83. OUT PVOID ProcessInformation,
  84. IN ULONG ProcessInformationLength,
  85. OUT PULONG ReturnLength OPTIONAL
  86. );
  87. typedef
  88. NTSTATUS
  89. (WINAPI *
  90. NT_QUERY_INFORMATION_THREAD) (
  91. IN HANDLE ThreadHandle,
  92. IN INT ThreadInformationClass,
  93. OUT PVOID ThreadInformation,
  94. IN ULONG ThreadInformationLength,
  95. OUT PULONG ReturnLength OPTIONAL
  96. );
  97. typedef
  98. NTSTATUS
  99. (WINAPI *
  100. NT_QUERY_OBJECT) (
  101. IN HANDLE Handle,
  102. IN INT ObjectInformationClass,
  103. OUT PVOID ObjectInformation,
  104. IN ULONG Length,
  105. OUT PULONG ReturnLength OPTIONAL
  106. );
  107. typedef
  108. BOOLEAN
  109. (NTAPI*
  110. RTL_FREE_HEAP) (
  111. IN PVOID HeapHandle,
  112. IN ULONG Flags,
  113. IN PVOID BaseAddress
  114. );
  115. typedef
  116. PLIST_ENTRY
  117. (NTAPI* RTL_GET_FUNCTION_TABLE_LIST_HEAD) (
  118. VOID
  119. );
  120. typedef
  121. VOID
  122. (NTAPI*
  123. RTL_INIT_UNICODE_STRING) (
  124. PUNICODE_STRING DestinationString,
  125. PCWSTR SourceString
  126. );
  127. typedef
  128. NTSTATUS
  129. (NTAPI*
  130. RTL_NT_PATH_NAME_TO_DOS_PATH_NAME) (
  131. IN ULONG Flags,
  132. IN OUT PRTL_UNICODE_STRING_BUFFER Path,
  133. OUT ULONG* Disposition OPTIONAL,
  134. IN OUT PWSTR* FilePart OPTIONAL
  135. );
  136. typedef
  137. PRTL_UNLOAD_EVENT_TRACE
  138. (NTAPI* RTL_GET_UNLOAD_EVENT_TRACE) (
  139. VOID
  140. );
  141. //
  142. // Kernel32 APIs.
  143. //
  144. typedef
  145. HANDLE
  146. (WINAPI *
  147. OPEN_THREAD) (
  148. DWORD dwDesiredAccess,
  149. BOOL bInheritHandle,
  150. DWORD dwThreadId
  151. );
  152. typedef
  153. BOOL
  154. (WINAPI *
  155. THREAD32_FIRST) (
  156. HANDLE hSnapshot,
  157. PVOID ThreadEntry
  158. );
  159. typedef
  160. BOOL
  161. (WINAPI *
  162. THREAD32_NEXT) (
  163. HANDLE hSnapshot,
  164. PVOID ThreadEntry
  165. );
  166. typedef
  167. BOOL
  168. (WINAPI *
  169. MODULE32_FIRST) (
  170. HANDLE hSnapshot,
  171. PVOID Module
  172. );
  173. typedef
  174. BOOL
  175. (WINAPI *
  176. MODULE32_NEXT) (
  177. HANDLE hSnapshot,
  178. PVOID Module
  179. );
  180. typedef
  181. HANDLE
  182. (WINAPI *
  183. CREATE_TOOLHELP32_SNAPSHOT) (
  184. DWORD dwFlags,
  185. DWORD th32ProcessID
  186. );
  187. typedef
  188. DWORD
  189. (WINAPI *
  190. GET_LONG_PATH_NAME_A) (
  191. LPCSTR lpszShortPath,
  192. LPSTR lpszLongPath,
  193. DWORD cchBuffer
  194. );
  195. typedef
  196. DWORD
  197. (WINAPI *
  198. GET_LONG_PATH_NAME_W) (
  199. LPCWSTR lpszShortPath,
  200. LPWSTR lpszLongPath,
  201. DWORD cchBuffer
  202. );
  203. typedef
  204. BOOL
  205. (WINAPI*
  206. GET_PROCESS_TIMES) (
  207. IN HANDLE hProcess,
  208. OUT LPFILETIME lpCreationTime,
  209. OUT LPFILETIME lpExitTime,
  210. OUT LPFILETIME lpKernelTime,
  211. OUT LPFILETIME lpUserTime
  212. );