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.

79 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. WinFaxPro9.cpp
  5. Abstract:
  6. Use QueryServiceStatus instead of ControlService if ControlService is
  7. called for SERVICE_CONTROL_INTERROGATE.
  8. No idea why this works on NT4.
  9. Notes:
  10. This is an app specific shim.
  11. History:
  12. 02/16/2000 clupu Created
  13. --*/
  14. #include "precomp.h"
  15. IMPLEMENT_SHIM_BEGIN(WinFaxPro9)
  16. #include "ShimHookMacro.h"
  17. APIHOOK_ENUM_BEGIN
  18. APIHOOK_ENUM_ENTRY(ControlService)
  19. APIHOOK_ENUM_END
  20. /*++
  21. Use QueryServiceStatus instead of ControlService if ControlService is
  22. called for SERVICE_CONTROL_INTERROGATE.
  23. --*/
  24. BOOL
  25. APIHOOK(ControlService)(
  26. SC_HANDLE hService,
  27. DWORD dwControl,
  28. LPSERVICE_STATUS lpServiceStatus
  29. )
  30. {
  31. if (dwControl == SERVICE_CONTROL_INTERROGATE) {
  32. DPFN(
  33. eDbgLevelWarning,
  34. "[ControlService] calling QueryServiceStatus instead of ControlService.\n");
  35. return QueryServiceStatus(hService, lpServiceStatus);
  36. } else {
  37. return ORIGINAL_API(ControlService)(
  38. hService,
  39. dwControl,
  40. lpServiceStatus);
  41. }
  42. }
  43. /*++
  44. Register hooked functions
  45. --*/
  46. HOOK_BEGIN
  47. APIHOOK_ENTRY(ADVAPI32.DLL, ControlService)
  48. HOOK_END
  49. IMPLEMENT_SHIM_END