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.

79 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. IgnoreDebugOutput.cpp
  5. Abstract:
  6. If an app tries to output debug strings, throws them on the floor to improve
  7. perf.
  8. Notes:
  9. This shim is general purpose and emulates Win9x behavior (at least it
  10. emulates the behavior when there's no debugger attached).
  11. History:
  12. 05/10/2000 dmunsil Created
  13. --*/
  14. #include "precomp.h"
  15. IMPLEMENT_SHIM_BEGIN(IgnoreDebugOutput)
  16. #include "ShimHookMacro.h"
  17. APIHOOK_ENUM_BEGIN
  18. APIHOOK_ENUM_ENTRY(OutputDebugStringA)
  19. APIHOOK_ENUM_ENTRY(OutputDebugStringW)
  20. APIHOOK_ENUM_END
  21. /*++
  22. This stub function throws away all debug strings
  23. --*/
  24. VOID
  25. APIHOOK(OutputDebugStringA)(
  26. LPCSTR lpOutputString
  27. )
  28. {
  29. return;
  30. }
  31. /*++
  32. This stub function throws away all debug strings
  33. --*/
  34. VOID
  35. APIHOOK(OutputDebugStringW)(
  36. LPCWSTR lpOutputString
  37. )
  38. {
  39. return;
  40. }
  41. /*++
  42. Register hooked functions
  43. --*/
  44. HOOK_BEGIN
  45. APIHOOK_ENTRY(KERNEL32.DLL, OutputDebugStringA)
  46. APIHOOK_ENTRY(KERNEL32.DLL, OutputDebugStringW)
  47. HOOK_END
  48. IMPLEMENT_SHIM_END