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.

148 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. RxLog.h
  5. Abstract:
  6. This module declares the prototypes and global data used by the RDBSS debug logging facilities.
  7. Author:
  8. Joe Linn [JoeLinn] 1-aug-1994
  9. Revision History:
  10. Balan Sethu Raman [SethuR] 23-April-95 revised log layout
  11. Notes:
  12. The log records are stored in a circular buffer. Each record is bounded on either side by
  13. a record descriptor. This record descriptor is four bytes long.
  14. --*/
  15. #ifndef _RDBSSLOG_INCLUDED_
  16. #define _RDBSSLOG_INCLUDED_
  17. typedef enum {
  18. RX_LOG_UNINITIALIZED,
  19. RX_LOG_ENABLED,
  20. RX_LOG_DISABLED,
  21. RX_LOG_ERROR
  22. } RX_LOGGING_STATE;
  23. typedef struct RX_LOG_ENTRY_HEADER {
  24. PCHAR Buffer;
  25. } RX_LOG_ENTRY_HEADER, *PRX_LOG_ENTRY_HEADER;
  26. typedef struct RX_LOG {
  27. RX_SPIN_LOCK SpinLock;
  28. RX_LOGGING_STATE State;
  29. PRX_LOG_ENTRY_HEADER CurrentEntry;
  30. PRX_LOG_ENTRY_HEADER BaseEntry;
  31. PRX_LOG_ENTRY_HEADER EntryLimit;
  32. ULONG LogBufferSizeInEntries;
  33. ULONG NumberOfEntriesIgnored;
  34. ULONG NumberOfLogWriteAttempts;
  35. ULONG NumberOfLogWraps;
  36. } RX_LOG, *PRX_LOG;
  37. //the logging facilities are always present. what RDBSSLOG does is to enable generation
  38. //of the calls! on checked builds, you even get the calls unless NO_RDBSSLOG is set.
  39. //extern
  40. //VOID
  41. //RxLogInterlockedAddUlong(
  42. // PULONG Result,
  43. // PULONG Counter,
  44. // ULONG Addend);
  45. extern
  46. VOID
  47. RxDebugControlCommand (
  48. IN char *ControlString
  49. );
  50. extern
  51. NTSTATUS
  52. RxInitializeLog(void);
  53. extern
  54. VOID
  55. RxUninitializeLog(void);
  56. extern
  57. VOID
  58. _RxPrintLog(IN ULONG EntriesToPrint OPTIONAL);
  59. extern
  60. VOID
  61. _RxPauseLog(void);
  62. extern
  63. VOID
  64. _RxResumeLog (void);
  65. extern
  66. VOID
  67. _RxLog(char *format, ...);
  68. #define MAX_RX_LOG_ENTRY_SIZE (48)
  69. #define RDBSSLOG_ASYNC_NAME_PREFIX "[nowait]"
  70. #define RXCONTX_OPERATION_NAME(MajorFunction,Wait) \
  71. (RxContxOperationNames[(MajorFunction)]+((Wait)?(sizeof(RDBSSLOG_ASYNC_NAME_PREFIX)-1):0))
  72. extern PUCHAR RxContxOperationNames[];
  73. #ifdef RDBSSLOG
  74. //
  75. // The arguments to RxLog must be enclosed with an additional pair of parenthesis to enable
  76. // transalation into a null call when logging should be turned off.
  77. // e.g. RxLog(("%s %d", FILE, LINE))
  78. #if DBG
  79. #define RxLog(Args) _RxLog##Args
  80. #define RxLogRetail(Args) _RxLog##Args
  81. #else
  82. #define RxLogRetail(Args) _RxLog##Args
  83. #define RxLog(Args) {NOTHING;}
  84. #endif
  85. #define RxPauseLog() _RxPauseLog()
  86. #define RxResumeLog() _RxResumeLog()
  87. #else //if notdef RDBSSLOG
  88. #define RxLog(Args) {NOTHING;}
  89. #define RxLogRetail(Args) {NOTHING;}
  90. #define RxPauseLog() {NOTHING;}
  91. #define RxResumeLog() {NOTHING;}
  92. #endif
  93. #endif // _RDBSSLOG_INCLUDED_
  94. #if DBG
  95. #define RxDbgPrint(Args) DbgPrint##Args
  96. #else
  97. #define RxDbgPrint(Args) NOTHING
  98. #endif
  99. LIST_ENTRY RxIrpsList;
  100. KSPIN_LOCK RxIrpsListSpinLock;
  101. typedef struct _RX_IRP_LIST_ITEM {
  102. LIST_ENTRY IrpsList;
  103. PIRP pIrp;
  104. PMDL CopyDataBuffer;
  105. ULONG Completed;
  106. } RX_IRP_LIST_ITEM, *PRX_IRP_LIST_ITEM;