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.

159 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. errlog.h (Generic Error Logging v1.0)
  5. Abstract:
  6. This module implements the generic error logging.
  7. Author:
  8. Ali E. Turkoglu (aliTu) 24-Jan-2002
  9. Revision History:
  10. ---
  11. --*/
  12. #ifndef _ERRLOG_H_
  13. #define _ERRLOG_H_
  14. //
  15. // Forwarders
  16. //
  17. typedef struct _UL_INTERNAL_REQUEST *PUL_INTERNAL_REQUEST;
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Global definitions
  21. //
  22. ///////////////////////////////////////////////////////////////////////////////
  23. //
  24. // Special value to show protol status is not available
  25. //
  26. #define UL_PROTOCOL_STATUS_NA (0)
  27. #define MAX_LOG_INFO_FIELD_LEN (1024)
  28. //
  29. // Lookaside list allocated err log info buffer.
  30. //
  31. typedef struct _UL_ERROR_LOG_BUFFER
  32. {
  33. SLIST_ENTRY LookasideEntry; // Must be the 1st element in the struct
  34. ULONG Signature; // Must be UL_ERROR_LOG_BUFFER_POOL_TAG.
  35. BOOLEAN IsFromLookaside; // True if allocation is from lookaside
  36. ULONG Used; // How much of the buffer is used
  37. PUCHAR pBuffer; // Points to directly after the struct
  38. } UL_ERROR_LOG_BUFFER, *PUL_ERROR_LOG_BUFFER;
  39. #define IS_VALID_ERROR_LOG_BUFFER( entry ) \
  40. ( (entry) != NULL && \
  41. (entry)->Signature == UL_ERROR_LOG_BUFFER_POOL_TAG )
  42. typedef struct _UL_ERROR_LOG_INFO
  43. {
  44. //
  45. // Request context is usefull for parse errors.
  46. //
  47. PUL_INTERNAL_REQUEST pRequest;
  48. //
  49. // Connection context is for timeouts etc ...
  50. //
  51. PUL_HTTP_CONNECTION pHttpConn;
  52. //
  53. // Depending of the type of the error, additional
  54. // information provided by the caller.
  55. //
  56. PCHAR pInfo;
  57. USHORT InfoSize; // In bytes
  58. //
  59. // Protocol status if available. If not it should be
  60. // zero.
  61. //
  62. USHORT ProtocolStatus;
  63. //
  64. // The temp logging buffer to hold the log record
  65. // until the actual error log lock is acquired.
  66. //
  67. PUL_ERROR_LOG_BUFFER pErrorLogBuffer;
  68. } UL_ERROR_LOG_INFO, *PUL_ERROR_LOG_INFO;
  69. #define IS_VALID_ERROR_LOG_INFO(pInfo) (pInfo != NULL)
  70. ///////////////////////////////////////////////////////////////////////////////
  71. //
  72. // Exported functions
  73. //
  74. ///////////////////////////////////////////////////////////////////////////////
  75. NTSTATUS
  76. UlInitializeErrorLog(
  77. VOID
  78. );
  79. VOID
  80. UlTerminateErrorLog(
  81. VOID
  82. );
  83. BOOLEAN
  84. UlErrorLoggingEnabled(
  85. VOID
  86. );
  87. NTSTATUS
  88. UlBuildErrorLoggingDirStr(
  89. IN PCWSTR pSrc,
  90. OUT PUNICODE_STRING pDir
  91. );
  92. NTSTATUS
  93. UlCheckErrorLogConfig(
  94. IN PHTTP_ERROR_LOGGING_CONFIG pUserConfig
  95. );
  96. NTSTATUS
  97. UlConfigErrorLogEntry(
  98. IN PHTTP_ERROR_LOGGING_CONFIG pUserConfig
  99. );
  100. VOID
  101. UlCloseErrorLogEntry(
  102. VOID
  103. );
  104. NTSTATUS
  105. UlLogHttpError(
  106. IN PUL_ERROR_LOG_INFO pLogInfo
  107. );
  108. #endif // _ERRLOG_H_