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.

149 lines
2.8 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. VOID
  68. GetAddressAndDetailLevel(
  69. IN PCSTR Args,
  70. OUT PULONG64 Address,
  71. OUT PLONG Detail
  72. );
  73. VOID
  74. GetAddressAndDetailLevel64(
  75. IN PCSTR Args,
  76. OUT PULONG64 Address,
  77. OUT PLONG Detail
  78. );
  79. VOID
  80. GetAddress(
  81. IN PCSTR Args,
  82. OUT PULONG64 Address
  83. );
  84. PUCHAR
  85. SystemPowerStateToString(
  86. IN DEVICE_POWER_STATE State
  87. );
  88. VOID
  89. xdprintf(
  90. ULONG Depth,
  91. PCCHAR S,
  92. ...
  93. );
  94. VOID
  95. DumpFlags(
  96. ULONG Depth,
  97. PUCHAR Name,
  98. ULONG Flags,
  99. PFLAG_NAME FlagTable
  100. );
  101. BOOLEAN
  102. GetAnsiString(
  103. IN ULONG64 Address,
  104. IN PUCHAR Buffer,
  105. IN OUT PULONG Length
  106. );
  107. ULONG64 GetULONGField(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  108. USHORT GetUSHORTField(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  109. UCHAR GetUCHARField(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  110. ULONG64 GetFieldAddr(ULONG64 StructAddr, LPCSTR StructType, LPCSTR FieldName);
  111. ULONG64 GetContainingRecord(ULONG64 FieldAddr, LPCSTR StructType, LPCSTR FieldName);
  112. extern WINDBG_EXTENSION_APIS ExtensionApis;
  113. #ifdef __cplusplus
  114. }
  115. #endif