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.

89 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. LogStartAndStop.cpp
  5. Abstract:
  6. This DLL just adds start and stop messages to the verifier log
  7. Notes:
  8. This is a general purpose shim.
  9. History:
  10. 06/05/2001 dmunsil Created
  11. --*/
  12. #include "precomp.h"
  13. IMPLEMENT_SHIM_BEGIN(LogStartAndStop)
  14. #include "ShimHookMacro.h"
  15. APIHOOK_ENUM_BEGIN
  16. APIHOOK_ENUM_END
  17. //
  18. // verifier log entries
  19. //
  20. BEGIN_DEFINE_VERIFIER_LOG(LogStartAndStop)
  21. VERIFIER_LOG_ENTRY(VLOG_APP_STARTED)
  22. VERIFIER_LOG_ENTRY(VLOG_APP_STOPPED)
  23. END_DEFINE_VERIFIER_LOG(LogStartAndStop)
  24. INIT_VERIFIER_LOG(LogStartAndStop);
  25. BOOL
  26. NOTIFY_FUNCTION(
  27. DWORD fdwReason
  28. )
  29. {
  30. if (fdwReason == SHIM_STATIC_DLLS_INITIALIZED) {
  31. VLOG(VLOG_LEVEL_INFO, VLOG_APP_STARTED, "The application started.");
  32. } else if (fdwReason == DLL_PROCESS_DETACH) {
  33. VLOG(VLOG_LEVEL_INFO, VLOG_APP_STOPPED, "The application stopped.");
  34. }
  35. return TRUE;
  36. }
  37. SHIM_INFO_BEGIN()
  38. SHIM_INFO_DESCRIPTION(AVS_LOGSTARTANDSTOP_DESC)
  39. SHIM_INFO_FRIENDLY_NAME(AVS_LOGSTARTANDSTOP_FRIENDLY)
  40. SHIM_INFO_VERSION(1, 2)
  41. SHIM_INFO_FLAGS(AVRF_FLAG_NO_WIN2K)
  42. SHIM_INFO_END()
  43. /*++
  44. Register hooked functions
  45. --*/
  46. HOOK_BEGIN
  47. DUMP_VERIFIER_LOG_ENTRY(VLOG_APP_STARTED,
  48. AVS_APP_STARTED,
  49. AVS_APP_STARTED_R,
  50. AVS_APP_STARTED_URL)
  51. DUMP_VERIFIER_LOG_ENTRY(VLOG_APP_STOPPED,
  52. AVS_APP_STOPPED,
  53. AVS_APP_STOPPED_R,
  54. AVS_APP_STOPPED_URL)
  55. CALL_NOTIFY_FUNCTION
  56. HOOK_END
  57. IMPLEMENT_SHIM_END