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.

134 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. tdidebug.h
  5. Abstract:
  6. This module contains code which assists the process of debugging an NT
  7. TDI client.
  8. Author:
  9. David Beaver (dbeaver) 28 June 1991
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. All code moved in from other XNS and NBF locations at creation
  14. --*/
  15. #if !defined _TDI_DEBUG_H
  16. #define _TDI_DEBUG_H
  17. #if DBG
  18. #include <stdarg.h>
  19. #include <stdio.h>
  20. #include <cxport.h>
  21. VOID
  22. TdiPrintf(
  23. char *Format,
  24. ...
  25. );
  26. VOID
  27. TdiFormattedDump(
  28. PCHAR far_p,
  29. ULONG len
  30. );
  31. VOID
  32. TdiHexDumpLine(
  33. PCHAR pch,
  34. ULONG len,
  35. PCHAR s,
  36. PCHAR t
  37. );
  38. #endif
  39. VOID
  40. TdiPrintUString(
  41. PUNICODE_STRING pustr
  42. );
  43. //
  44. // The various Dbg print codes..
  45. // Add as required.
  46. //
  47. #define TDI_DEBUG_FUNCTION 0x00000001
  48. #define TDI_DEBUG_PARAMETERS 0x00000002
  49. #define TDI_DEBUG_NCPA 0x00000004
  50. #define TDI_DEBUG_CLIENTS 0x00000008
  51. #define TDI_DEBUG_PROVIDERS 0x00000010
  52. #define TDI_DEBUG_POWER 0x00000020
  53. #define TDI_DEBUG_BIND 0x00000040
  54. #define TDI_DEBUG_ADDRESS 0x00000080
  55. #define TDI_DEBUG_REGISTRY 0x00000100
  56. #define TDI_DEBUG_ERROR 0x00000200
  57. #define TDI_DEBUG_FUNCTION2 0x10000000
  58. #define LOG_ERROR 0x00000001
  59. #define LOG_NOTIFY 0x00000002
  60. #define LOG_REGISTER 0x00000004
  61. #define LOG_POWER 0x00000008
  62. #define LOG_OUTPUT_DEBUGGER 1
  63. #define LOG_OUTPUT_BUFFER 2
  64. #define LOG_MSG_CNT 70
  65. #define MAX_MSG_LEN 200
  66. #if DBG
  67. CHAR DbgMsgs[LOG_MSG_CNT][MAX_MSG_LEN];
  68. UINT First, Last;
  69. CTELock DbgLock;
  70. //
  71. // In memory logging functions.
  72. //
  73. VOID
  74. DbgMsgInit();
  75. VOID
  76. DbgMsg(CHAR *Format, ...);
  77. extern ULONG TdiDebugEx;
  78. extern ULONG TdiMemLog;
  79. //
  80. // Print to the in-memory buffer anyways.
  81. //
  82. #define TDI_DEBUG(_Flag, _Print) { \
  83. if (TdiDebugEx & (TDI_DEBUG_ ## _Flag)) { \
  84. DbgPrint ("TDI: "); \
  85. DbgPrint _Print; \
  86. } \
  87. }
  88. #define TDI_LOG(flgs, format) (((flgs) & TdiMemLog) ? DbgMsg format:0)
  89. #else
  90. #define TDI_DEBUG(_Flag, _Print) (0)
  91. #define TDI_LOG(a,b) (0)
  92. #endif
  93. #endif //_TDI_DEBUG_H
  94.