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.

147 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1991-2001 Microsoft Corporation
  3. Module Name:
  4. erwatch.h
  5. Abstract:
  6. This module contains the code to report pending watchdog timeout
  7. events at logon after dirty reboot.
  8. Author:
  9. Michael Maciesowicz (mmacie) 29-May-2001
  10. Environment:
  11. User mode at logon.
  12. Revision History:
  13. --*/
  14. //#ifndef _ERWATCH_H_
  15. //#define _ERWATCH_H_
  16. //
  17. // Localizable string IDs.
  18. //
  19. #define IDS_000 100
  20. #define IDS_001 101
  21. #define IDS_002 102
  22. #define IDS_003 103
  23. #define IDS_004 104
  24. #define IDS_005 105
  25. //
  26. // Constants used by erwatch.cpp.
  27. //
  28. #define ER_WD_MAX_RETRY 100
  29. #define ER_WD_MAX_NAME_LENGTH 255
  30. #define ER_WD_MAX_DATA_SIZE 4096
  31. #define ER_WD_MAX_STRING 1024
  32. #define ER_WD_MAX_FILE_INFO_LENGTH 255
  33. #define ER_WD_MAX_URL_LENGTH 255
  34. #define ER_WD_LANG_ENGLISH 0x0409
  35. #define ER_WD_DISABLE_BUGCHECK_FLAG 0x01
  36. #define ER_WD_DEBUGGER_NOT_PRESENT_FLAG 0x02
  37. #define ER_WD_BUGCHECK_TRIGGERED_FLAG 0x04
  38. //
  39. // Data types.
  40. //
  41. typedef struct _ER_WD_LANG_AND_CODE_PAGE
  42. {
  43. USHORT Language;
  44. USHORT CodePage;
  45. } ER_WD_LANG_AND_CODE_PAGE, *PER_WD_LANG_AND_CODE_PAGE;
  46. typedef struct _ER_WD_DRIVER_INFO
  47. {
  48. WCHAR DriverName[MAX_PATH];
  49. VS_FIXEDFILEINFO FixedFileInfo;
  50. WCHAR Comments[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  51. WCHAR CompanyName[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  52. WCHAR FileDescription[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  53. WCHAR FileVersion[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  54. WCHAR InternalName[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  55. WCHAR LegalCopyright[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  56. WCHAR LegalTrademarks[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  57. WCHAR OriginalFilename[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  58. WCHAR PrivateBuild[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  59. WCHAR ProductName[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  60. WCHAR ProductVersion[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  61. WCHAR SpecialBuild[ER_WD_MAX_FILE_INFO_LENGTH + 1];
  62. } ER_WD_DRIVER_INFO, *PER_WD_DRIVER_INFO;
  63. typedef struct _ER_WD_PCI_ID
  64. {
  65. USHORT VendorId;
  66. USHORT DeviceId;
  67. UCHAR Revision;
  68. ULONG SubsystemId;
  69. } ER_WD_PCI_ID, *PER_WD_PCI_ID;
  70. //
  71. // Prototypes of routines supplied by erwatch.cpp.
  72. //
  73. HANDLE
  74. CreateWatchdogEventFile(
  75. IN PWSTR FileName
  76. );
  77. BOOL
  78. CreateWatchdogEventFileName(
  79. OUT PWSTR FileName
  80. );
  81. USHORT
  82. GenerateSignature(
  83. IN PER_WD_PCI_ID PciId,
  84. IN PER_WD_DRIVER_INFO DriverInfo
  85. );
  86. UCHAR
  87. GetFlags(
  88. IN HKEY Key
  89. );
  90. VOID
  91. GetDriverInfo(
  92. IN HKEY Key,
  93. IN OPTIONAL PWCHAR Extension,
  94. OUT PER_WD_DRIVER_INFO DriverInfo
  95. );
  96. VOID
  97. GetPciId(
  98. IN HKEY Key,
  99. OUT PER_WD_PCI_ID PciId
  100. );
  101. BOOL
  102. SaveWatchdogEventData(
  103. IN HANDLE FileHandle,
  104. IN HKEY Key,
  105. IN PER_WD_DRIVER_INFO DriverInfo
  106. );
  107. BOOL
  108. WatchdogEventHandler(
  109. IN BOOL NotifyPcHealth
  110. );
  111. BOOL
  112. WriteWatchdogEventFile(
  113. IN HANDLE FileHandle,
  114. IN PWSTR String
  115. );
  116. //#endif // _ERWATCH_H_