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.

99 lines
2.3 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Console input and output.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999-2000.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __CONIO_HPP__
  9. #define __CONIO_HPP__
  10. class DefInputCallbacks :
  11. public IDebugInputCallbacks
  12. {
  13. public:
  14. // IUnknown.
  15. STDMETHOD(QueryInterface)(
  16. THIS_
  17. IN REFIID InterfaceId,
  18. OUT PVOID* Interface
  19. );
  20. STDMETHOD_(ULONG, AddRef)(
  21. THIS
  22. );
  23. STDMETHOD_(ULONG, Release)(
  24. THIS
  25. );
  26. };
  27. class ConInputCallbacks : public DefInputCallbacks
  28. {
  29. public:
  30. // IDebugInputCallbacks.
  31. STDMETHOD(StartInput)(
  32. THIS_
  33. IN ULONG BufferSize
  34. );
  35. STDMETHOD(EndInput)(
  36. THIS
  37. );
  38. };
  39. class DefOutputCallbacks :
  40. public IDebugOutputCallbacks
  41. {
  42. public:
  43. // IUnknown.
  44. STDMETHOD(QueryInterface)(
  45. THIS_
  46. IN REFIID InterfaceId,
  47. OUT PVOID* Interface
  48. );
  49. STDMETHOD_(ULONG, AddRef)(
  50. THIS
  51. );
  52. STDMETHOD_(ULONG, Release)(
  53. THIS
  54. );
  55. };
  56. class ConOutputCallbacks : public DefOutputCallbacks
  57. {
  58. public:
  59. // IDebugOutputCallbacks.
  60. STDMETHOD(Output)(
  61. THIS_
  62. IN ULONG Mask,
  63. IN PCSTR Text
  64. );
  65. };
  66. // Maximum command string. DbgPrompt has a limit of 512
  67. // characters so that would be one potential limit. We
  68. // have users who want to use longer command lines, though,
  69. // such as Autodump which scripts the debugger with very long
  70. // sx commands. The other obvious limit is MAX_SYMBOL_LEN
  71. // since it makes sense that you should be able to give a
  72. // command with a full symbol name, so use that.
  73. #define MAX_COMMAND 4096
  74. #define MAX_DBG_PROMPT_COMMAND 512
  75. extern HANDLE g_ConInput, g_ConOutput;
  76. extern HANDLE g_PromptInput;
  77. extern HANDLE g_PipeWrite;
  78. extern ConInputCallbacks g_ConInputCb;
  79. extern ConOutputCallbacks g_ConOutputCb;
  80. extern IDebugClient* g_ConClient;
  81. extern IDebugControl* g_ConControl;
  82. void InitializeIo(PCSTR InputFile);
  83. void CreateConsole(void);
  84. BOOL ConIn(PSTR Buffer, ULONG BufferSize, BOOL Wait);
  85. void ConOut(PCSTR Format, ...);
  86. void ConOutStr(PCSTR Str);
  87. void DECLSPEC_NORETURN ExitDebugger(ULONG Code);
  88. void DECLSPEC_NORETURN ErrorExit(PCSTR Format, ...);
  89. void CreateInputThread(void);
  90. #endif // #ifndef __CONIO_HPP__