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.

132 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1999
  5. //
  6. // File: PCH.cxx
  7. //
  8. // Contents: Pre-compiled header
  9. //
  10. // History: 21-Dec-92 BartoszM Created
  11. //
  12. //--------------------------------------------------------------------------
  13. // #define KDEXTMODE // BUGBUG ?
  14. #include <nt.h>
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <windows.h>
  18. #include <ntosp.h>
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <scsi.h>
  23. #include <srb.h>
  24. #define KDEXT_64BIT
  25. #include <wdbgexts.h>
  26. #include <dbgeng.h>
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. //
  31. // undef the wdbgexts
  32. //
  33. #undef DECLARE_API
  34. #define DECLARE_API(extension) CPPMOD HRESULT CALLBACK extension(PDEBUG_CLIENT Client, PCSTR args)
  35. #undef ASSERT
  36. #undef ASSERTMSG
  37. #if DBG
  38. #define ASSERT( exp ) if (!(exp)){ RtlAssert( #exp, __FILE__, __LINE__, NULL ); }
  39. #define ASSERTMSG( msg, exp ) if (!(exp)){ RtlAssert( #exp, __FILE__, __LINE__, msg ); }
  40. #else
  41. #define ASSERT( exp )
  42. #define ASSERTMSG( msg, exp )
  43. #endif
  44. #define PCI_SLOT_NUMBER ULONG
  45. #define OFFSET(struct, elem) ((char *) &(struct->elem) - (char *) struct)
  46. #define _DRIVER
  47. #define KDBG_EXT
  48. #include "ntdddisk.h"
  49. #include "ntddscsi.h"
  50. #include "ntddstor.h"
  51. #include "wmistr.h"
  52. #define PRINT_FLAGS(Flags,b) if (Flags & b) {dprintf(#b", ");}
  53. #define BAD_VALUE (ULONG64)-1
  54. typedef struct {
  55. ULONG Flag;
  56. PUCHAR Name;
  57. } FLAG_NAME, *PFLAG_NAME;
  58. #define FLAG_NAME(flag) {flag, #flag}
  59. extern FLAG_NAME SrbFlags[];
  60. extern FLAG_NAME LuFlags[];
  61. extern FLAG_NAME PortFlags[];
  62. extern FLAG_NAME DevFlags[];
  63. PUCHAR
  64. DevicePowerStateToString(
  65. IN DEVICE_POWER_STATE State
  66. );
  67. PUCHAR
  68. SystemPowerStateToString(
  69. IN DEVICE_POWER_STATE State
  70. );
  71. VOID
  72. xdprintf(
  73. ULONG Depth,
  74. PCCHAR S,
  75. ...
  76. );
  77. VOID
  78. DumpFlags(
  79. ULONG Depth,
  80. PUCHAR Name,
  81. ULONG Flags,
  82. PFLAG_NAME FlagTable
  83. );
  84. ULONG64 GetULONGField(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  85. USHORT GetUSHORTField(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  86. UCHAR GetUCHARField(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  87. ULONG64 GetFieldAddr(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  88. ULONG64 GetContainingRecord(ULONG64 FieldAddr, LPCSTR StructType, LPCSTR FieldName);
  89. ULONG DumpObjListQueue(ULONG Depth, PCHAR Title, PCHAR StructName, PCHAR ListEntryFieldName, ULONG64 ListHeadAddr);
  90. ULONG DumpIrpQueue(ULONG Depth, PCHAR Title, ULONG64 ListHeadAddr);
  91. ULONG DumpIrpDeviceQueue(ULONG Depth, PCHAR Title, ULONG64 ListHeadAddr);
  92. BOOLEAN FindObjInListQueue(ULONG64 ListHeadAddr, ULONG64 SpecificObjAddr, PCHAR StructName, PCHAR ListEntryFieldName);
  93. BOOLEAN FindIrpInQueue(ULONG64 ListHeadAddr, ULONG64 IrpAddr);
  94. BOOLEAN FindIrpInDeviceQueue(ULONG64 ListHeadAddr, ULONG64 IrpAddr);
  95. BOOLEAN IsAtapiPdo(ULONG64 DevObjAddr);
  96. BOOLEAN IsAtapiFdo(ULONG64 DevObjAddr);
  97. BOOLEAN FindIrpInPdo(ULONG Depth, ULONG64 PdoAddr, ULONG64 IrpAddr, BOOLEAN SearchParent);
  98. BOOLEAN FindIrpInFdo(ULONG Depth, ULONG64 FdoAddr, ULONG64 IrpAddr);
  99. extern WINDBG_EXTENSION_APIS ExtensionApis;
  100. #ifdef __cplusplus
  101. }
  102. #endif