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.

115 lines
3.4 KiB

  1. //
  2. // Copyright (R) 1999-2000 Microsoft Corporation. All rights reserved.
  3. //
  4. // PURPOSE:
  5. // File contains declarations for the Watchdog Timer Driver
  6. // for the Windows-based Server Appliance.
  7. //
  8. // This driver reads and writes to the underlying watchdog timer
  9. // hardware. It receives pings from higher level software and
  10. // then resets the hardware counter to keep the machine from
  11. // being re-booted when the counter rolls over.
  12. //
  13. // File Name: SaWatchdogIoctl.h
  14. // Contents:
  15. //
  16. // Definitions of IOCTL codes and data
  17. // structures exported by SAWATCHDOGDRIVER.
  18. //
  19. #ifndef __SAWATCHDOG_IOCTL__
  20. #define __SAWATCHDOG_IOCTL__
  21. //
  22. // Header files
  23. //
  24. // (None)
  25. //
  26. // IOCTL control codes
  27. //
  28. ///////////////////////////////////////////////
  29. // GET_VERSION
  30. //
  31. #define IOCTL_SAWATCHDOG_GET_VERSION \
  32. CTL_CODE( FILE_DEVICE_UNKNOWN, 0x801, \
  33. METHOD_BUFFERED, FILE_ANY_ACCESS )
  34. //
  35. // Structures used by the IOCTL codes
  36. //
  37. typedef struct _SAWD_GET_VER_OUT_BUFF {
  38. DWORD Version;
  39. } SAWD_GET_VER_OUT_BUFF, *PSAWD_GET_VER_OUT_BUFF;
  40. //
  41. // version bits
  42. //
  43. #ifndef VERSION_INFO
  44. #define VERSION_INFO
  45. #define VERSION1 0x1
  46. #define VERSION2 0x2
  47. #define VERSION3 0x4
  48. #define VERSION4 0x8
  49. #define VERSION5 0x10
  50. #define VERSION6 0x20
  51. #define VESRION7 0x40
  52. #define VESRION8 0x80
  53. #define THIS_VERSION VERSION2
  54. #endif //#ifndef VERSION_INFO
  55. ///////////////////////////////////////////////
  56. // GET_CAPABILTY
  57. // Returns a DWORD with bits indicating capabilities.
  58. #define IOCTL_SAWD_GET_CAPABILITY \
  59. CTL_CODE( FILE_DEVICE_UNKNOWN, 0x802, \
  60. METHOD_BUFFERED, FILE_ANY_ACCESS )
  61. //
  62. // Structures used by this IOCTL code
  63. //
  64. typedef struct _SAWD_CAPABILITY_OUT_BUFF {
  65. DWORD Version; // version of interface used
  66. DWORD Capability; // bit field indicating capabilities
  67. DWORD min; // minimum value in msecs
  68. DWORD max; // maximum value in msecs
  69. } SAWD_CAPABILITY_OUT_BUFF, *PSAWD_CAPABILITY_OUT_BUFF;
  70. //
  71. // capability bit masks
  72. //
  73. #define DISABLABLE 0x1 // Can watchdog timer be disabled/enabled?
  74. #define SHUTDOWNABLE 0x2 // Can watchdog shutdown computer?
  75. /////////////////////////////////////////////////////////////////////
  76. // Write structure to the Watchdog Timer ( in particular, to "ping" it )
  77. //
  78. // Pinging is a simple write to the device. All output information
  79. // required is obtained in the status returned.
  80. //
  81. // Low level device implementers are encouraged, where performance
  82. // would benefit, to keep the last value of Holdoff and results of any
  83. // calculations based upon it in the device extension. The value of
  84. // Holdoff will typically be unchanged from one call to the next.
  85. //
  86. typedef struct _SAWD_PING {
  87. DWORD Version; // version of interface used
  88. DWORD Flags; // flags defined below
  89. DWORD Holdoff; // number of milliseconds to delay firing.
  90. } SAWD_PING , *PSAWD_PING;
  91. // writing to the timer with the DISABLE_WD cleared enables the timer.
  92. // If DISABLE_WD is set, then the timer is disabled.
  93. #define DISABLE_WD 0x01
  94. //writing to the timer with SHUTDOWN_WD will shutdown computer.
  95. //If SHUTDOWN_WD is set, after Holdoff milliseconds, computer will be
  96. //shutdowned
  97. #define SHUTDOWN_WD 0x02
  98. // undefined bits of Flags field are reserved and must be zero
  99. // STATUS_INVALID_PARAMETER is returned if reserved bits are not 0.
  100. #endif // __SAWATCHDOG_IOCTL__