2010-03-29 02:38:12 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Kernel Debugger Types *
|
|
|
|
******************************************************************************/
|
|
|
|
$if (_NTDDK_)
|
|
|
|
typedef struct _DEBUG_DEVICE_ADDRESS {
|
|
|
|
UCHAR Type;
|
|
|
|
BOOLEAN Valid;
|
2020-11-09 21:33:02 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10_RS3)
|
|
|
|
union {
|
|
|
|
#endif
|
|
|
|
UCHAR Reserved[2];
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10_RS3)
|
|
|
|
struct {
|
|
|
|
UCHAR BitWidth;
|
|
|
|
UCHAR AccessSize;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|
2010-03-29 02:38:12 +00:00
|
|
|
PUCHAR TranslatedAddress;
|
|
|
|
ULONG Length;
|
|
|
|
} DEBUG_DEVICE_ADDRESS, *PDEBUG_DEVICE_ADDRESS;
|
|
|
|
|
|
|
|
typedef struct _DEBUG_MEMORY_REQUIREMENTS {
|
|
|
|
PHYSICAL_ADDRESS Start;
|
|
|
|
PHYSICAL_ADDRESS MaxEnd;
|
|
|
|
PVOID VirtualAddress;
|
|
|
|
ULONG Length;
|
|
|
|
BOOLEAN Cached;
|
|
|
|
BOOLEAN Aligned;
|
|
|
|
} DEBUG_MEMORY_REQUIREMENTS, *PDEBUG_MEMORY_REQUIREMENTS;
|
|
|
|
|
2020-11-09 21:33:02 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN8)
|
|
|
|
typedef enum {
|
|
|
|
KdNameSpacePCI,
|
|
|
|
KdNameSpaceACPI,
|
|
|
|
KdNameSpaceAny,
|
|
|
|
KdNameSpaceNone,
|
|
|
|
KdNameSpaceMax, /* Maximum namespace enumerator */
|
|
|
|
} KD_NAMESPACE_ENUM, *PKD_NAMESPACE_ENUM;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10)
|
|
|
|
typedef struct _DEBUG_TRANSPORT_DATA {
|
|
|
|
ULONG HwContextSize;
|
|
|
|
BOOLEAN UseSerialFraming;
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10_RS5)
|
|
|
|
BOOLEAN ValidUSBCoreId;
|
|
|
|
UCHAR USBCoreId;
|
|
|
|
#endif
|
|
|
|
} DEBUG_TRANSPORT_DATA, *PDEBUG_TRANSPORT_DATA;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MAXIMUM_DEBUG_BARS 6
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10)
|
|
|
|
#define DBG_DEVICE_FLAG_HAL_SCRATCH_ALLOCATED 0x01
|
|
|
|
#define DBG_DEVICE_FLAG_BARS_MAPPED 0x02
|
|
|
|
#define DBG_DEVICE_FLAG_SCRATCH_ALLOCATED 0x04
|
|
|
|
#endif
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
|
|
|
|
#define DBG_DEVICE_FLAG_UNCACHED_MEMORY 0x08
|
|
|
|
#endif
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10_RS3)
|
|
|
|
#define DBG_DEVICE_FLAG_SYNTHETIC 0x10
|
|
|
|
#endif
|
|
|
|
|
2010-03-29 02:38:12 +00:00
|
|
|
typedef struct _DEBUG_DEVICE_DESCRIPTOR {
|
|
|
|
ULONG Bus;
|
2020-11-09 21:33:02 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA) && (NTDDI_VERSION < NTDDI_WIN8)
|
|
|
|
USHORT Segment;
|
|
|
|
#endif
|
2010-03-29 02:38:12 +00:00
|
|
|
ULONG Slot;
|
2020-11-09 21:33:02 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN8)
|
2010-03-29 02:38:12 +00:00
|
|
|
USHORT Segment;
|
2020-11-09 21:33:02 +00:00
|
|
|
#endif
|
2010-03-29 02:38:12 +00:00
|
|
|
USHORT VendorID;
|
|
|
|
USHORT DeviceID;
|
|
|
|
UCHAR BaseClass;
|
|
|
|
UCHAR SubClass;
|
|
|
|
UCHAR ProgIf;
|
2020-11-09 21:33:02 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN8)
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10)
|
|
|
|
union {
|
|
|
|
#endif
|
|
|
|
UCHAR Flags;
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10)
|
|
|
|
struct {
|
|
|
|
UCHAR DbgHalScratchAllocated : 1;
|
|
|
|
UCHAR DbgBarsMapped : 1;
|
|
|
|
UCHAR DbgScratchAllocated : 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
#endif
|
2010-03-29 02:38:12 +00:00
|
|
|
BOOLEAN Initialized;
|
2020-11-09 21:33:02 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
2010-03-29 02:38:12 +00:00
|
|
|
BOOLEAN Configured;
|
2020-11-09 21:33:02 +00:00
|
|
|
#endif
|
|
|
|
DEBUG_DEVICE_ADDRESS BaseAddress[MAXIMUM_DEBUG_BARS];
|
2010-03-29 02:38:12 +00:00
|
|
|
DEBUG_MEMORY_REQUIREMENTS Memory;
|
2020-11-09 21:33:02 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10_19H1)
|
|
|
|
ULONG Dbg2TableIndex;
|
|
|
|
#endif
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN8)
|
|
|
|
USHORT PortType;
|
|
|
|
USHORT PortSubtype;
|
|
|
|
PVOID OemData;
|
|
|
|
ULONG OemDataLength;
|
|
|
|
KD_NAMESPACE_ENUM NameSpace;
|
|
|
|
PWCHAR NameSpacePath;
|
|
|
|
ULONG NameSpacePathLength;
|
|
|
|
#endif
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN10)
|
|
|
|
ULONG TransportType;
|
|
|
|
DEBUG_TRANSPORT_DATA TransportData;
|
|
|
|
#endif
|
2010-03-29 02:38:12 +00:00
|
|
|
} DEBUG_DEVICE_DESCRIPTOR, *PDEBUG_DEVICE_DESCRIPTOR;
|
|
|
|
|
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI *pKdSetupPciDeviceForDebugging)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_opt_ PVOID LoaderBlock,
|
|
|
|
_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI *pKdReleasePciDeviceForDebugging)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
typedef PVOID
|
|
|
|
(NTAPI *pKdGetAcpiTablePhase0)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
|
|
|
|
_In_ ULONG Signature);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
typedef VOID
|
2012-01-22 14:43:53 +00:00
|
|
|
(NTAPI *pKdCheckPowerButton)(VOID);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
|
|
|
typedef PVOID
|
|
|
|
(NTAPI *pKdMapPhysicalMemory64)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PHYSICAL_ADDRESS PhysicalAddress,
|
|
|
|
_In_ ULONG NumberPages,
|
|
|
|
_In_ BOOLEAN FlushCurrentTLB);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI *pKdUnmapVirtualAddress)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PVOID VirtualAddress,
|
|
|
|
_In_ ULONG NumberPages,
|
|
|
|
_In_ BOOLEAN FlushCurrentTLB);
|
2010-03-29 02:38:12 +00:00
|
|
|
#else
|
|
|
|
typedef PVOID
|
|
|
|
(NTAPI *pKdMapPhysicalMemory64)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PHYSICAL_ADDRESS PhysicalAddress,
|
|
|
|
_In_ ULONG NumberPages);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI *pKdUnmapVirtualAddress)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PVOID VirtualAddress,
|
|
|
|
_In_ ULONG NumberPages);
|
2010-03-29 02:38:12 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef ULONG
|
|
|
|
(NTAPI *pKdGetPciDataByOffset)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG SlotNumber,
|
|
|
|
_Out_writes_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Offset,
|
|
|
|
_In_ ULONG Length);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
typedef ULONG
|
|
|
|
(NTAPI *pKdSetPciDataByOffset)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG SlotNumber,
|
|
|
|
_In_reads_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Offset,
|
|
|
|
_In_ ULONG Length);
|
2012-01-13 17:45:26 +00:00
|
|
|
$endif (_NTDDK_)
|