[KD] Stub out the (new) unsupported KD API messages a bit more by adding 2 missing ones, likely API names and associated structures. Thanks to Mark Jensen for finding out the structs.

svn path=/trunk/; revision=69286
This commit is contained in:
Stefan Ginsberg 2015-09-19 13:58:08 +00:00
parent 8346163901
commit ecc1e62543
2 changed files with 45 additions and 15 deletions

View file

@ -113,6 +113,15 @@
#define DbgKdSwitchPartition 0x0000315D
#define DbgKdMaximumManipulate 0x0000315E
/*
* Three possible new API messages as well as the new Max
* if these were to be added. Be careful about implementing these.
*/
//#define DbgKdWriteCustomBreakpointApi 0x0000315E
//#define DbgKdGetContextExApi 0x0000315F
//#define DbgKdSetContextExApi 0x00003160
//#define DbgKdMaximumManipulate 0x00003161
//
// Debug I/O Types
//
@ -869,6 +878,22 @@ typedef struct _DBGKD_TRACE_IO
} u;
} DBGKD_TRACE_IO, *PDBGKD_TRACE_IO;
typedef struct _DBGKD_WRITE_CUSTOM_BREAKPOINT
{
ULONG64 BreakPointAddress;
ULONG64 BreakPointInstruction;
ULONG BreakPointHandle;
UCHAR BreakPointInstructionSize;
UCHAR BreakPointInstructionAlignment;
} DBGKD_WRITE_CUSTOM_BREAKPOINT, *PDBGKD_WRITE_CUSTOM_BREAKPOINT;
typedef struct _DBGKD_CONTEXT_EX
{
ULONG Offset;
ULONG ByteCount;
ULONG BytesCopied;
} DBGKD_CONTEXT_EX, *PDBGKD_CONTEXT_EX;
static
__inline
VOID

View file

@ -1359,24 +1359,29 @@ SendPacket:
KdpNotSupported(&ManipulateState);
break;
case 0x315f: // This one is unknown, but used by WinDbg, keep silent!
/* Setup an empty message, with failure */
Data.Length = 0;
ManipulateState.ReturnStatus = STATUS_UNSUCCESSFUL;
/* Send it */
KdSendPacket(PACKET_TYPE_KD_STATE_MANIPULATE,
&Header,
&Data,
&KdpContext);
break;
/* Unsupported Message */
/* Unsupported Messages */
default:
/* Setup an empty message, with failure */
/* Send warning */
KdpDprintf("Received Unhandled API %lx\n", ManipulateState.ApiNumber);
/*
* These 3 messages are unimplemented by us, but one (DbgKdGetContextExApi)
* is sent by WinDbg as of late during kernel debugging for some reason even though
* our MaxManipulate in the version block does not report it as being available.
*
* Any of these being sent to begin with is most likely a bug in WinDbg, so these
* are ignored and do not print a warning message to not spam the debug output.
* So far, WinDbg seems perfectly fine with this.
*
* DbgKdSetContextExApi complements the Get and DbgKdWriteCustomBreakpointApi
* fills the gap after DbgKdSwitchPartition (0x315D).
*/
case 0x315E: // DbgKdWriteCustomBreakpointApi
case 0x315F: // DbgKdGetContextExApi
case 0x3160: // DbgKdSetContextExApi
/* Setup an empty message, with failure */
Data.Length = 0;
ManipulateState.ReturnStatus = STATUS_UNSUCCESSFUL;