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.

124 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. wd.h
  5. Abstract:
  6. This is the NT Watchdog driver implementation.
  7. Author:
  8. Michael Maciesowicz (mmacie) 05-May-2000
  9. Environment:
  10. Kernel mode only.
  11. Notes:
  12. Revision History:
  13. --*/
  14. #ifndef _WD_H_
  15. #define _WD_H_
  16. #include "ntddk.h"
  17. #include "watchdog.h"
  18. #define WD_MAX_WAIT ((LONG)((ULONG)(-1) / 4))
  19. #define WD_KEY_WATCHDOG L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Watchdog"
  20. #define WD_KEY_WATCHDOG_DISPLAY L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Watchdog\\Display"
  21. #define WD_KEY_RELIABILITY L"\\Registry\\Machine\\Software\\Microsoft\\Windows\\CurrentVersion\\Reliability"
  22. #define WD_TAG 'godW' // Wdog
  23. #define WD_MAX_PROPERTY_SIZE 4096
  24. //
  25. // Define default configuration values - these can be overwriten via registry
  26. // in RTL_REGISTRY_CONTROL\Watchdog\DeviceClass key.
  27. //
  28. #define WD_DEFAULT_TRAP_ONCE 0
  29. #define WD_DEFAULT_DISABLE_BUGCHECK 0
  30. #define WD_DEFAULT_BREAK_POINT_DELAY 0
  31. #if DBG
  32. #define WD_DBG_SUSPENDED_WARNING(pWd, szRoutine) \
  33. { \
  34. if ((pWd)->SuspendCount) \
  35. { \
  36. DbgPrint("watchdog!%s: WARNING! Called while suspended!\n", (szRoutine)); \
  37. DbgPrint("watchdog!%s: Watchdog %p\n", (szRoutine), (pWd)); \
  38. } \
  39. }
  40. #else
  41. #define WD_DBG_SUSPENDED_WARNING(pWd, szRoutine) NULL
  42. #endif // DBG
  43. #define ASSERT_WATCHDOG_OBJECT(pWd) \
  44. ASSERT((NULL != (pWd)) && \
  45. (WdStandardWatchdog == ((PWATCHDOG_OBJECT)(pWd))->ObjectType) || \
  46. (WdDeferredWatchdog == ((PWATCHDOG_OBJECT)(pWd))->ObjectType))
  47. NTSTATUS
  48. DriverEntry(
  49. IN PDRIVER_OBJECT pDriverObject,
  50. IN PUNICODE_STRING wszRegistryPath
  51. );
  52. VOID
  53. WdDeferredWatchdogDpcCallback(
  54. IN PKDPC pDpc,
  55. IN PVOID pDeferredContext,
  56. IN PVOID pSystemArgument1,
  57. IN PVOID pSystemArgument2
  58. );
  59. NTSTATUS
  60. WdFlushRegistryKey(
  61. IN PVOID pWatch,
  62. IN PCWSTR pwszKeyName
  63. );
  64. VOID
  65. WdInitializeObject(
  66. IN PVOID pWatch,
  67. IN PDEVICE_OBJECT pDeviceObject,
  68. IN WD_OBJECT_TYPE objectType,
  69. IN WD_TIME_TYPE timeType,
  70. IN ULONG ulTag
  71. );
  72. VOID
  73. WdRemoveObject(
  74. IN PVOID pWatch
  75. );
  76. VOID
  77. WdWatchdogDpcCallback(
  78. IN PKDPC pDpc,
  79. IN PVOID pDeferredContext,
  80. IN PVOID pSystemArgument1,
  81. IN PVOID pSystemArgument2
  82. );
  83. //
  84. // Internal ntos API (this is declared in ntifs.h but it's hard to include it here).
  85. //
  86. // TODO: Fix it later.
  87. //
  88. PDEVICE_OBJECT
  89. IoGetDeviceAttachmentBaseRef(
  90. IN PDEVICE_OBJECT pDeviceObject
  91. );
  92. #endif // _WD_H_