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.

129 lines
2.5 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 <scsi.h>
  22. #include <srb.h>
  23. #define KDEXT_64BIT
  24. #include <wdbgexts.h>
  25. #include <dbgeng.h>
  26. //
  27. // undef the wdbgexts
  28. //
  29. #undef DECLARE_API
  30. #define DECLARE_API(extension) \
  31. CPPMOD HRESULT CALLBACK extension(PDEBUG_CLIENT Client, PCSTR args)
  32. #define MINIPKD_PRINT_ERROR(r)\
  33. dprintf("minipkd error (%x): %s @ line %d\n", (r), __FILE__, __LINE__);
  34. #define RECUR DBG_DUMP_FIELD_RECUR_ON_THIS
  35. #define F_ADDR DBG_DUMP_FIELD_RETURN_ADDRESS
  36. #define COPY DBG_DUMP_FIELD_FULL_NAME | DBG_DUMP_FIELD_COPY_FIELD_DATA | DBG_DUMP_FIELD_RETURN_ADDRESS
  37. #define ADDROF DBG_DUMP_FIELD_RETURN_ADDRESS | DBG_DUMP_FIELD_FULL_NAME
  38. // Stolen from ntrtl.h to override RECOMASSERT
  39. #undef ASSERT
  40. #undef ASSERTMSG
  41. #if DBG
  42. #define ASSERT( exp ) \
  43. if (!(exp)) \
  44. RtlAssert( #exp, __FILE__, __LINE__, NULL )
  45. #define ASSERTMSG( msg, exp ) \
  46. if (!(exp)) \
  47. RtlAssert( #exp, __FILE__, __LINE__, msg )
  48. #else
  49. #define ASSERT( exp )
  50. #define ASSERTMSG( msg, exp )
  51. #endif // DBG
  52. extern WINDBG_EXTENSION_APIS64 ExtensionApis;
  53. #define OFFSET(struct, elem) ((char *) &(struct->elem) - (char *) struct)
  54. #define _DRIVER
  55. #define KDBG_EXT
  56. #include "wmistr.h"
  57. #ifdef __cplusplus
  58. extern "C" {
  59. #endif
  60. #define PRINT_FLAGS(Flags,b) if (Flags & b) {dprintf(#b", ");}
  61. __inline
  62. VOID
  63. xdindent(
  64. ULONG Depth
  65. )
  66. {
  67. ULONG i;
  68. for (i=0; i<Depth; i++)
  69. dprintf(" ");
  70. }
  71. #define xdprintfEx(d, expr)\
  72. xdindent((d));\
  73. dprintf expr
  74. typedef struct {
  75. ULONG Flag;
  76. PUCHAR Name;
  77. } FLAG_NAME, *PFLAG_NAME;
  78. #define FLAG_NAME(flag) {flag, #flag}
  79. extern FLAG_NAME SrbFlagsMap[];
  80. PUCHAR
  81. DevicePowerStateToString(
  82. IN DEVICE_POWER_STATE State
  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. #ifdef __cplusplus
  102. }
  103. #endif