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.

107 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. smbtrace.h
  5. Abstract:
  6. This module provides the interface between the SmbTrace program and
  7. the kernel mode SmbTrace component.
  8. The interface between the kernel mode component and the
  9. server/redirector is found in nt\private\inc\smbtrsup.h
  10. Author:
  11. Peter Gray (w-peterg) 16-Mar-92
  12. Revision History:
  13. Stephan Mueller (t-stephm) 08-July-92
  14. Extensions to support smbtrace in the redirector as well as the
  15. server.
  16. --*/
  17. #ifndef _SMBTRACE_
  18. #define _SMBTRACE_
  19. //
  20. // The shared memory has this structure in it, used to manage the
  21. // table and other data shared by the kernel mode component and
  22. // the appliction. It is passed back to the client after creation by the
  23. // server during a FSCTL_???_START_SMBTRACE via an offset (pointer).
  24. //
  25. typedef struct _SMBTRACE_TABLE_HEADER {
  26. ULONG HighestConsumed; // last table entry processed by app (queue head)
  27. ULONG NextFree; // next free entry in table (queue tail)
  28. BOOLEAN ApplicationStop; // when set, the application should halt
  29. } SMBTRACE_TABLE_HEADER, *PSMBTRACE_TABLE_HEADER;
  30. //
  31. // The following stucture is one entry in the shared table of
  32. // offsets to the received SMBs. The offsets are relative to the
  33. // start of the shared memory section.
  34. //
  35. typedef struct _SMBTRACE_TABLE_ENTRY {
  36. ULONG BufferOffset; // location of SMB from start of shared memory
  37. ULONG SmbLength; // the length of the SMB
  38. ULONG NumberMissed; // number of preceding SMBs that were missed
  39. PVOID SmbAddress; // real address of original SMB, if available
  40. } SMBTRACE_TABLE_ENTRY, *PSMBTRACE_TABLE_ENTRY;
  41. //
  42. // The following stucture is passed to the server when doing the
  43. // FSCtl "FSCTL_???_START_SMBTRACE". It contains configuration
  44. // information that will affect the way the NT server and Smbtrace
  45. // will interact.
  46. //
  47. typedef struct _SMBTRACE_CONFIG_PACKET_REQ {
  48. BOOLEAN SingleSmbMode; // T to block on DoneEvent, F for faster.
  49. CLONG Verbosity; // how much data the app intends to decode
  50. // indicates how much needs to be saved
  51. ULONG BufferSize; // size of shared memory used to store SMBs
  52. ULONG TableSize; // number of entries in the table
  53. } SMBTRACE_CONFIG_PACKET_REQ, *PSMBTRACE_CONFIG_PACKET_REQ;
  54. //
  55. // Here is the response to that FSCTL.
  56. //
  57. typedef struct _SMBTRACE_CONFIG_PACKET_RESP {
  58. ULONG HeaderOffset; // location of header from start of shared memory
  59. ULONG TableOffset; // location of table from start of shared memory
  60. } SMBTRACE_CONFIG_PACKET_RESP, *PSMBTRACE_CONFIG_PACKET_RESP;
  61. //
  62. // Well-known names for objects accessible to both the server/redirector
  63. // and the Smbtrace application.
  64. //
  65. #define SMBTRACE_SRV_SHARED_MEMORY_NAME TEXT( "\\SmbTraceSrvMemory" )
  66. #define SMBTRACE_SRV_NEW_SMB_EVENT_NAME TEXT( "\\SmbTraceSrvNewSmbEvent" )
  67. #define SMBTRACE_SRV_DONE_SMB_EVENT_NAME TEXT( "\\SmbTraceSrvDoneSmbEvent" )
  68. #define SMBTRACE_LMR_SHARED_MEMORY_NAME TEXT( "\\SmbTraceRdrMemory" )
  69. #define SMBTRACE_LMR_NEW_SMB_EVENT_NAME TEXT( "\\SmbTraceRdrNewSmbEvent" )
  70. #define SMBTRACE_LMR_DONE_SMB_EVENT_NAME TEXT( "\\SmbTraceRdrDoneSmbEvent" )
  71. //
  72. // Verbosity levels indicating how much data the SmbTrace application
  73. // intends to decode, and consequently, how much data the server/redirector
  74. // must preserve for it.
  75. //
  76. #define SMBTRACE_VERBOSITY_OFF 0
  77. #define SMBTRACE_VERBOSITY_SINGLE_LINE 1
  78. #define SMBTRACE_VERBOSITY_ERROR 2
  79. #define SMBTRACE_VERBOSITY_HEADER 3
  80. #define SMBTRACE_VERBOSITY_PARAMS 4
  81. #define SMBTRACE_VERBOSITY_NONESSENTIAL 5
  82. #endif // _SMBTRACE_