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.

122 lines
3.0 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntiolog.h
  5. Abstract:
  6. Constant definitions for the I/O error code log values.
  7. Author:
  8. Jeff Havens (jhavens) 21-Aug-1991
  9. Revision History:
  10. --*/
  11. #ifndef _NTIOLOG_
  12. #define _NTIOLOG_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. //
  20. // For reference here only. Defined in io.h
  21. //
  22. #define IO_TYPE_ERROR_LOG 0x0000000b
  23. #define IO_TYPE_ERROR_MESSAGE 0x0000000c
  24. // begin_ntddk begin_wdm begin_nthal begin_ntndis
  25. //
  26. // Define I/O Driver error log packet structure. This structure is filled in
  27. // by the driver.
  28. //
  29. typedef struct _IO_ERROR_LOG_PACKET {
  30. UCHAR MajorFunctionCode;
  31. UCHAR RetryCount;
  32. USHORT DumpDataSize;
  33. USHORT NumberOfStrings;
  34. USHORT StringOffset;
  35. USHORT EventCategory;
  36. NTSTATUS ErrorCode;
  37. ULONG UniqueErrorValue;
  38. NTSTATUS FinalStatus;
  39. ULONG SequenceNumber;
  40. ULONG IoControlCode;
  41. LARGE_INTEGER DeviceOffset;
  42. ULONG DumpData[1];
  43. }IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET;
  44. //
  45. // Define the I/O error log message. This message is sent by the error log
  46. // thread over the lpc port.
  47. //
  48. typedef struct _IO_ERROR_LOG_MESSAGE {
  49. USHORT Type;
  50. USHORT Size;
  51. USHORT DriverNameLength;
  52. LARGE_INTEGER TimeStamp;
  53. ULONG DriverNameOffset;
  54. IO_ERROR_LOG_PACKET EntryData;
  55. }IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE;
  56. //
  57. // Define the maximum message size that will be sent over the LPC to the
  58. // application reading the error log entries.
  59. //
  60. //
  61. // Regardless of LPC size restrictions, ERROR_LOG_MAXIMUM_SIZE must remain
  62. // a value that can fit in a UCHAR.
  63. //
  64. #define ERROR_LOG_LIMIT_SIZE (256-16)
  65. //
  66. // This limit, exclusive of IO_ERROR_LOG_MESSAGE_HEADER_LENGTH, also applies
  67. // to IO_ERROR_LOG_MESSAGE_LENGTH
  68. //
  69. #define IO_ERROR_LOG_MESSAGE_HEADER_LENGTH (sizeof(IO_ERROR_LOG_MESSAGE) - \
  70. sizeof(IO_ERROR_LOG_PACKET) + \
  71. (sizeof(WCHAR) * 40))
  72. #define ERROR_LOG_MESSAGE_LIMIT_SIZE \
  73. (ERROR_LOG_LIMIT_SIZE + IO_ERROR_LOG_MESSAGE_HEADER_LENGTH)
  74. //
  75. // IO_ERROR_LOG_MESSAGE_LENGTH is
  76. // min(PORT_MAXIMUM_MESSAGE_LENGTH, ERROR_LOG_MESSAGE_LIMIT_SIZE)
  77. //
  78. #define IO_ERROR_LOG_MESSAGE_LENGTH \
  79. ((PORT_MAXIMUM_MESSAGE_LENGTH > ERROR_LOG_MESSAGE_LIMIT_SIZE) ? \
  80. ERROR_LOG_MESSAGE_LIMIT_SIZE : \
  81. PORT_MAXIMUM_MESSAGE_LENGTH)
  82. //
  83. // Define the maximum packet size a driver can allocate.
  84. //
  85. #define ERROR_LOG_MAXIMUM_SIZE (IO_ERROR_LOG_MESSAGE_LENGTH - \
  86. IO_ERROR_LOG_MESSAGE_HEADER_LENGTH)
  87. // end_ntddk end_wdm end_nthal end_ntndis
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91. #endif // _NTIOLOG_