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.

165 lines
4.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: PCH.cxx
  7. //
  8. // Contents: Pre-compiled header
  9. //
  10. // History: 21-Dec-92 BartoszM Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #define KDEXTMODE
  14. #define RTL_USE_AVL_TABLES 0
  15. #include <nt.h>
  16. #include <ntrtl.h>
  17. #include <nturtl.h>
  18. #include <ntos.h>
  19. #include <zwapi.h>
  20. #include <stdlib.h>
  21. #include <stdio.h>
  22. #include <string.h>
  23. #include <windef.h>
  24. #include <windows.h>
  25. #include <imagehlp.h>
  26. #include <memory.h>
  27. #include <fsrtl.h>
  28. #undef CREATE_NEW
  29. #undef OPEN_EXISTING
  30. #include <ntfsproc.h>
  31. PSTR
  32. FormatValue(
  33. ULONG64 addr
  34. );
  35. // Stolen from ntrtl.h to override RECOMASSERT
  36. #undef ASSERT
  37. #undef ASSERTMSG
  38. #if DBG
  39. #define ASSERT( exp ) \
  40. if (!(exp)) \
  41. RtlAssert( #exp, __FILE__, __LINE__, NULL )
  42. #define ASSERTMSG( msg, exp ) \
  43. if (!(exp)) \
  44. RtlAssert( #exp, __FILE__, __LINE__, msg )
  45. #else
  46. #define ASSERT( exp )
  47. #define ASSERTMSG( msg, exp )
  48. #endif // DBG
  49. //
  50. // We're 64 bit aware
  51. //
  52. #define KDEXT_64BIT
  53. #define KDEXT_64BIT
  54. #include <wdbgexts.h>
  55. #define OFFSET(struct, elem) ((char *) &(struct->elem) - (char *) struct)
  56. #define _DRIVER
  57. #define KDBG_EXT
  58. #include "wmistr.h"
  59. typedef PVOID (*STRUCT_DUMP_ROUTINE)(
  60. IN ULONG64 Address,
  61. IN ULONG64 Address2,
  62. IN LONG Options,
  63. IN USHORT Processor,
  64. IN HANDLE hCurrentThread
  65. );
  66. #define DECLARE_DUMP_FUNCTION(s) \
  67. VOID \
  68. s( \
  69. IN ULONG64 Address, \
  70. IN ULONG64 Address2, \
  71. IN LONG Options, \
  72. IN USHORT Processor, \
  73. IN HANDLE hCurrentThread \
  74. )
  75. #define INIT_DUMP() \
  76. UNREFERENCED_PARAMETER( Address ); \
  77. UNREFERENCED_PARAMETER( Address2 ); \
  78. UNREFERENCED_PARAMETER( Options ); \
  79. UNREFERENCED_PARAMETER( Processor ); \
  80. UNREFERENCED_PARAMETER( hCurrentThread );
  81. #define INIT_API() \
  82. UNREFERENCED_PARAMETER( hCurrentProcess ); \
  83. UNREFERENCED_PARAMETER( hCurrentThread ); \
  84. UNREFERENCED_PARAMETER( dwCurrentPc ); \
  85. UNREFERENCED_PARAMETER( dwProcessor ); \
  86. UNREFERENCED_PARAMETER( args ); \
  87. if (GetExpression( "NTFS!NtfsData" ) == 0) { \
  88. Ioctl( IG_RELOAD_SYMBOLS, "NTFS.SYS", 8 ); \
  89. } \
  90. if (KdDebuggerData.KernBase == 0) { \
  91. KdDebuggerData.Header.OwnerTag = KDBG_TAG; \
  92. KdDebuggerData.Header.Size = sizeof(KdDebuggerData); \
  93. if (!Ioctl( IG_GET_DEBUGGER_DATA, &KdDebuggerData, sizeof(KdDebuggerData) )) { \
  94. KdDebuggerData.KernBase = 1; \
  95. } \
  96. }
  97. extern KDDEBUGGER_DATA64 KdDebuggerData;
  98. #define SYM(s) "NTFS!" #s
  99. #define NT(s) "NT!" #s
  100. typedef struct _DUMP_ENUM_CONTEXT {
  101. ULONG Options;
  102. USHORT Processor;
  103. HANDLE hCurrentThread;
  104. ULONG64 ReturnValue;
  105. } DUMP_ENUM_CONTEXT, *PDUMP_ENUM_CONTEXT;
  106. //
  107. // prototypes
  108. //
  109. DECLARE_DUMP_FUNCTION( DumpCachedRecords );
  110. DECLARE_DUMP_FUNCTION( DumpCcb );
  111. DECLARE_DUMP_FUNCTION( DumpExtents );
  112. DECLARE_DUMP_FUNCTION( DumpFcb );
  113. DECLARE_DUMP_FUNCTION( DumpFcbLcbChain );
  114. DECLARE_DUMP_FUNCTION( DumpFcbTable );
  115. DECLARE_DUMP_FUNCTION( DumpFileObject );
  116. DECLARE_DUMP_FUNCTION( DumpFileObjectFromIrp );
  117. DECLARE_DUMP_FUNCTION( DumpFileRecord );
  118. DECLARE_DUMP_FUNCTION( DumpFileRecordContents );
  119. DECLARE_DUMP_FUNCTION( DumpHashTable );
  120. DECLARE_DUMP_FUNCTION( DumpIrpContext );
  121. DECLARE_DUMP_FUNCTION( DumpIrpContextFromThread );
  122. DECLARE_DUMP_FUNCTION( DumpLcb );
  123. DECLARE_DUMP_FUNCTION( DumpLogFile );
  124. DECLARE_DUMP_FUNCTION( DumpMcb );
  125. DECLARE_DUMP_FUNCTION( DumpNtfsData );
  126. DECLARE_DUMP_FUNCTION( DumpOverflow );
  127. DECLARE_DUMP_FUNCTION( DumpScb );
  128. DECLARE_DUMP_FUNCTION( DumpSysCache );
  129. DECLARE_DUMP_FUNCTION( DumpVcb );
  130. DECLARE_DUMP_FUNCTION( DumpCachedRuns );
  131. DECLARE_DUMP_FUNCTION( DumpTransaction );
  132. #pragma hdrstop