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.

219 lines
10 KiB

  1. /*++
  2. Copyright(c) 1999-2002 Microsoft Corporation
  3. --*/
  4. #pragma once
  5. #include "import.h"
  6. #define NT_BUILD_WIN2K 2195
  7. #define NT_BUILD_TH_MODULES 2469
  8. #define NT_BUILD_XP 2600
  9. class Win32LiveSystemProvider : public MiniDumpSystemProvider
  10. {
  11. public:
  12. Win32LiveSystemProvider(ULONG PlatformId, ULONG BuildNumber);
  13. ~Win32LiveSystemProvider(void);
  14. virtual HRESULT Initialize(void);
  15. virtual void Release(void);
  16. virtual HRESULT GetCurrentTimeDate(OUT PULONG TimeDate);
  17. virtual HRESULT GetCpuType(OUT PULONG Type,
  18. OUT PBOOL BackingStore);
  19. virtual HRESULT GetCpuInfo(OUT PUSHORT Architecture,
  20. OUT PUSHORT Level,
  21. OUT PUSHORT Revision,
  22. OUT PUCHAR NumberOfProcessors,
  23. OUT PCPU_INFORMATION Info);
  24. virtual void GetContextSizes(OUT PULONG Size,
  25. OUT PULONG RegScanStart,
  26. OUT PULONG RegScanCount);
  27. virtual void GetPointerSize(OUT PULONG Size);
  28. virtual void GetPageSize(OUT PULONG Size);
  29. virtual void GetFunctionTableSizes(OUT PULONG TableSize,
  30. OUT PULONG EntrySize);
  31. virtual void GetInstructionWindowSize(OUT PULONG Size);
  32. virtual HRESULT GetOsInfo(OUT PULONG PlatformId,
  33. OUT PULONG Major,
  34. OUT PULONG Minor,
  35. OUT PULONG BuildNumber,
  36. OUT PUSHORT ProductType,
  37. OUT PUSHORT SuiteMask);
  38. virtual HRESULT GetOsCsdString(OUT PWSTR Buffer,
  39. IN ULONG BufferChars);
  40. virtual HRESULT OpenMapping(IN PCWSTR FilePath,
  41. OUT PULONG Size,
  42. OUT PWSTR LongPath,
  43. IN ULONG LongPathChars,
  44. OUT PVOID* Mapping);
  45. virtual void CloseMapping(PVOID Mapping);
  46. virtual HRESULT GetImageHeaderInfo(IN HANDLE Process,
  47. IN PCWSTR FilePath,
  48. IN ULONG64 ImageBase,
  49. OUT PULONG Size,
  50. OUT PULONG CheckSum,
  51. OUT PULONG TimeDateStamp);
  52. virtual HRESULT GetImageVersionInfo(IN HANDLE Process,
  53. IN PCWSTR FilePath,
  54. IN ULONG64 ImageBase,
  55. OUT VS_FIXEDFILEINFO* Info);
  56. virtual HRESULT GetImageDebugRecord(IN HANDLE Process,
  57. IN PCWSTR FilePath,
  58. IN ULONG64 ImageBase,
  59. IN ULONG RecordType,
  60. OUT OPTIONAL PVOID Data,
  61. IN OUT PULONG DataLen);
  62. virtual HRESULT EnumImageDataSections(IN HANDLE Process,
  63. IN PCWSTR FilePath,
  64. IN ULONG64 ImageBase,
  65. IN MiniDumpProviderCallbacks*
  66. Callback);
  67. virtual HRESULT OpenThread(IN ULONG DesiredAccess,
  68. IN BOOL InheritHandle,
  69. IN ULONG ThreadId,
  70. OUT PHANDLE Handle);
  71. virtual void CloseThread(IN HANDLE Handle);
  72. virtual ULONG GetCurrentThreadId(void);
  73. virtual ULONG SuspendThread(IN HANDLE Thread);
  74. virtual ULONG ResumeThread(IN HANDLE Thread);
  75. virtual HRESULT GetThreadContext(IN HANDLE Thread,
  76. OUT PVOID Context,
  77. IN ULONG ContextSize,
  78. OUT PULONG64 CurrentPc,
  79. OUT PULONG64 CurrentStack,
  80. OUT PULONG64 CurrentStore);
  81. virtual HRESULT GetProcessTimes(IN HANDLE Process,
  82. OUT LPFILETIME Create,
  83. OUT LPFILETIME User,
  84. OUT LPFILETIME Kernel);
  85. virtual HRESULT ReadVirtual(IN HANDLE Process,
  86. IN ULONG64 Offset,
  87. OUT PVOID Buffer,
  88. IN ULONG Request,
  89. OUT PULONG Done);
  90. virtual HRESULT ReadAllVirtual(IN HANDLE Process,
  91. IN ULONG64 Offset,
  92. OUT PVOID Buffer,
  93. IN ULONG Request);
  94. virtual HRESULT QueryVirtual(IN HANDLE Process,
  95. IN ULONG64 Offset,
  96. OUT PULONG64 Base,
  97. OUT PULONG64 Size,
  98. OUT PULONG Protect,
  99. OUT PULONG State,
  100. OUT PULONG Type);
  101. virtual HRESULT StartProcessEnum(IN HANDLE Process,
  102. IN ULONG ProcessId);
  103. virtual HRESULT EnumThreads(OUT PULONG ThreadId);
  104. virtual HRESULT EnumModules(OUT PULONG64 Base,
  105. OUT PWSTR Path,
  106. IN ULONG PathChars);
  107. virtual HRESULT EnumFunctionTables(OUT PULONG64 MinAddress,
  108. OUT PULONG64 MaxAddress,
  109. OUT PULONG64 BaseAddress,
  110. OUT PULONG EntryCount,
  111. OUT PVOID RawTable,
  112. IN ULONG RawTableSize,
  113. OUT PVOID* RawEntryHandle);
  114. virtual HRESULT EnumFunctionTableEntries(IN PVOID RawTable,
  115. IN ULONG RawTableSize,
  116. IN PVOID RawEntryHandle,
  117. OUT PVOID RawEntries,
  118. IN ULONG RawEntriesSize);
  119. virtual HRESULT EnumFunctionTableEntryMemory(IN ULONG64 TableBase,
  120. IN PVOID RawEntries,
  121. IN ULONG Index,
  122. OUT PULONG64 Start,
  123. OUT PULONG Size);
  124. virtual HRESULT EnumUnloadedModules(OUT PWSTR Path,
  125. IN ULONG PathChars,
  126. OUT PULONG64 BaseOfModule,
  127. OUT PULONG SizeOfModule,
  128. OUT PULONG CheckSum,
  129. OUT PULONG TimeDateStamp);
  130. virtual void FinishProcessEnum(void);
  131. virtual HRESULT StartHandleEnum(IN HANDLE Process,
  132. IN ULONG ProcessId,
  133. OUT PULONG Count);
  134. virtual HRESULT EnumHandles(OUT PULONG64 Handle,
  135. OUT PULONG Attributes,
  136. OUT PULONG GrantedAccess,
  137. OUT PULONG HandleCount,
  138. OUT PULONG PointerCount,
  139. OUT PWSTR TypeName,
  140. IN ULONG TypeNameChars,
  141. OUT PWSTR ObjectName,
  142. IN ULONG ObjectNameChars);
  143. virtual void FinishHandleEnum(void);
  144. virtual HRESULT EnumPebMemory(IN HANDLE Process,
  145. IN ULONG64 PebOffset,
  146. IN ULONG PebSize,
  147. IN MiniDumpProviderCallbacks* Callback);
  148. virtual HRESULT EnumTebMemory(IN HANDLE Process,
  149. IN HANDLE Thread,
  150. IN ULONG64 TebOffset,
  151. IN ULONG TebSize,
  152. IN MiniDumpProviderCallbacks* Callback);
  153. virtual HRESULT GetCorDataAccess(IN PWSTR AccessDllName,
  154. IN struct ICorDataAccessServices*
  155. Services,
  156. OUT struct ICorDataAccess**
  157. Access);
  158. virtual void ReleaseCorDataAccess(IN struct ICorDataAccess*
  159. Access);
  160. protected:
  161. HRESULT ProcessThread32Next(IN HANDLE Snapshot,
  162. IN ULONG ProcessId,
  163. OUT THREADENTRY32* ThreadInfo);
  164. HRESULT ProcessThread32First(IN HANDLE Snapshot,
  165. IN ULONG dwProcessId,
  166. OUT THREADENTRY32* ThreadInfo);
  167. HRESULT TibGetThreadInfo(IN HANDLE Process,
  168. IN ULONG64 TibBase,
  169. OUT PULONG64 StackBase,
  170. OUT PULONG64 StackLimit,
  171. OUT PULONG64 StoreBase,
  172. OUT PULONG64 StoreLimit);
  173. ULONG m_PlatformId;
  174. ULONG m_BuildNumber;
  175. HINSTANCE m_PsApi;
  176. ENUM_PROCESS_MODULES m_EnumProcessModules;
  177. GET_MODULE_FILE_NAME_EX_W m_GetModuleFileNameExW;
  178. HINSTANCE m_Kernel32;
  179. OPEN_THREAD m_OpenThread;
  180. THREAD32_FIRST m_Thread32First;
  181. THREAD32_NEXT m_Thread32Next;
  182. MODULE32_FIRST m_Module32First;
  183. MODULE32_NEXT m_Module32Next;
  184. MODULE32_FIRST m_Module32FirstW;
  185. MODULE32_NEXT m_Module32NextW;
  186. CREATE_TOOLHELP32_SNAPSHOT m_CreateToolhelp32Snapshot;
  187. GET_LONG_PATH_NAME_A m_GetLongPathNameA;
  188. GET_LONG_PATH_NAME_W m_GetLongPathNameW;
  189. GET_PROCESS_TIMES m_GetProcessTimes;
  190. HANDLE m_ProcessHandle;
  191. ULONG m_ProcessId;
  192. HANDLE m_ThSnap;
  193. BOOL m_AnsiModules;
  194. ULONG m_ThreadIndex;
  195. ULONG m_ModuleIndex;
  196. ULONG m_LastModuleId;
  197. HINSTANCE m_CorDll;
  198. };
  199. Win32LiveSystemProvider* NewNtWin32LiveSystemProvider(ULONG BuildNumber);
  200. Win32LiveSystemProvider* NewWin9xWin32LiveSystemProvider(ULONG BuildNumber);
  201. Win32LiveSystemProvider* NewWinCeWin32LiveSystemProvider(ULONG BuildNumber);