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.

63 lines
1.3 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Output capturing support.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2001.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __OUTCAP_HPP__
  9. #define __OUTCAP_HPP__
  10. //
  11. // Output callback implementation which feeds into the
  12. // output capture buffer.
  13. //
  14. class CaptureOutputCallbacks : public IDebugOutputCallbacks
  15. {
  16. public:
  17. CaptureOutputCallbacks(void);
  18. // IUnknown.
  19. STDMETHOD(QueryInterface)(
  20. THIS_
  21. IN REFIID InterfaceId,
  22. OUT PVOID* Interface
  23. );
  24. STDMETHOD_(ULONG, AddRef)(
  25. THIS
  26. );
  27. STDMETHOD_(ULONG, Release)(
  28. THIS
  29. );
  30. // IDebugOutputCallbacks.
  31. STDMETHOD(Output)(
  32. THIS_
  33. IN ULONG Mask,
  34. IN PCSTR Text
  35. );
  36. void Reset(void)
  37. {
  38. m_Insert = m_TextBuffer;
  39. if (m_Insert)
  40. {
  41. *m_Insert = 0;
  42. }
  43. }
  44. PSTR GetCapturedText(void)
  45. {
  46. return m_TextBuffer;
  47. }
  48. protected:
  49. PSTR m_TextBuffer;
  50. ULONG m_TextBufferSize;
  51. PSTR m_Insert;
  52. };
  53. extern CaptureOutputCallbacks g_OutCapCb;
  54. HRESULT CaptureCommandOutput(PSTR Command);
  55. #endif // #ifndef __OUTCAP_HPP__