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.

69 lines
1.3 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // stdio-based output callbacks class.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000.
  6. //
  7. //----------------------------------------------------------------------------
  8. #include <stdio.h>
  9. #include <windows.h>
  10. #include <dbgeng.h>
  11. #include "out.hpp"
  12. StdioOutputCallbacks g_OutputCb;
  13. STDMETHODIMP
  14. StdioOutputCallbacks::QueryInterface(
  15. THIS_
  16. IN REFIID InterfaceId,
  17. OUT PVOID* Interface
  18. )
  19. {
  20. *Interface = NULL;
  21. if (IsEqualIID(InterfaceId, __uuidof(IUnknown)) ||
  22. IsEqualIID(InterfaceId, __uuidof(IDebugOutputCallbacks)))
  23. {
  24. *Interface = (IDebugOutputCallbacks *)this;
  25. AddRef();
  26. return S_OK;
  27. }
  28. else
  29. {
  30. return E_NOINTERFACE;
  31. }
  32. }
  33. STDMETHODIMP_(ULONG)
  34. StdioOutputCallbacks::AddRef(
  35. THIS
  36. )
  37. {
  38. // This class is designed to be static so
  39. // there's no true refcount.
  40. return 1;
  41. }
  42. STDMETHODIMP_(ULONG)
  43. StdioOutputCallbacks::Release(
  44. THIS
  45. )
  46. {
  47. // This class is designed to be static so
  48. // there's no true refcount.
  49. return 0;
  50. }
  51. STDMETHODIMP
  52. StdioOutputCallbacks::Output(
  53. THIS_
  54. IN ULONG Mask,
  55. IN PCSTR Text
  56. )
  57. {
  58. UNREFERENCED_PARAMETER(Mask);
  59. fputs(Text, stdout);
  60. return S_OK;
  61. }