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.

1854 lines
46 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Debug client classes.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999-2001.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __DBGCLT_HPP__
  9. #define __DBGCLT_HPP__
  10. // Most-derived interfaces. When casting back and forth
  11. // from DebugClient to a specific interface these defines
  12. // should be used so that when new versions of interfaces
  13. // are added this is the only place that needs to be updated.
  14. #define IDebugAdvancedN IDebugAdvanced
  15. #define IDebugClientN IDebugClient2
  16. #define IDebugControlN IDebugControl2
  17. #define IDebugDataSpacesN IDebugDataSpaces2
  18. #define IDebugRegistersN IDebugRegisters
  19. #define IDebugSymbolGroupN IDebugSymbolGroup
  20. #define IDebugSymbolsN IDebugSymbols2
  21. #define IDebugSystemObjectsN IDebugSystemObjects2
  22. #define INPUT_BUFFER_SIZE 4096
  23. extern BOOL g_QuietMode;
  24. // The platform ID of the machine running the debugger. Note
  25. // that this may be different from g_TargetPlatformId, which
  26. // is the platform ID of the machine being debugged.
  27. extern ULONG g_DebuggerPlatformId;
  28. // A lock that can be used for any short-term protection needs.
  29. // This lock should not be held for a long time nor should
  30. // other locks be taken when it is held. Users of the lock
  31. // can expect little contention and no deadlock possibilities.
  32. extern CRITICAL_SECTION g_QuickLock;
  33. // The global lock protecting engine state. This lock
  34. // should be taken everywhere and held any time engine
  35. // activity occurs. It should be suspended whenever a
  36. // call needs to call out of the engine, such as with
  37. // callbacks.
  38. extern CRITICAL_SECTION g_EngineLock;
  39. extern ULONG g_EngineNesting;
  40. #define ENTER_ENGINE() \
  41. (EnterCriticalSection(&g_EngineLock), g_EngineNesting++)
  42. #define LEAVE_ENGINE() \
  43. (::FlushCallbacks(), g_EngineNesting--, \
  44. LeaveCriticalSection(&g_EngineLock))
  45. #define SUSPEND_ENGINE() \
  46. (::FlushCallbacks(), LeaveCriticalSection(&g_EngineLock))
  47. #define RESUME_ENGINE() \
  48. EnterCriticalSection(&g_EngineLock)
  49. // Special routine which opportunistically takes the engine lock.
  50. inline HRESULT
  51. TRY_ENTER_ENGINE()
  52. {
  53. if (g_DebuggerPlatformId != VER_PLATFORM_WIN32_NT)
  54. {
  55. return HRESULT_FROM_WIN32(ERROR_CALL_NOT_IMPLEMENTED);
  56. }
  57. if (!g_NtDllCalls.RtlTryEnterCriticalSection(&g_EngineLock))
  58. {
  59. return HRESULT_FROM_WIN32(ERROR_BUSY);
  60. }
  61. g_EngineNesting++;
  62. return S_OK;
  63. }
  64. // Events and storage space for returning event callback
  65. // status from an APC.
  66. extern HANDLE g_EventStatusWaiting;
  67. extern HANDLE g_EventStatusReady;
  68. extern ULONG g_EventStatus;
  69. // Named event to sleep on.
  70. extern HANDLE g_SleepPidEvent;
  71. extern ULONG64 g_ImplicitThreadData;
  72. extern BOOL g_ImplicitThreadDataIsDefault;
  73. extern ULONG64 g_ImplicitProcessData;
  74. extern BOOL g_ImplicitProcessDataIsDefault;
  75. HRESULT GetImplicitThreadData(PULONG64 Offset);
  76. HRESULT GetImplicitThreadDataTeb(PULONG64 Offset);
  77. HRESULT SetImplicitThreadData(ULONG64 Offset, BOOL Verbose);
  78. HRESULT GetImplicitProcessData(PULONG64 Offset);
  79. HRESULT GetImplicitProcessDataPeb(PULONG64 Offset);
  80. HRESULT SetImplicitProcessData(ULONG64 Offset, BOOL Verbose);
  81. void ResetImplicitData(void);
  82. void ParseSetImplicitThread(void);
  83. void ParseSetImplicitProcess(void);
  84. HRESULT
  85. GetContextFromThreadStack(
  86. ULONG64 ThreadBase,
  87. PCROSS_PLATFORM_CONTEXT Context,
  88. PDEBUG_STACK_FRAME StkFrame,
  89. BOOL Verbose
  90. );
  91. HRESULT SetContextFromThreadData(ULONG64 ThreadBase, BOOL Verbose);
  92. //----------------------------------------------------------------------------
  93. //
  94. // DebugClient.
  95. //
  96. //----------------------------------------------------------------------------
  97. extern DebugClient* g_Clients;
  98. extern ULONG g_LogMask;
  99. extern ULONG g_OutputWidth;
  100. extern PCSTR g_OutputLinePrefix;
  101. extern char g_InputBuffer[INPUT_BUFFER_SIZE];
  102. extern ULONG g_InputSequence;
  103. extern HANDLE g_InputEvent;
  104. extern ULONG g_InputSizeRequested;
  105. // The thread that created the current session.
  106. extern ULONG g_SessionThread;
  107. extern ULONG g_EngOptions;
  108. extern ULONG g_GlobalProcOptions;
  109. //
  110. // Engine status flags.
  111. //
  112. #define ENG_STATUS_WAITING 0x00000001
  113. #define ENG_STATUS_SUSPENDED 0x00000002
  114. #define ENG_STATUS_BREAKPOINTS_INSERTED 0x00000004
  115. #define ENG_STATUS_PROCESSES_ADDED 0x00000008
  116. // A true system state change occurred.
  117. #define ENG_STATUS_STATE_CHANGED 0x00000010
  118. #define ENG_STATUS_MODULES_LOADED 0x00000020
  119. #define ENG_STATUS_STOP_SESSION 0x00000040
  120. #define ENG_STATUS_PREPARED_FOR_CALLS 0x00000080
  121. #define ENG_STATUS_NO_AUTO_WAIT 0x00000100
  122. #define ENG_STATUS_PENDING_BREAK_IN 0x00000200
  123. #define ENG_STATUS_AT_INITIAL_BREAK 0x00000400
  124. #define ENG_STATUS_AT_INITIAL_MODULE_LOAD 0x00000800
  125. #define ENG_STATUS_EXIT_CURRENT_WAIT 0x00001000
  126. #define ENG_STATUS_USER_INTERRUPT 0x00002000
  127. extern ULONG g_EngStatus;
  128. //
  129. // Deferred action flags.
  130. // These flags are set during processing in order to indicate
  131. // actions that should be performed before execution begins
  132. // again.
  133. //
  134. #define ENG_DEFER_SET_EVENT 0x00000001
  135. #define ENG_DEFER_RESUME_THREAD 0x00000002
  136. #define ENG_DEFER_DELETE_EXITED 0x00000004
  137. #define ENG_DEFER_EXCEPTION_HANDLING 0x00000008
  138. #define ENG_DEFER_UPDATE_CONTROL_SET 0x00000010
  139. #define ENG_DEFER_HARDWARE_TRACING 0x00000020
  140. #define ENG_DEFER_OUTPUT_CURRENT_INFO 0x00000040
  141. #define ENG_DEFER_CONTINUE_EVENT 0x00000080
  142. extern ULONG g_EngDefer;
  143. //
  144. // Error suppression flags.
  145. // These flags are set when particular errors are displayed
  146. // in order to avoid repeated errors.
  147. //
  148. #define ENG_ERR_DEBUGGER_DATA 0x00000001
  149. extern ULONG g_EngErr;
  150. //
  151. // Per-client flags.
  152. //
  153. #define CLIENT_IN_LIST 0x00000001
  154. #define CLIENT_DESTROYED 0x00000002
  155. #define CLIENT_REMOTE 0x00000004
  156. #define CLIENT_PRIMARY 0x00000008
  157. class DebugClient
  158. : public IDebugAdvanced,
  159. public IDebugClient2,
  160. public IDebugControl2,
  161. public IDebugDataSpaces2,
  162. public IDebugRegisters,
  163. public IDebugSymbols2,
  164. public IDebugSystemObjects2,
  165. public DbgRpcClientObject
  166. {
  167. public:
  168. DebugClient(void);
  169. ~DebugClient(void);
  170. void Destroy(void);
  171. // IUnknown.
  172. STDMETHOD(QueryInterface)(
  173. THIS_
  174. IN REFIID InterfaceId,
  175. OUT PVOID* Interface
  176. );
  177. STDMETHOD_(ULONG, AddRef)(
  178. THIS
  179. );
  180. STDMETHOD_(ULONG, Release)(
  181. THIS
  182. );
  183. // IDebugAdvanced.
  184. STDMETHOD(GetThreadContext)(
  185. THIS_
  186. OUT PVOID Context,
  187. IN ULONG ContextSize
  188. );
  189. STDMETHOD(SetThreadContext)(
  190. THIS_
  191. IN PVOID Context,
  192. IN ULONG ContextSize
  193. );
  194. // IDebugClient and IDebugClient2.
  195. STDMETHOD(AttachKernel)(
  196. THIS_
  197. IN ULONG Flags,
  198. IN OPTIONAL PCSTR ConnectOptions
  199. );
  200. STDMETHOD(GetKernelConnectionOptions)(
  201. THIS_
  202. OUT OPTIONAL PSTR Buffer,
  203. IN ULONG BufferSize,
  204. OUT OPTIONAL PULONG OptionsSize
  205. );
  206. STDMETHOD(SetKernelConnectionOptions)(
  207. THIS_
  208. IN PCSTR Options
  209. );
  210. STDMETHOD(StartProcessServer)(
  211. THIS_
  212. IN ULONG Flags,
  213. IN PCSTR Options,
  214. IN PVOID Reserved
  215. );
  216. STDMETHOD(ConnectProcessServer)(
  217. THIS_
  218. IN PCSTR RemoteOptions,
  219. OUT PULONG64 Server
  220. );
  221. STDMETHOD(DisconnectProcessServer)(
  222. THIS_
  223. IN ULONG64 Server
  224. );
  225. STDMETHOD(GetRunningProcessSystemIds)(
  226. THIS_
  227. IN ULONG64 Server,
  228. OUT OPTIONAL /* size_is(Count) */ PULONG Ids,
  229. IN ULONG Count,
  230. OUT OPTIONAL PULONG ActualCount
  231. );
  232. STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
  233. THIS_
  234. IN ULONG64 Server,
  235. IN PCSTR ExeName,
  236. IN ULONG Flags,
  237. OUT PULONG Id
  238. );
  239. STDMETHOD(GetRunningProcessDescription)(
  240. THIS_
  241. IN ULONG64 Server,
  242. IN ULONG SystemId,
  243. IN ULONG Flags,
  244. OUT OPTIONAL PSTR ExeName,
  245. IN ULONG ExeNameSize,
  246. OUT OPTIONAL PULONG ActualExeNameSize,
  247. OUT OPTIONAL PSTR Description,
  248. IN ULONG DescriptionSize,
  249. OUT OPTIONAL PULONG ActualDescriptionSize
  250. );
  251. STDMETHOD(AttachProcess)(
  252. THIS_
  253. IN ULONG64 Server,
  254. IN ULONG ProcessId,
  255. IN ULONG AttachFlags
  256. );
  257. STDMETHOD(CreateProcess)(
  258. THIS_
  259. IN ULONG64 Server,
  260. IN PSTR CommandLine,
  261. IN ULONG CreateFlags
  262. );
  263. STDMETHOD(CreateProcessAndAttach)(
  264. THIS_
  265. IN ULONG64 Server,
  266. IN OPTIONAL PSTR CommandLine,
  267. IN ULONG CreateFlags,
  268. IN ULONG ProcessId,
  269. IN ULONG AttachFlags
  270. );
  271. STDMETHOD(GetProcessOptions)(
  272. THIS_
  273. OUT PULONG Options
  274. );
  275. STDMETHOD(AddProcessOptions)(
  276. THIS_
  277. IN ULONG Options
  278. );
  279. STDMETHOD(RemoveProcessOptions)(
  280. THIS_
  281. IN ULONG Options
  282. );
  283. STDMETHOD(SetProcessOptions)(
  284. THIS_
  285. IN ULONG Options
  286. );
  287. STDMETHOD(OpenDumpFile)(
  288. THIS_
  289. IN PCSTR DumpFile
  290. );
  291. STDMETHOD(WriteDumpFile)(
  292. THIS_
  293. IN PCSTR DumpFile,
  294. IN ULONG Qualifier
  295. );
  296. STDMETHOD(ConnectSession)(
  297. THIS_
  298. IN ULONG Flags,
  299. IN ULONG HistoryLimit
  300. );
  301. STDMETHOD(StartServer)(
  302. THIS_
  303. IN PCSTR Options
  304. );
  305. STDMETHOD(OutputServers)(
  306. THIS_
  307. IN ULONG OutputControl,
  308. IN PCSTR Machine,
  309. IN ULONG Flags
  310. );
  311. STDMETHOD(TerminateProcesses)(
  312. THIS
  313. );
  314. STDMETHOD(DetachProcesses)(
  315. THIS
  316. );
  317. STDMETHOD(EndSession)(
  318. THIS_
  319. IN ULONG Flags
  320. );
  321. STDMETHOD(GetExitCode)(
  322. THIS_
  323. OUT PULONG Code
  324. );
  325. STDMETHOD(DispatchCallbacks)(
  326. THIS_
  327. IN ULONG Timeout
  328. );
  329. STDMETHOD(ExitDispatch)(
  330. THIS_
  331. IN PDEBUG_CLIENT Client
  332. );
  333. STDMETHOD(CreateClient)(
  334. THIS_
  335. OUT PDEBUG_CLIENT* Client
  336. );
  337. STDMETHOD(GetInputCallbacks)(
  338. THIS_
  339. OUT PDEBUG_INPUT_CALLBACKS* Callbacks
  340. );
  341. STDMETHOD(SetInputCallbacks)(
  342. THIS_
  343. IN PDEBUG_INPUT_CALLBACKS Callbacks
  344. );
  345. STDMETHOD(GetOutputCallbacks)(
  346. THIS_
  347. OUT PDEBUG_OUTPUT_CALLBACKS* Callbacks
  348. );
  349. STDMETHOD(SetOutputCallbacks)(
  350. THIS_
  351. IN PDEBUG_OUTPUT_CALLBACKS Callbacks
  352. );
  353. STDMETHOD(GetOutputMask)(
  354. THIS_
  355. OUT PULONG Mask
  356. );
  357. STDMETHOD(SetOutputMask)(
  358. THIS_
  359. IN ULONG Mask
  360. );
  361. STDMETHOD(GetOtherOutputMask)(
  362. THIS_
  363. IN PDEBUG_CLIENT Client,
  364. OUT PULONG Mask
  365. );
  366. STDMETHOD(SetOtherOutputMask)(
  367. THIS_
  368. IN PDEBUG_CLIENT Client,
  369. IN ULONG Mask
  370. );
  371. STDMETHOD(GetOutputWidth)(
  372. THIS_
  373. OUT PULONG Columns
  374. );
  375. STDMETHOD(SetOutputWidth)(
  376. THIS_
  377. IN ULONG Columns
  378. );
  379. STDMETHOD(GetOutputLinePrefix)(
  380. THIS_
  381. OUT OPTIONAL PSTR Buffer,
  382. IN ULONG BufferSize,
  383. OUT OPTIONAL PULONG PrefixSize
  384. );
  385. STDMETHOD(SetOutputLinePrefix)(
  386. THIS_
  387. IN OPTIONAL PCSTR Prefix
  388. );
  389. STDMETHOD(GetIdentity)(
  390. THIS_
  391. OUT OPTIONAL PSTR Buffer,
  392. IN ULONG BufferSize,
  393. OUT OPTIONAL PULONG IdentitySize
  394. );
  395. STDMETHOD(OutputIdentity)(
  396. THIS_
  397. IN ULONG OutputControl,
  398. IN ULONG Flags,
  399. IN PCSTR Format
  400. );
  401. STDMETHOD(GetEventCallbacks)(
  402. THIS_
  403. OUT PDEBUG_EVENT_CALLBACKS* Callbacks
  404. );
  405. STDMETHOD(SetEventCallbacks)(
  406. THIS_
  407. IN PDEBUG_EVENT_CALLBACKS Callbacks
  408. );
  409. STDMETHOD(FlushCallbacks)(
  410. THIS
  411. );
  412. STDMETHOD(WriteDumpFile2)(
  413. THIS_
  414. IN PCSTR DumpFile,
  415. IN ULONG Qualifier,
  416. IN ULONG FormatFlags,
  417. IN OPTIONAL PCSTR Comment
  418. );
  419. STDMETHOD(AddDumpInformationFile)(
  420. THIS_
  421. IN PCSTR InfoFile,
  422. IN ULONG Type
  423. );
  424. STDMETHOD(EndProcessServer)(
  425. THIS_
  426. IN ULONG64 Server
  427. );
  428. STDMETHOD(WaitForProcessServerEnd)(
  429. THIS_
  430. IN ULONG Timeout
  431. );
  432. STDMETHOD(IsKernelDebuggerEnabled)(
  433. THIS
  434. );
  435. STDMETHOD(TerminateCurrentProcess)(
  436. THIS
  437. );
  438. STDMETHOD(DetachCurrentProcess)(
  439. THIS
  440. );
  441. STDMETHOD(AbandonCurrentProcess)(
  442. THIS
  443. );
  444. // IDebugControl and IDebugControl2.
  445. STDMETHOD(GetInterrupt)(
  446. THIS
  447. );
  448. STDMETHOD(SetInterrupt)(
  449. THIS_
  450. IN ULONG Flags
  451. );
  452. STDMETHOD(GetInterruptTimeout)(
  453. THIS_
  454. OUT PULONG Seconds
  455. );
  456. STDMETHOD(SetInterruptTimeout)(
  457. THIS_
  458. IN ULONG Seconds
  459. );
  460. STDMETHOD(GetLogFile)(
  461. THIS_
  462. OUT OPTIONAL PSTR Buffer,
  463. IN ULONG BufferSize,
  464. OUT OPTIONAL PULONG FileSize,
  465. OUT PBOOL Append
  466. );
  467. STDMETHOD(OpenLogFile)(
  468. THIS_
  469. IN PCSTR File,
  470. IN BOOL Append
  471. );
  472. STDMETHOD(CloseLogFile)(
  473. THIS
  474. );
  475. STDMETHOD(GetLogMask)(
  476. THIS_
  477. OUT PULONG Mask
  478. );
  479. STDMETHOD(SetLogMask)(
  480. THIS_
  481. IN ULONG Mask
  482. );
  483. STDMETHOD(Input)(
  484. THIS_
  485. OUT PSTR Buffer,
  486. IN ULONG BufferSize,
  487. OUT OPTIONAL PULONG InputSize
  488. );
  489. STDMETHOD(ReturnInput)(
  490. THIS_
  491. IN PCSTR Buffer
  492. );
  493. STDMETHODV(Output)(
  494. THIS_
  495. IN ULONG Mask,
  496. IN PCSTR Format,
  497. ...
  498. );
  499. STDMETHOD(OutputVaList)(
  500. THIS_
  501. IN ULONG Mask,
  502. IN PCSTR Format,
  503. IN va_list Args
  504. );
  505. STDMETHODV(ControlledOutput)(
  506. THIS_
  507. IN ULONG OutputControl,
  508. IN ULONG Mask,
  509. IN PCSTR Format,
  510. ...
  511. );
  512. STDMETHOD(ControlledOutputVaList)(
  513. THIS_
  514. IN ULONG OutputControl,
  515. IN ULONG Mask,
  516. IN PCSTR Format,
  517. IN va_list Args
  518. );
  519. STDMETHOD(OutputPrompt)(
  520. THIS_
  521. IN ULONG OutputControl,
  522. IN OPTIONAL PCSTR Format,
  523. ...
  524. );
  525. STDMETHOD(OutputPromptVaList)(
  526. THIS_
  527. IN ULONG OutputControl,
  528. IN OPTIONAL PCSTR Format,
  529. IN va_list Args
  530. );
  531. STDMETHOD(GetPromptText)(
  532. THIS_
  533. OUT OPTIONAL PSTR Buffer,
  534. IN ULONG BufferSize,
  535. OUT OPTIONAL PULONG TextSize
  536. );
  537. STDMETHOD(OutputCurrentState)(
  538. THIS_
  539. IN ULONG OutputControl,
  540. IN ULONG Flags
  541. );
  542. STDMETHOD(OutputVersionInformation)(
  543. THIS_
  544. IN ULONG OutputControl
  545. );
  546. STDMETHOD(GetNotifyEventHandle)(
  547. THIS_
  548. OUT PULONG64 Handle
  549. );
  550. STDMETHOD(SetNotifyEventHandle)(
  551. THIS_
  552. IN ULONG64 Handle
  553. );
  554. STDMETHOD(Assemble)(
  555. THIS_
  556. IN ULONG64 Offset,
  557. IN PCSTR Instr,
  558. OUT PULONG64 EndOffset
  559. );
  560. STDMETHOD(Disassemble)(
  561. THIS_
  562. IN ULONG64 Offset,
  563. IN ULONG Flags,
  564. OUT OPTIONAL PSTR Buffer,
  565. IN ULONG BufferSize,
  566. OUT OPTIONAL PULONG DisassemblySize,
  567. OUT PULONG64 EndOffset
  568. );
  569. STDMETHOD(GetDisassembleEffectiveOffset)(
  570. THIS_
  571. OUT PULONG64 Offset
  572. );
  573. STDMETHOD(OutputDisassembly)(
  574. THIS_
  575. IN ULONG OutputControl,
  576. IN ULONG64 Offset,
  577. IN ULONG Flags,
  578. OUT PULONG64 EndOffset
  579. );
  580. STDMETHOD(OutputDisassemblyLines)(
  581. THIS_
  582. IN ULONG OutputControl,
  583. IN ULONG PreviousLines,
  584. IN ULONG TotalLines,
  585. IN ULONG64 Offset,
  586. IN ULONG Flags,
  587. OUT OPTIONAL PULONG OffsetLine,
  588. OUT OPTIONAL PULONG64 StartOffset,
  589. OUT OPTIONAL PULONG64 EndOffset,
  590. OUT OPTIONAL /* size_is(TotalLines) */ PULONG64 LineOffsets
  591. );
  592. STDMETHOD(GetNearInstruction)(
  593. THIS_
  594. IN ULONG64 Offset,
  595. IN LONG Delta,
  596. OUT PULONG64 NearOffset
  597. );
  598. STDMETHOD(GetStackTrace)(
  599. THIS_
  600. IN ULONG64 FrameOffset,
  601. IN ULONG64 StackOffset,
  602. IN ULONG64 InstructionOffset,
  603. OUT PDEBUG_STACK_FRAME Frames,
  604. IN ULONG FramesSize,
  605. OUT PULONG FramesFilled
  606. );
  607. STDMETHOD(GetReturnOffset)(
  608. THIS_
  609. OUT PULONG64 Offset
  610. );
  611. STDMETHOD(OutputStackTrace)(
  612. THIS_
  613. IN ULONG OutputControl,
  614. IN PDEBUG_STACK_FRAME Frames,
  615. IN ULONG FramesSize,
  616. IN ULONG Flags
  617. );
  618. STDMETHOD(GetDebuggeeType)(
  619. THIS_
  620. OUT PULONG Class,
  621. OUT PULONG Qualifier
  622. );
  623. STDMETHOD(GetActualProcessorType)(
  624. THIS_
  625. OUT PULONG Type
  626. );
  627. STDMETHOD(GetExecutingProcessorType)(
  628. THIS_
  629. OUT PULONG Type
  630. );
  631. STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
  632. THIS_
  633. OUT PULONG Number
  634. );
  635. STDMETHOD(GetPossibleExecutingProcessorTypes)(
  636. THIS_
  637. IN ULONG Start,
  638. IN ULONG Count,
  639. OUT PULONG Types
  640. );
  641. STDMETHOD(GetNumberProcessors)(
  642. THIS_
  643. OUT PULONG Number
  644. );
  645. STDMETHOD(GetSystemVersion)(
  646. THIS_
  647. OUT PULONG PlatformId,
  648. OUT PULONG Major,
  649. OUT PULONG Minor,
  650. OUT OPTIONAL PSTR ServicePackString,
  651. IN ULONG ServicePackStringSize,
  652. OUT OPTIONAL PULONG ServicePackStringUsed,
  653. OUT PULONG ServicePackNumber,
  654. OUT OPTIONAL PSTR BuildString,
  655. IN ULONG BuildStringSize,
  656. OUT OPTIONAL PULONG BuildStringUsed
  657. );
  658. STDMETHOD(GetPageSize)(
  659. THIS_
  660. OUT PULONG Size
  661. );
  662. STDMETHOD(IsPointer64Bit)(
  663. THIS
  664. );
  665. STDMETHOD(ReadBugCheckData)(
  666. THIS_
  667. OUT PULONG Code,
  668. OUT PULONG64 Arg1,
  669. OUT PULONG64 Arg2,
  670. OUT PULONG64 Arg3,
  671. OUT PULONG64 Arg4
  672. );
  673. STDMETHOD(GetNumberSupportedProcessorTypes)(
  674. THIS_
  675. OUT PULONG Number
  676. );
  677. STDMETHOD(GetSupportedProcessorTypes)(
  678. THIS_
  679. IN ULONG Start,
  680. IN ULONG Count,
  681. OUT PULONG Types
  682. );
  683. STDMETHOD(GetProcessorTypeNames)(
  684. THIS_
  685. IN ULONG Type,
  686. OUT OPTIONAL PSTR FullNameBuffer,
  687. IN ULONG FullNameBufferSize,
  688. OUT OPTIONAL PULONG FullNameSize,
  689. OUT OPTIONAL PSTR AbbrevNameBuffer,
  690. IN ULONG AbbrevNameBufferSize,
  691. OUT OPTIONAL PULONG AbbrevNameSize
  692. );
  693. STDMETHOD(GetEffectiveProcessorType)(
  694. THIS_
  695. OUT PULONG Type
  696. );
  697. STDMETHOD(SetEffectiveProcessorType)(
  698. THIS_
  699. IN ULONG Type
  700. );
  701. STDMETHOD(GetExecutionStatus)(
  702. THIS_
  703. OUT PULONG Status
  704. );
  705. STDMETHOD(SetExecutionStatus)(
  706. THIS_
  707. IN ULONG Status
  708. );
  709. STDMETHOD(GetCodeLevel)(
  710. THIS_
  711. OUT PULONG Level
  712. );
  713. STDMETHOD(SetCodeLevel)(
  714. THIS_
  715. IN ULONG Level
  716. );
  717. STDMETHOD(GetEngineOptions)(
  718. THIS_
  719. OUT PULONG Options
  720. );
  721. STDMETHOD(AddEngineOptions)(
  722. THIS_
  723. IN ULONG Options
  724. );
  725. STDMETHOD(RemoveEngineOptions)(
  726. THIS_
  727. IN ULONG Options
  728. );
  729. STDMETHOD(SetEngineOptions)(
  730. THIS_
  731. IN ULONG Options
  732. );
  733. STDMETHOD(GetSystemErrorControl)(
  734. THIS_
  735. OUT PULONG OutputLevel,
  736. OUT PULONG BreakLevel
  737. );
  738. STDMETHOD(SetSystemErrorControl)(
  739. THIS_
  740. IN ULONG OutputLevel,
  741. IN ULONG BreakLevel
  742. );
  743. STDMETHOD(GetTextMacro)(
  744. THIS_
  745. IN ULONG Slot,
  746. OUT OPTIONAL PSTR Buffer,
  747. IN ULONG BufferSize,
  748. OUT OPTIONAL PULONG MacroSize
  749. );
  750. STDMETHOD(SetTextMacro)(
  751. THIS_
  752. IN ULONG Slot,
  753. IN PCSTR Macro
  754. );
  755. STDMETHOD(GetRadix)(
  756. THIS_
  757. OUT PULONG Radix
  758. );
  759. STDMETHOD(SetRadix)(
  760. THIS_
  761. IN ULONG Radix
  762. );
  763. STDMETHOD(Evaluate)(
  764. THIS_
  765. IN PCSTR Expression,
  766. IN ULONG DesiredType,
  767. OUT PDEBUG_VALUE Value,
  768. OUT OPTIONAL PULONG RemainderIndex
  769. );
  770. STDMETHOD(CoerceValue)(
  771. THIS_
  772. IN PDEBUG_VALUE In,
  773. IN ULONG OutType,
  774. OUT PDEBUG_VALUE Out
  775. );
  776. STDMETHOD(CoerceValues)(
  777. THIS_
  778. IN ULONG Count,
  779. IN /* size_is(Count) */ PDEBUG_VALUE In,
  780. IN /* size_is(Count) */ PULONG OutTypes,
  781. OUT /* size_is(Count) */ PDEBUG_VALUE Out
  782. );
  783. STDMETHOD(Execute)(
  784. THIS_
  785. IN ULONG OutputControl,
  786. IN PCSTR Command,
  787. IN ULONG Flags
  788. );
  789. STDMETHOD(ExecuteCommandFile)(
  790. THIS_
  791. IN ULONG OutputControl,
  792. IN PCSTR CommandFile,
  793. IN ULONG Flags
  794. );
  795. STDMETHOD(GetNumberBreakpoints)(
  796. THIS_
  797. OUT PULONG Number
  798. );
  799. STDMETHOD(GetBreakpointByIndex)(
  800. THIS_
  801. IN ULONG Index,
  802. OUT PDEBUG_BREAKPOINT* Bp
  803. );
  804. STDMETHOD(GetBreakpointById)(
  805. THIS_
  806. IN ULONG Id,
  807. OUT PDEBUG_BREAKPOINT* Bp
  808. );
  809. STDMETHOD(GetBreakpointParameters)(
  810. THIS_
  811. IN ULONG Count,
  812. IN OPTIONAL /* size_is(Count) */ PULONG Ids,
  813. IN ULONG Start,
  814. OUT /* size_is(Count) */ PDEBUG_BREAKPOINT_PARAMETERS Params
  815. );
  816. STDMETHOD(AddBreakpoint)(
  817. THIS_
  818. IN ULONG Type,
  819. IN ULONG DesiredId,
  820. OUT PDEBUG_BREAKPOINT* Bp
  821. );
  822. STDMETHOD(RemoveBreakpoint)(
  823. THIS_
  824. IN PDEBUG_BREAKPOINT Bp
  825. );
  826. STDMETHOD(AddExtension)(
  827. THIS_
  828. IN PCSTR Path,
  829. IN ULONG Flags,
  830. OUT PULONG64 Handle
  831. );
  832. STDMETHOD(RemoveExtension)(
  833. THIS_
  834. IN ULONG64 Handle
  835. );
  836. STDMETHOD(GetExtensionByPath)(
  837. THIS_
  838. IN PCSTR Path,
  839. OUT PULONG64 Handle
  840. );
  841. STDMETHOD(CallExtension)(
  842. THIS_
  843. IN OPTIONAL ULONG64 Handle,
  844. IN PCSTR Function,
  845. IN OPTIONAL PCSTR Arguments
  846. );
  847. STDMETHOD(GetExtensionFunction)(
  848. THIS_
  849. IN ULONG64 Handle,
  850. IN PCSTR FuncName,
  851. OUT FARPROC* Function
  852. );
  853. STDMETHOD(GetWindbgExtensionApis32)(
  854. THIS_
  855. IN OUT PWINDBG_EXTENSION_APIS32 Api
  856. );
  857. STDMETHOD(GetWindbgExtensionApis64)(
  858. THIS_
  859. IN OUT PWINDBG_EXTENSION_APIS64 Api
  860. );
  861. STDMETHOD(GetNumberEventFilters)(
  862. THIS_
  863. OUT PULONG SpecificEvents,
  864. OUT PULONG SpecificExceptions,
  865. OUT PULONG ArbitraryExceptions
  866. );
  867. STDMETHOD(GetEventFilterText)(
  868. THIS_
  869. IN ULONG Index,
  870. OUT OPTIONAL PSTR Buffer,
  871. IN ULONG BufferSize,
  872. OUT OPTIONAL PULONG TextSize
  873. );
  874. STDMETHOD(GetEventFilterCommand)(
  875. THIS_
  876. IN ULONG Index,
  877. OUT OPTIONAL PSTR Buffer,
  878. IN ULONG BufferSize,
  879. OUT OPTIONAL PULONG CommandSize
  880. );
  881. STDMETHOD(SetEventFilterCommand)(
  882. THIS_
  883. IN ULONG Index,
  884. IN PCSTR Command
  885. );
  886. STDMETHOD(GetSpecificFilterParameters)(
  887. THIS_
  888. IN ULONG Start,
  889. IN ULONG Count,
  890. OUT /* size_is(Count) */ PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
  891. );
  892. STDMETHOD(SetSpecificFilterParameters)(
  893. THIS_
  894. IN ULONG Start,
  895. IN ULONG Count,
  896. IN /* size_is(Count) */ PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
  897. );
  898. STDMETHOD(GetSpecificFilterArgument)(
  899. THIS_
  900. IN ULONG Index,
  901. OUT OPTIONAL PSTR Buffer,
  902. IN ULONG BufferSize,
  903. OUT OPTIONAL PULONG ArgumentSize
  904. );
  905. STDMETHOD(SetSpecificFilterArgument)(
  906. THIS_
  907. IN ULONG Index,
  908. IN PCSTR Argument
  909. );
  910. STDMETHOD(GetExceptionFilterParameters)(
  911. THIS_
  912. IN ULONG Count,
  913. IN OPTIONAL /* size_is(Count) */ PULONG Codes,
  914. IN ULONG Start,
  915. OUT /* size_is(Count) */ PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
  916. );
  917. STDMETHOD(SetExceptionFilterParameters)(
  918. THIS_
  919. IN ULONG Count,
  920. IN /* size_is(Count) */ PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
  921. );
  922. STDMETHOD(GetExceptionFilterSecondCommand)(
  923. THIS_
  924. IN ULONG Index,
  925. OUT OPTIONAL PSTR Buffer,
  926. IN ULONG BufferSize,
  927. OUT OPTIONAL PULONG CommandSize
  928. );
  929. STDMETHOD(SetExceptionFilterSecondCommand)(
  930. THIS_
  931. IN ULONG Index,
  932. IN PCSTR Command
  933. );
  934. STDMETHOD(WaitForEvent)(
  935. THIS_
  936. IN ULONG Flags,
  937. IN ULONG Timeout
  938. );
  939. STDMETHOD(GetLastEventInformation)(
  940. THIS_
  941. PULONG Type,
  942. OUT PULONG ProcessId,
  943. OUT PULONG ThreadId,
  944. OUT OPTIONAL PVOID ExtraInformation,
  945. IN ULONG ExtraInformationSize,
  946. OUT OPTIONAL PULONG ExtraInformationUsed,
  947. OUT OPTIONAL PSTR Description,
  948. IN ULONG DescriptionSize,
  949. OUT OPTIONAL PULONG DescriptionUsed
  950. );
  951. STDMETHOD(GetCurrentTimeDate)(
  952. THIS_
  953. OUT PULONG TimeDate
  954. );
  955. STDMETHOD(GetCurrentSystemUpTime)(
  956. THIS_
  957. OUT PULONG UpTime
  958. );
  959. STDMETHOD(GetDumpFormatFlags)(
  960. THIS_
  961. OUT PULONG FormatFlags
  962. );
  963. STDMETHOD(GetNumberTextReplacements)(
  964. THIS_
  965. OUT PULONG NumRepl
  966. );
  967. STDMETHOD(GetTextReplacement)(
  968. THIS_
  969. IN OPTIONAL PCSTR SrcText,
  970. IN ULONG Index,
  971. OUT OPTIONAL PSTR SrcBuffer,
  972. IN ULONG SrcBufferSize,
  973. OUT OPTIONAL PULONG SrcSize,
  974. OUT OPTIONAL PSTR DstBuffer,
  975. IN ULONG DstBufferSize,
  976. OUT OPTIONAL PULONG DstSize
  977. );
  978. STDMETHOD(SetTextReplacement)(
  979. THIS_
  980. IN PCSTR SrcText,
  981. IN OPTIONAL PCSTR DstText
  982. );
  983. STDMETHOD(RemoveTextReplacements)(
  984. THIS
  985. );
  986. STDMETHOD(OutputTextReplacements)(
  987. THIS_
  988. IN ULONG OutputControl,
  989. IN ULONG Flags
  990. );
  991. // IDebugDataSpaces and IDebugDataSpaces2.
  992. STDMETHOD(ReadVirtual)(
  993. THIS_
  994. IN ULONG64 Offset,
  995. OUT PVOID Buffer,
  996. IN ULONG BufferSize,
  997. OUT OPTIONAL PULONG BytesRead
  998. );
  999. STDMETHOD(WriteVirtual)(
  1000. THIS_
  1001. IN ULONG64 Offset,
  1002. IN PVOID Buffer,
  1003. IN ULONG BufferSize,
  1004. OUT OPTIONAL PULONG BytesWritten
  1005. );
  1006. STDMETHOD(SearchVirtual)(
  1007. THIS_
  1008. IN ULONG64 Offset,
  1009. IN ULONG64 Length,
  1010. IN PVOID Pattern,
  1011. IN ULONG PatternSize,
  1012. IN ULONG PatternGranularity,
  1013. OUT PULONG64 MatchOffset
  1014. );
  1015. STDMETHOD(ReadVirtualUncached)(
  1016. THIS_
  1017. IN ULONG64 Offset,
  1018. OUT PVOID Buffer,
  1019. IN ULONG BufferSize,
  1020. OUT OPTIONAL PULONG BytesRead
  1021. );
  1022. STDMETHOD(WriteVirtualUncached)(
  1023. THIS_
  1024. IN ULONG64 Offset,
  1025. IN PVOID Buffer,
  1026. IN ULONG BufferSize,
  1027. OUT OPTIONAL PULONG BytesWritten
  1028. );
  1029. STDMETHOD(ReadPointersVirtual)(
  1030. THIS_
  1031. IN ULONG Count,
  1032. IN ULONG64 Offset,
  1033. OUT /* size_is(Count) */ PULONG64 Ptrs
  1034. );
  1035. STDMETHOD(WritePointersVirtual)(
  1036. THIS_
  1037. IN ULONG Count,
  1038. IN ULONG64 Offset,
  1039. IN /* size_is(Count) */ PULONG64 Ptrs
  1040. );
  1041. STDMETHOD(ReadPhysical)(
  1042. THIS_
  1043. IN ULONG64 Offset,
  1044. OUT PVOID Buffer,
  1045. IN ULONG BufferSize,
  1046. OUT OPTIONAL PULONG BytesRead
  1047. );
  1048. STDMETHOD(WritePhysical)(
  1049. THIS_
  1050. IN ULONG64 Offset,
  1051. IN PVOID Buffer,
  1052. IN ULONG BufferSize,
  1053. OUT OPTIONAL PULONG BytesWritten
  1054. );
  1055. STDMETHOD(ReadControl)(
  1056. THIS_
  1057. IN ULONG Processor,
  1058. IN ULONG64 Offset,
  1059. OUT PVOID Buffer,
  1060. IN ULONG BufferSize,
  1061. OUT OPTIONAL PULONG BytesRead
  1062. );
  1063. STDMETHOD(WriteControl)(
  1064. THIS_
  1065. IN ULONG Processor,
  1066. IN ULONG64 Offset,
  1067. IN PVOID Buffer,
  1068. IN ULONG BufferSize,
  1069. OUT OPTIONAL PULONG BytesWritten
  1070. );
  1071. STDMETHOD(ReadIo)(
  1072. THIS_
  1073. IN ULONG InterfaceType,
  1074. IN ULONG BusNumber,
  1075. IN ULONG AddressSpace,
  1076. IN ULONG64 Offset,
  1077. OUT PVOID Buffer,
  1078. IN ULONG BufferSize,
  1079. OUT OPTIONAL PULONG BytesRead
  1080. );
  1081. STDMETHOD(WriteIo)(
  1082. THIS_
  1083. IN ULONG InterfaceType,
  1084. IN ULONG BusNumber,
  1085. IN ULONG AddressSpace,
  1086. IN ULONG64 Offset,
  1087. IN PVOID Buffer,
  1088. IN ULONG BufferSize,
  1089. OUT OPTIONAL PULONG BytesWritten
  1090. );
  1091. STDMETHOD(ReadMsr)(
  1092. THIS_
  1093. IN ULONG Msr,
  1094. OUT PULONG64 Value
  1095. );
  1096. STDMETHOD(WriteMsr)(
  1097. THIS_
  1098. IN ULONG Msr,
  1099. IN ULONG64 Value
  1100. );
  1101. STDMETHOD(ReadBusData)(
  1102. THIS_
  1103. IN ULONG BusDataType,
  1104. IN ULONG BusNumber,
  1105. IN ULONG SlotNumber,
  1106. IN ULONG Offset,
  1107. OUT PVOID Buffer,
  1108. IN ULONG BufferSize,
  1109. OUT OPTIONAL PULONG BytesRead
  1110. );
  1111. STDMETHOD(WriteBusData)(
  1112. THIS_
  1113. IN ULONG BusDataType,
  1114. IN ULONG BusNumber,
  1115. IN ULONG SlotNumber,
  1116. IN ULONG Offset,
  1117. IN PVOID Buffer,
  1118. IN ULONG BufferSize,
  1119. OUT OPTIONAL PULONG BytesWritten
  1120. );
  1121. STDMETHOD(CheckLowMemory)(
  1122. THIS
  1123. );
  1124. STDMETHOD(ReadDebuggerData)(
  1125. THIS_
  1126. IN ULONG Index,
  1127. OUT PVOID Buffer,
  1128. IN ULONG BufferSize,
  1129. OUT OPTIONAL PULONG BytesRead
  1130. );
  1131. STDMETHOD(ReadProcessorSystemData)(
  1132. THIS_
  1133. IN ULONG Processor,
  1134. IN ULONG Index,
  1135. OUT PVOID Buffer,
  1136. IN ULONG BufferSize,
  1137. OUT OPTIONAL PULONG BytesRead
  1138. );
  1139. STDMETHOD(VirtualToPhysical)(
  1140. THIS_
  1141. IN ULONG64 Virtual,
  1142. OUT PULONG64 Physical
  1143. );
  1144. STDMETHOD(GetVirtualTranslationPhysicalOffsets)(
  1145. THIS_
  1146. IN ULONG64 Virtual,
  1147. OUT OPTIONAL /* size_is(OffsetsSize) */ PULONG64 Offsets,
  1148. IN ULONG OffsetsSize,
  1149. OUT OPTIONAL PULONG Levels
  1150. );
  1151. STDMETHOD(ReadHandleData)(
  1152. THIS_
  1153. IN ULONG64 Handle,
  1154. IN ULONG DataType,
  1155. OUT OPTIONAL PVOID Buffer,
  1156. IN ULONG BufferSize,
  1157. OUT OPTIONAL PULONG DataSize
  1158. );
  1159. STDMETHOD(FillVirtual)(
  1160. THIS_
  1161. IN ULONG64 Start,
  1162. IN ULONG Size,
  1163. IN PVOID Pattern,
  1164. IN ULONG PatternSize,
  1165. OUT OPTIONAL PULONG Filled
  1166. );
  1167. STDMETHOD(FillPhysical)(
  1168. THIS_
  1169. IN ULONG64 Start,
  1170. IN ULONG Size,
  1171. IN PVOID Pattern,
  1172. IN ULONG PatternSize,
  1173. OUT OPTIONAL PULONG Filled
  1174. );
  1175. STDMETHOD(QueryVirtual)(
  1176. THIS_
  1177. IN ULONG64 Offset,
  1178. OUT PMEMORY_BASIC_INFORMATION64 Info
  1179. );
  1180. // IDebugRegisters.
  1181. STDMETHOD(GetNumberRegisters)(
  1182. THIS_
  1183. OUT PULONG Number
  1184. );
  1185. STDMETHOD(GetDescription)(
  1186. THIS_
  1187. IN ULONG Register,
  1188. OUT OPTIONAL PSTR NameBuffer,
  1189. IN ULONG NameBufferSize,
  1190. OUT OPTIONAL PULONG NameSize,
  1191. OUT OPTIONAL PDEBUG_REGISTER_DESCRIPTION Desc
  1192. );
  1193. STDMETHOD(GetIndexByName)(
  1194. THIS_
  1195. IN PCSTR Name,
  1196. OUT PULONG Index
  1197. );
  1198. STDMETHOD(GetValue)(
  1199. THIS_
  1200. IN ULONG Register,
  1201. OUT PDEBUG_VALUE Value
  1202. );
  1203. STDMETHOD(SetValue)(
  1204. THIS_
  1205. IN ULONG Register,
  1206. IN PDEBUG_VALUE Value
  1207. );
  1208. STDMETHOD(GetValues)(
  1209. THIS_
  1210. IN ULONG Count,
  1211. IN OPTIONAL PULONG Indices,
  1212. IN ULONG Start,
  1213. OUT PDEBUG_VALUE Values
  1214. );
  1215. STDMETHOD(SetValues)(
  1216. THIS_
  1217. IN ULONG Count,
  1218. IN OPTIONAL PULONG Indices,
  1219. IN ULONG Start,
  1220. IN PDEBUG_VALUE Values
  1221. );
  1222. STDMETHOD(OutputRegisters)(
  1223. THIS_
  1224. IN ULONG OutputControl,
  1225. IN ULONG Flags
  1226. );
  1227. STDMETHOD(GetInstructionOffset)(
  1228. THIS_
  1229. OUT PULONG64 Offset
  1230. );
  1231. STDMETHOD(GetStackOffset)(
  1232. THIS_
  1233. OUT PULONG64 Offset
  1234. );
  1235. STDMETHOD(GetFrameOffset)(
  1236. THIS_
  1237. OUT PULONG64 Offset
  1238. );
  1239. // IDebugSymbols and IDebugSymbols2.
  1240. STDMETHOD(GetSymbolOptions)(
  1241. THIS_
  1242. OUT PULONG Options
  1243. );
  1244. STDMETHOD(AddSymbolOptions)(
  1245. THIS_
  1246. IN ULONG Options
  1247. );
  1248. STDMETHOD(RemoveSymbolOptions)(
  1249. THIS_
  1250. IN ULONG Options
  1251. );
  1252. STDMETHOD(SetSymbolOptions)(
  1253. THIS_
  1254. IN ULONG Options
  1255. );
  1256. STDMETHOD(GetNameByOffset)(
  1257. THIS_
  1258. IN ULONG64 Offset,
  1259. OUT OPTIONAL PSTR NameBuffer,
  1260. IN ULONG NameBufferSize,
  1261. OUT OPTIONAL PULONG NameSize,
  1262. OUT OPTIONAL PULONG64 Displacement
  1263. );
  1264. STDMETHOD(GetOffsetByName)(
  1265. THIS_
  1266. IN PCSTR Symbol,
  1267. OUT PULONG64 Offset
  1268. );
  1269. STDMETHOD(GetNearNameByOffset)(
  1270. THIS_
  1271. IN ULONG64 Offset,
  1272. IN LONG Delta,
  1273. OUT OPTIONAL PSTR NameBuffer,
  1274. IN ULONG NameBufferSize,
  1275. OUT OPTIONAL PULONG NameSize,
  1276. OUT OPTIONAL PULONG64 Displacement
  1277. );
  1278. STDMETHOD(GetLineByOffset)(
  1279. THIS_
  1280. IN ULONG64 Offset,
  1281. OUT PULONG Line,
  1282. OUT OPTIONAL PSTR FileBuffer,
  1283. IN ULONG FileBufferSize,
  1284. OUT OPTIONAL PULONG FileSize,
  1285. OUT OPTIONAL PULONG64 Displacement
  1286. );
  1287. STDMETHOD(GetOffsetByLine)(
  1288. THIS_
  1289. IN ULONG Line,
  1290. IN PCSTR File,
  1291. OUT PULONG64 Offset
  1292. );
  1293. STDMETHOD(GetNumberModules)(
  1294. THIS_
  1295. OUT PULONG Loaded,
  1296. OUT PULONG Unloaded
  1297. );
  1298. STDMETHOD(GetModuleByIndex)(
  1299. THIS_
  1300. IN ULONG Index,
  1301. OUT PULONG64 Base
  1302. );
  1303. STDMETHOD(GetModuleByModuleName)(
  1304. THIS_
  1305. IN PCSTR Name,
  1306. IN ULONG StartIndex,
  1307. OUT OPTIONAL PULONG Index,
  1308. OUT OPTIONAL PULONG64 Base
  1309. );
  1310. STDMETHOD(GetModuleByOffset)(
  1311. THIS_
  1312. IN ULONG64 Offset,
  1313. IN ULONG StartIndex,
  1314. OUT OPTIONAL PULONG Index,
  1315. OUT OPTIONAL PULONG64 Base
  1316. );
  1317. STDMETHOD(GetModuleNames)(
  1318. THIS_
  1319. IN ULONG Index,
  1320. IN ULONG64 Base,
  1321. OUT OPTIONAL PSTR ImageNameBuffer,
  1322. IN ULONG ImageNameBufferSize,
  1323. OUT OPTIONAL PULONG ImageNameSize,
  1324. OUT OPTIONAL PSTR ModuleNameBuffer,
  1325. IN ULONG ModuleNameBufferSize,
  1326. OUT OPTIONAL PULONG ModuleNameSize,
  1327. OUT OPTIONAL PSTR LoadedImageNameBuffer,
  1328. IN ULONG LoadedImageNameBufferSize,
  1329. OUT OPTIONAL PULONG LoadedImageNameSize
  1330. );
  1331. STDMETHOD(GetModuleParameters)(
  1332. THIS_
  1333. IN ULONG Count,
  1334. IN OPTIONAL /* size_is(Count) */ PULONG64 Bases,
  1335. IN ULONG Start,
  1336. OUT /* size_is(Count) */ PDEBUG_MODULE_PARAMETERS Params
  1337. );
  1338. STDMETHOD(GetSymbolModule)(
  1339. THIS_
  1340. IN PCSTR Symbol,
  1341. OUT PULONG64 Base
  1342. );
  1343. STDMETHOD(GetTypeName)(
  1344. THIS_
  1345. IN ULONG64 Module,
  1346. IN ULONG TypeId,
  1347. OUT OPTIONAL PSTR NameBuffer,
  1348. IN ULONG NameBufferSize,
  1349. OUT OPTIONAL PULONG NameSize
  1350. );
  1351. STDMETHOD(GetTypeId)(
  1352. THIS_
  1353. IN ULONG64 Module,
  1354. IN PCSTR Name,
  1355. OUT PULONG TypeId
  1356. );
  1357. STDMETHOD(GetTypeSize)(
  1358. THIS_
  1359. IN ULONG64 Module,
  1360. IN ULONG TypeId,
  1361. OUT PULONG Size
  1362. );
  1363. STDMETHOD(GetFieldOffset)(
  1364. THIS_
  1365. IN ULONG64 Module,
  1366. IN ULONG TypeId,
  1367. IN PCSTR Field,
  1368. OUT PULONG Offset
  1369. );
  1370. STDMETHOD(GetSymbolTypeId)(
  1371. THIS_
  1372. IN PCSTR Symbol,
  1373. OUT PULONG TypeId,
  1374. OUT OPTIONAL PULONG64 Module
  1375. );
  1376. STDMETHOD(GetOffsetTypeId)(
  1377. THIS_
  1378. IN ULONG64 Offset,
  1379. OUT PULONG TypeId,
  1380. OUT OPTIONAL PULONG64 Module
  1381. );
  1382. STDMETHOD(ReadTypedDataVirtual)(
  1383. THIS_
  1384. IN ULONG64 Offset,
  1385. IN ULONG64 Module,
  1386. IN ULONG TypeId,
  1387. OUT PVOID Buffer,
  1388. IN ULONG BufferSize,
  1389. OUT OPTIONAL PULONG BytesRead
  1390. );
  1391. STDMETHOD(WriteTypedDataVirtual)(
  1392. THIS_
  1393. IN ULONG64 Offset,
  1394. IN ULONG64 Module,
  1395. IN ULONG TypeId,
  1396. IN PVOID Buffer,
  1397. IN ULONG BufferSize,
  1398. OUT OPTIONAL PULONG BytesWritten
  1399. );
  1400. STDMETHOD(OutputTypedDataVirtual)(
  1401. THIS_
  1402. IN ULONG OutputControl,
  1403. IN ULONG64 Offset,
  1404. IN ULONG64 Module,
  1405. IN ULONG TypeId,
  1406. IN ULONG Flags
  1407. );
  1408. STDMETHOD(ReadTypedDataPhysical)(
  1409. THIS_
  1410. IN ULONG64 Offset,
  1411. IN ULONG64 Module,
  1412. IN ULONG TypeId,
  1413. OUT PVOID Buffer,
  1414. IN ULONG BufferSize,
  1415. OUT OPTIONAL PULONG BytesRead
  1416. );
  1417. STDMETHOD(WriteTypedDataPhysical)(
  1418. THIS_
  1419. IN ULONG64 Offset,
  1420. IN ULONG64 Module,
  1421. IN ULONG TypeId,
  1422. IN PVOID Buffer,
  1423. IN ULONG BufferSize,
  1424. OUT OPTIONAL PULONG BytesWritten
  1425. );
  1426. STDMETHOD(OutputTypedDataPhysical)(
  1427. THIS_
  1428. IN ULONG OutputControl,
  1429. IN ULONG64 Offset,
  1430. IN ULONG64 Module,
  1431. IN ULONG TypeId,
  1432. IN ULONG Flags
  1433. );
  1434. STDMETHOD(GetScope)(
  1435. THIS_
  1436. OUT OPTIONAL PULONG64 InstructionOffset,
  1437. OUT OPTIONAL PDEBUG_STACK_FRAME ScopeFrame,
  1438. OUT OPTIONAL PVOID ScopeContext,
  1439. IN ULONG ScopeContextSize
  1440. );
  1441. STDMETHOD(SetScope)(
  1442. THIS_
  1443. IN ULONG64 InstructionOffset,
  1444. IN OPTIONAL PDEBUG_STACK_FRAME ScopeFrame,
  1445. IN OPTIONAL PVOID ScopeContext,
  1446. IN ULONG ScopeContextSize
  1447. );
  1448. STDMETHOD(ResetScope)(
  1449. THIS
  1450. );
  1451. STDMETHOD(GetScopeSymbolGroup)(
  1452. THIS_
  1453. IN ULONG Flags,
  1454. IN OPTIONAL PDEBUG_SYMBOL_GROUP Update,
  1455. OUT PDEBUG_SYMBOL_GROUP* Symbols
  1456. );
  1457. STDMETHOD(CreateSymbolGroup)(
  1458. THIS_
  1459. OUT PDEBUG_SYMBOL_GROUP* Group
  1460. );
  1461. STDMETHOD(StartSymbolMatch)(
  1462. THIS_
  1463. IN PCSTR Pattern,
  1464. OUT PULONG64 Handle
  1465. );
  1466. STDMETHOD(GetNextSymbolMatch)(
  1467. THIS_
  1468. IN ULONG64 Handle,
  1469. OUT OPTIONAL PSTR Buffer,
  1470. IN ULONG BufferSize,
  1471. OUT OPTIONAL PULONG MatchSize,
  1472. OUT OPTIONAL PULONG64 Offset
  1473. );
  1474. STDMETHOD(EndSymbolMatch)(
  1475. THIS_
  1476. IN ULONG64 Handle
  1477. );
  1478. STDMETHOD(Reload)(
  1479. THIS_
  1480. IN PCSTR Module
  1481. );
  1482. STDMETHOD(GetSymbolPath)(
  1483. THIS_
  1484. OUT OPTIONAL PSTR Buffer,
  1485. IN ULONG BufferSize,
  1486. OUT OPTIONAL PULONG PathSize
  1487. );
  1488. STDMETHOD(SetSymbolPath)(
  1489. THIS_
  1490. IN PCSTR Path
  1491. );
  1492. STDMETHOD(AppendSymbolPath)(
  1493. THIS_
  1494. IN PCSTR Addition
  1495. );
  1496. STDMETHOD(GetImagePath)(
  1497. THIS_
  1498. OUT OPTIONAL PSTR Buffer,
  1499. IN ULONG BufferSize,
  1500. OUT OPTIONAL PULONG PathSize
  1501. );
  1502. STDMETHOD(SetImagePath)(
  1503. THIS_
  1504. IN PCSTR Path
  1505. );
  1506. STDMETHOD(AppendImagePath)(
  1507. THIS_
  1508. IN PCSTR Addition
  1509. );
  1510. STDMETHOD(GetSourcePath)(
  1511. THIS_
  1512. OUT OPTIONAL PSTR Buffer,
  1513. IN ULONG BufferSize,
  1514. OUT OPTIONAL PULONG PathSize
  1515. );
  1516. STDMETHOD(GetSourcePathElement)(
  1517. THIS_
  1518. IN ULONG Index,
  1519. OUT OPTIONAL PSTR Buffer,
  1520. IN ULONG BufferSize,
  1521. OUT OPTIONAL PULONG PathSize
  1522. );
  1523. STDMETHOD(SetSourcePath)(
  1524. THIS_
  1525. IN PCSTR Path
  1526. );
  1527. STDMETHOD(AppendSourcePath)(
  1528. THIS_
  1529. IN PCSTR Addition
  1530. );
  1531. STDMETHOD(FindSourceFile)(
  1532. THIS_
  1533. IN ULONG StartElement,
  1534. IN PCSTR File,
  1535. IN ULONG Flags,
  1536. OUT OPTIONAL PULONG FoundElement,
  1537. OUT OPTIONAL PSTR Buffer,
  1538. IN ULONG BufferSize,
  1539. OUT OPTIONAL PULONG FoundSize
  1540. );
  1541. STDMETHOD(GetSourceFileLineOffsets)(
  1542. THIS_
  1543. IN PCSTR File,
  1544. OUT OPTIONAL PULONG64 Buffer,
  1545. IN ULONG BufferLines,
  1546. OUT OPTIONAL PULONG FileLines
  1547. );
  1548. STDMETHOD(GetModuleVersionInformation)(
  1549. THIS_
  1550. IN ULONG Index,
  1551. IN ULONG64 Base,
  1552. IN PCSTR Item,
  1553. OUT OPTIONAL PVOID Buffer,
  1554. IN ULONG BufferSize,
  1555. OUT OPTIONAL PULONG VerInfoSize
  1556. );
  1557. STDMETHOD(GetModuleNameString)(
  1558. THIS_
  1559. IN ULONG Which,
  1560. IN ULONG Index,
  1561. IN ULONG64 Base,
  1562. OUT OPTIONAL PSTR Buffer,
  1563. IN ULONG BufferSize,
  1564. OUT OPTIONAL PULONG NameSize
  1565. );
  1566. STDMETHOD(GetConstantName)(
  1567. THIS_
  1568. IN ULONG64 Module,
  1569. IN ULONG TypeId,
  1570. IN ULONG64 Value,
  1571. OUT OPTIONAL PSTR NameBuffer,
  1572. IN ULONG NameBufferSize,
  1573. OUT OPTIONAL PULONG NameSize
  1574. );
  1575. STDMETHOD(GetFieldName)(
  1576. THIS_
  1577. IN ULONG64 Module,
  1578. IN ULONG TypeId,
  1579. IN ULONG FieldIndex,
  1580. OUT OPTIONAL PSTR NameBuffer,
  1581. IN ULONG NameBufferSize,
  1582. OUT OPTIONAL PULONG NameSize
  1583. );
  1584. STDMETHOD(GetTypeOptions)(
  1585. THIS_
  1586. OUT PULONG Options
  1587. );
  1588. STDMETHOD(SetTypeOptions)(
  1589. THIS_
  1590. IN ULONG Options
  1591. );
  1592. STDMETHOD(AddTypeOptions)(
  1593. THIS_
  1594. IN ULONG Options
  1595. );
  1596. STDMETHOD(RemoveTypeOptions)(
  1597. THIS_
  1598. IN ULONG Options
  1599. );
  1600. // IDebugSystemObjects.
  1601. STDMETHOD(GetEventThread)(
  1602. THIS_
  1603. OUT PULONG Id
  1604. );
  1605. STDMETHOD(GetEventProcess)(
  1606. THIS_
  1607. OUT PULONG Id
  1608. );
  1609. STDMETHOD(GetCurrentThreadId)(
  1610. THIS_
  1611. OUT PULONG Id
  1612. );
  1613. STDMETHOD(SetCurrentThreadId)(
  1614. THIS_
  1615. IN ULONG Id
  1616. );
  1617. STDMETHOD(GetCurrentProcessId)(
  1618. THIS_
  1619. OUT PULONG Id
  1620. );
  1621. STDMETHOD(SetCurrentProcessId)(
  1622. THIS_
  1623. IN ULONG Id
  1624. );
  1625. STDMETHOD(GetNumberThreads)(
  1626. THIS_
  1627. OUT PULONG Number
  1628. );
  1629. STDMETHOD(GetTotalNumberThreads)(
  1630. THIS_
  1631. OUT PULONG Total,
  1632. OUT PULONG LargestProcess
  1633. );
  1634. STDMETHOD(GetThreadIdsByIndex)(
  1635. THIS_
  1636. IN ULONG Start,
  1637. IN ULONG Count,
  1638. OUT OPTIONAL /* size_is(Count) */ PULONG Ids,
  1639. OUT OPTIONAL /* size_is(Count) */ PULONG SysIds
  1640. );
  1641. STDMETHOD(GetThreadIdByProcessor)(
  1642. THIS_
  1643. IN ULONG Processor,
  1644. OUT PULONG Id
  1645. );
  1646. STDMETHOD(GetCurrentThreadDataOffset)(
  1647. THIS_
  1648. OUT PULONG64 Offset
  1649. );
  1650. STDMETHOD(GetThreadIdByDataOffset)(
  1651. THIS_
  1652. IN ULONG64 Offset,
  1653. OUT PULONG Id
  1654. );
  1655. STDMETHOD(GetCurrentThreadTeb)(
  1656. THIS_
  1657. OUT PULONG64 Offset
  1658. );
  1659. STDMETHOD(GetThreadIdByTeb)(
  1660. THIS_
  1661. IN ULONG64 Offset,
  1662. OUT PULONG Id
  1663. );
  1664. STDMETHOD(GetCurrentThreadSystemId)(
  1665. THIS_
  1666. OUT PULONG SysId
  1667. );
  1668. STDMETHOD(GetThreadIdBySystemId)(
  1669. THIS_
  1670. IN ULONG SysId,
  1671. OUT PULONG Id
  1672. );
  1673. STDMETHOD(GetCurrentThreadHandle)(
  1674. THIS_
  1675. OUT PULONG64 Handle
  1676. );
  1677. STDMETHOD(GetThreadIdByHandle)(
  1678. THIS_
  1679. IN ULONG64 Handle,
  1680. OUT PULONG Id
  1681. );
  1682. STDMETHOD(GetNumberProcesses)(
  1683. THIS_
  1684. OUT PULONG Number
  1685. );
  1686. STDMETHOD(GetProcessIdsByIndex)(
  1687. THIS_
  1688. IN ULONG Start,
  1689. IN ULONG Count,
  1690. OUT OPTIONAL /* size_is(Count) */ PULONG Ids,
  1691. OUT OPTIONAL /* size_is(Count) */ PULONG SysIds
  1692. );
  1693. STDMETHOD(GetCurrentProcessDataOffset)(
  1694. THIS_
  1695. OUT PULONG64 Offset
  1696. );
  1697. STDMETHOD(GetProcessIdByDataOffset)(
  1698. THIS_
  1699. IN ULONG64 Offset,
  1700. OUT PULONG Id
  1701. );
  1702. STDMETHOD(GetCurrentProcessPeb)(
  1703. THIS_
  1704. OUT PULONG64 Offset
  1705. );
  1706. STDMETHOD(GetProcessIdByPeb)(
  1707. THIS_
  1708. IN ULONG64 Offset,
  1709. OUT PULONG Id
  1710. );
  1711. STDMETHOD(GetCurrentProcessSystemId)(
  1712. THIS_
  1713. OUT PULONG SysId
  1714. );
  1715. STDMETHOD(GetProcessIdBySystemId)(
  1716. THIS_
  1717. IN ULONG SysId,
  1718. OUT PULONG Id
  1719. );
  1720. STDMETHOD(GetCurrentProcessHandle)(
  1721. THIS_
  1722. OUT PULONG64 Handle
  1723. );
  1724. STDMETHOD(GetProcessIdByHandle)(
  1725. THIS_
  1726. IN ULONG64 Handle,
  1727. OUT PULONG Id
  1728. );
  1729. STDMETHOD(GetCurrentProcessExecutableName)(
  1730. THIS_
  1731. OUT OPTIONAL PSTR Buffer,
  1732. IN ULONG BufferSize,
  1733. OUT OPTIONAL PULONG ExeSize
  1734. );
  1735. // IDebugSystemObjects2.
  1736. STDMETHOD(GetCurrentProcessUpTime)(
  1737. THIS_
  1738. OUT PULONG UpTime
  1739. );
  1740. STDMETHOD(GetImplicitThreadDataOffset)(
  1741. THIS_
  1742. OUT PULONG64 Offset
  1743. );
  1744. STDMETHOD(SetImplicitThreadDataOffset)(
  1745. THIS_
  1746. IN ULONG64 Offset
  1747. );
  1748. STDMETHOD(GetImplicitProcessDataOffset)(
  1749. THIS_
  1750. OUT PULONG64 Offset
  1751. );
  1752. STDMETHOD(SetImplicitProcessDataOffset)(
  1753. THIS_
  1754. IN ULONG64 Offset
  1755. );
  1756. // DbgRpcClientObject.
  1757. virtual HRESULT Initialize(PSTR Identity, PVOID* Interface);
  1758. virtual void Finalize(void);
  1759. virtual void Uninitialize(void);
  1760. //------------------------------------------------------------------------
  1761. // General.
  1762. HRESULT Initialize(void);
  1763. void InitializePrimary(void);
  1764. void Link(void);
  1765. void Unlink(void);
  1766. DebugClient* m_Next;
  1767. DebugClient* m_Prev;
  1768. ULONG m_Refs;
  1769. ULONG m_Flags;
  1770. ULONG m_ThreadId;
  1771. HANDLE m_Thread;
  1772. char m_Identity[DBGRPC_MAX_IDENTITY];
  1773. time_t m_LastActivity;
  1774. PDEBUG_EVENT_CALLBACKS m_EventCb;
  1775. ULONG m_EventInterest;
  1776. HANDLE m_DispatchSema;
  1777. PDEBUG_INPUT_CALLBACKS m_InputCb;
  1778. ULONG m_InputSequence;
  1779. PDEBUG_OUTPUT_CALLBACKS m_OutputCb;
  1780. ULONG m_OutMask;
  1781. ULONG m_OutputWidth;
  1782. PCSTR m_OutputLinePrefix;
  1783. };
  1784. ULONG GetExecutionStatus(void);
  1785. HRESULT SetExecutionStatus(ULONG Status);
  1786. HRESULT Execute(DebugClient* Client, PCSTR Command, ULONG Flags);
  1787. HRESULT ExecuteCommandFile(DebugClient* Client, PCSTR File, ULONG Flags);
  1788. HRESULT LiveKernelInitialize(DebugClient* Client, ULONG Qual, PCSTR Options);
  1789. HRESULT UserInitialize(DebugClient* Client, ULONG64 Server);
  1790. HRESULT InitializeTarget();
  1791. HRESULT InitializeMachine(ULONG Machine);
  1792. void DiscardTarget(ULONG Reason);
  1793. void DiscardMachine(ULONG Reason);
  1794. void GetClientIdentity(PSTR Identity);
  1795. #endif // #ifndef __DBGCLT_HPP__