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.

195 lines
7.5 KiB

  1. /*++
  2. Copyright (c) 1991 - 2001 Microsoft Corporation
  3. Module Name:
  4. ### ### #### ##### ## ##
  5. ## # ### ## ## ## ## ##
  6. ### ## ## ## ## ## ## ##
  7. ### ## ## ## ## ## #######
  8. ### ####### ## ## ## ## ##
  9. # ## ## ## ## ## ## ## ## ##
  10. ### ## ## #### ##### ## ## ##
  11. Abstract:
  12. This header contains all definitions necessary
  13. for user mode and kernel mode components to
  14. communicate with the server availability driver stack.
  15. Author:
  16. Wesley Witt (wesw) 1-Oct-2001
  17. Environment:
  18. Kernel mode and user mode both.
  19. Notes:
  20. --*/
  21. #ifndef _SAIO_
  22. #define _SAIO_
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. //
  27. // Current inteface version
  28. //
  29. #define SA_INTERFACE_VERSION 0x00000004
  30. //
  31. // Device name strings
  32. //
  33. #define SA_DEVICE_DISPLAY_NAME_STRING L"\\Device\\ServerAvailabilityLocalDisplay"
  34. #define SA_DEVICE_KEYPAD_NAME_STRING L"\\Device\\ServerAvailabilityKeypad"
  35. #define SA_DEVICE_NVRAM_NAME_STRING L"\\Device\\ServerAvailabilityNvram"
  36. #define SA_DEVICE_WATCHDOG_NAME_STRING L"\\Device\\ServerAvailabilityWatchdog"
  37. //
  38. // Device types
  39. //
  40. #define SA_DEVICE_UNKNOWN (0)
  41. #define SA_DEVICE_DISPLAY (1)
  42. #define SA_DEVICE_KEYPAD (2)
  43. #define SA_DEVICE_NVRAM (3)
  44. #define SA_DEVICE_WATCHDOG (4)
  45. //
  46. // All IOCTL codes & definitions
  47. //
  48. #define FILE_DEVICE_SERVER_AVAILABILITY ((ULONG) 'A')
  49. #define IOCTL_SERVERAVAILABILITY_BASE 0x800
  50. #define SA_IOCTL(FUNC_CODE) CTL_CODE(FILE_DEVICE_SERVER_AVAILABILITY, FUNC_CODE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  51. #define FUNC_SA_GET_VERSION (IOCTL_SERVERAVAILABILITY_BASE+0)
  52. #define FUNC_SA_GET_CAPABILITIES (IOCTL_SERVERAVAILABILITY_BASE+1)
  53. #define FUNC_SAWD_DISABLE (IOCTL_SERVERAVAILABILITY_BASE+2)
  54. #define FUNC_SAWD_QUERY_EXPIRE_BEHAVIOR (IOCTL_SERVERAVAILABILITY_BASE+3)
  55. #define FUNC_SAWD_SET_EXPIRE_BEHAVIOR (IOCTL_SERVERAVAILABILITY_BASE+4)
  56. #define FUNC_SAWD_PING (IOCTL_SERVERAVAILABILITY_BASE+5)
  57. #define FUNC_SAWD_QUERY_TIMER (IOCTL_SERVERAVAILABILITY_BASE+6)
  58. #define FUNC_SAWD_SET_TIMER (IOCTL_SERVERAVAILABILITY_BASE+7)
  59. #define FUNC_SAWD_DELAY_BOOT (IOCTL_SERVERAVAILABILITY_BASE+8)
  60. #define FUNC_NVRAM_WRITE_BOOT_COUNTER (IOCTL_SERVERAVAILABILITY_BASE+9)
  61. #define FUNC_NVRAM_READ_BOOT_COUNTER (IOCTL_SERVERAVAILABILITY_BASE+10)
  62. #define FUNC_SADISPLAY_LOCK (IOCTL_SERVERAVAILABILITY_BASE+12)
  63. #define FUNC_SADISPLAY_UNLOCK (IOCTL_SERVERAVAILABILITY_BASE+13)
  64. #define FUNC_SADISPLAY_BUSY_MESSAGE (IOCTL_SERVERAVAILABILITY_BASE+14)
  65. #define FUNC_SADISPLAY_SHUTDOWN_MESSAGE (IOCTL_SERVERAVAILABILITY_BASE+15)
  66. #define FUNC_SADISPLAY_CHANGE_LANGUAGE (IOCTL_SERVERAVAILABILITY_BASE+16)
  67. #define FUNC_DISPLAY_STORE_BITMAP (IOCTL_SERVERAVAILABILITY_BASE+17)
  68. #define FUNC_SA_LAST (IOCTL_SERVERAVAILABILITY_BASE+31)
  69. #define IOCTL_SA_GET_VERSION SA_IOCTL(FUNC_SA_GET_VERSION)
  70. #define IOCTL_SA_GET_CAPABILITIES SA_IOCTL(FUNC_SA_GET_CAPABILITIES)
  71. #define IOCTL_SAWD_DISABLE SA_IOCTL(FUNC_SAWD_DISABLE)
  72. #define IOCTL_SAWD_QUERY_EXPIRE_BEHAVIOR SA_IOCTL(FUNC_SAWD_QUERY_EXPIRE_BEHAVIOR)
  73. #define IOCTL_SAWD_SET_EXPIRE_BEHAVIOR SA_IOCTL(FUNC_SAWD_SET_EXPIRE_BEHAVIOR)
  74. #define IOCTL_SAWD_PING SA_IOCTL(FUNC_SAWD_PING)
  75. #define IOCTL_SAWD_QUERY_TIMER SA_IOCTL(FUNC_SAWD_QUERY_TIMER)
  76. #define IOCTL_SAWD_SET_TIMER SA_IOCTL(FUNC_SAWD_SET_TIMER)
  77. #define IOCTL_NVRAM_WRITE_BOOT_COUNTER SA_IOCTL(FUNC_NVRAM_WRITE_BOOT_COUNTER)
  78. #define IOCTL_NVRAM_READ_BOOT_COUNTER SA_IOCTL(FUNC_NVRAM_READ_BOOT_COUNTER)
  79. #define IOCTL_SADISPLAY_LOCK SA_IOCTL(FUNC_SADISPLAY_LOCK)
  80. #define IOCTL_SADISPLAY_UNLOCK SA_IOCTL(FUNC_SADISPLAY_UNLOCK)
  81. #define IOCTL_SADISPLAY_BUSY_MESSAGE SA_IOCTL(FUNC_SADISPLAY_BUSY_MESSAGE)
  82. #define IOCTL_SADISPLAY_SHUTDOWN_MESSAGE SA_IOCTL(FUNC_SADISPLAY_SHUTDOWN_MESSAGE)
  83. #define IOCTL_SADISPLAY_CHANGE_LANGUAGE SA_IOCTL(FUNC_SADISPLAY_CHANGE_LANGUAGE)
  84. #define IOCTL_FUNC_DISPLAY_STORE_BITMAP SA_IOCTL(FUNC_DISPLAY_STORE_BITMAP)
  85. //
  86. // Structure defintions for IOCTL interfaces
  87. //
  88. #define SA_DISPLAY_TYPE_LED 0x0001
  89. #define SA_DISPLAY_TYPE_CHARACTER_LCD 0x0002
  90. #define SA_DISPLAY_TYPE_BIT_MAPPED_LCD 0x0004
  91. #define SA_DISPLAY_CHAR_ASCII 0x0001
  92. #define SA_DISPLAY_CHAR_UNICODE 0x0002
  93. typedef struct _SA_DISPLAY_CAPS {
  94. ULONG SizeOfStruct;
  95. USHORT DisplayType;
  96. USHORT CharacterSet;
  97. USHORT DisplayHeight;
  98. USHORT DisplayWidth;
  99. } SA_DISPLAY_CAPS, *PSA_DISPLAY_CAPS;
  100. #define SA_DISPLAY_MAX_WIDTH 128
  101. #define SA_DISPLAY_MAX_HEIGHT 128
  102. #define SA_DISPLAY_MAX_BITMAP_SIZE (SA_DISPLAY_MAX_WIDTH * SA_DISPLAY_MAX_HEIGHT)
  103. #define SA_DISPLAY_READY 0x00000001 // OS is running normally
  104. #define SA_DISPLAY_SHUTTING_DOWN 0x00000002 // OS is shutting down
  105. #define SA_DISPLAY_NET_ERR 0x00000004 // LAN error
  106. #define SA_DISPLAY_HW_ERR 0x00000008 // general hardware error
  107. #define SA_DISPLAY_CHECK_DISK 0x00000010 // autochk.exe is running
  108. #define SA_DISPLAY_BACKUP_DISK 0x00000020 // disk backup in progress
  109. #define SA_DISPLAY_NEW_TAPE 0x00000040 // new tape media required
  110. #define SA_DISPLAY_NEW_DISK 0x00000080 // new disk media required
  111. #define SA_DISPLAY_STARTING 0x00000100 // OS is booting
  112. #define SA_DISPLAY_WAN_CONNECTED 0x00000200 // connected to ISP
  113. #define SA_DISPLAY_WAN_ERR 0x00000400 // WAN error, e.g. no dial tone
  114. #define SA_DISPLAY_DISK_ERR 0x00000800 // disk error, e.g. dirty bit set
  115. #define SA_DISPLAY_ADD_START_TASKS 0x00001000 // additional startup tasks running, e.g. autochk, sw update
  116. typedef struct _SA_DISPLAY_SHOW_MESSAGE {
  117. ULONG SizeOfStruct;
  118. ULONG MsgCode;
  119. USHORT Width;
  120. USHORT Height;
  121. UCHAR Bits[SA_DISPLAY_MAX_BITMAP_SIZE];
  122. } SA_DISPLAY_SHOW_MESSAGE, *PSA_DISPLAY_SHOW_MESSAGE;
  123. #define SA_KEYPAD_UP 0x00000001
  124. #define SA_KEYPAD_DOWN 0x00000002
  125. #define SA_KEYPAD_LEFT 0x00000004
  126. #define SA_KEYPAD_RIGHT 0x00000008
  127. #define SA_KEYPAD_CANCEL 0x00000010
  128. #define SA_KEYPAD_SELECT 0x00000020
  129. #define SA_NVRAM_MINIMUM_SIZE 32
  130. #define SA_NVRAM_MAXIMUM_SIZE 128
  131. typedef struct _SA_NVRAM_CAPS {
  132. ULONG SizeOfStruct;
  133. USHORT NvramSize;
  134. } SA_NVRAM_CAPS, *PSA_NVRAM_CAPS;
  135. typedef struct _SA_NVRAM_BOOT_COUNTER {
  136. ULONG SizeOfStruct;
  137. ULONG Number;
  138. ULONG Value;
  139. ULONG DeviceId;
  140. } SA_NVRAM_BOOT_COUNTER, *PSA_NVRAM_BOOT_COUNTER;
  141. typedef struct _SA_WD_CAPS {
  142. ULONG SizeOfStruct;
  143. USHORT Minimum;
  144. USHORT Maximum;
  145. } SA_WD_CAPS, *PSA_WD_CAPS;
  146. #ifdef __cplusplus
  147. }
  148. #endif
  149. #endif /* _SAIO_ */