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.

153 lines
2.9 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. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <windows.h>
  17. #include <ntosp.h>
  18. #include <stdio.h>
  19. #include <stdlib.h>
  20. #include <string.h>
  21. #include <storport.h>
  22. #define KDEXT_64BIT
  23. #include <wdbgexts.h>
  24. #include <dbgeng.h>
  25. //
  26. // undef the wdbgexts
  27. //
  28. #undef DECLARE_API
  29. #define DECLARE_API(extension) \
  30. CPPMOD HRESULT CALLBACK extension(PDEBUG_CLIENT Client, PCSTR args)
  31. #define MINIPKD_PRINT_ERROR(r)\
  32. dprintf("minipkd error (%x): %s @ line %d\n", (r), __FILE__, __LINE__);
  33. #define RECUR DBG_DUMP_FIELD_RECUR_ON_THIS
  34. #define F_ADDR DBG_DUMP_FIELD_RETURN_ADDRESS
  35. #define COPY DBG_DUMP_FIELD_FULL_NAME | DBG_DUMP_FIELD_COPY_FIELD_DATA | DBG_DUMP_FIELD_RETURN_ADDRESS
  36. #define ADDROF DBG_DUMP_FIELD_RETURN_ADDRESS | DBG_DUMP_FIELD_FULL_NAME
  37. // Stolen from ntrtl.h to override RECOMASSERT
  38. #undef ASSERT
  39. #undef ASSERTMSG
  40. #if DBG
  41. #define ASSERT( exp ) \
  42. if (!(exp)) \
  43. RtlAssert( #exp, __FILE__, __LINE__, NULL )
  44. #define ASSERTMSG( msg, exp ) \
  45. if (!(exp)) \
  46. RtlAssert( #exp, __FILE__, __LINE__, msg )
  47. #else
  48. #define ASSERT( exp )
  49. #define ASSERTMSG( msg, exp )
  50. #endif // DBG
  51. extern WINDBG_EXTENSION_APIS64 ExtensionApis;
  52. #define OFFSET(struct, elem) ((char *) &(struct->elem) - (char *) struct)
  53. #define _DRIVER
  54. #define KDBG_EXT
  55. #include "wmistr.h"
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. #define PRINT_FLAGS(Flags,b) if (Flags & b) {dprintf(#b", ");}
  60. __inline
  61. VOID
  62. xdindent(
  63. ULONG Depth
  64. )
  65. {
  66. ULONG i;
  67. for (i=0; i<Depth; i++)
  68. dprintf(" ");
  69. }
  70. #define xdprintfEx(d, expr)\
  71. xdindent((d));\
  72. dprintf expr
  73. typedef struct {
  74. ULONG Flag;
  75. PUCHAR Name;
  76. } FLAG_NAME, *PFLAG_NAME;
  77. #define FLAG_NAME(flag) {flag, #flag}
  78. extern FLAG_NAME SrbFlags[];
  79. PUCHAR
  80. DevicePowerStateToString(
  81. IN DEVICE_POWER_STATE State
  82. );
  83. VOID
  84. GetAddressAndDetailLevel(
  85. IN PCSTR Args,
  86. OUT PULONG64 Address,
  87. OUT PLONG Detail
  88. );
  89. VOID
  90. GetAddress(
  91. IN PCSTR Args,
  92. OUT PULONG64 Address
  93. );
  94. PUCHAR
  95. SystemPowerStateToString(
  96. IN DEVICE_POWER_STATE State
  97. );
  98. VOID
  99. xdprintf(
  100. ULONG Depth,
  101. PCCHAR S,
  102. ...
  103. );
  104. VOID
  105. DumpFlags(
  106. ULONG Depth,
  107. PUCHAR Name,
  108. ULONG Flags,
  109. PFLAG_NAME FlagTable
  110. );
  111. BOOLEAN
  112. GetAnsiString(
  113. IN ULONG_PTR Address,
  114. IN PUCHAR Buffer,
  115. IN OUT PULONG Length
  116. );
  117. PCHAR
  118. GuidToString(
  119. GUID* GUID
  120. );
  121. #ifdef __cplusplus
  122. }
  123. #endif