diff --git a/reactos/include/reactos/windbgkd.h b/reactos/include/reactos/windbgkd.h index 42e99f05964..8935f7d27ed 100644 --- a/reactos/include/reactos/windbgkd.h +++ b/reactos/include/reactos/windbgkd.h @@ -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 diff --git a/reactos/ntoskrnl/kd64/kdapi.c b/reactos/ntoskrnl/kd64/kdapi.c index 5f14240694c..651929691a2 100644 --- a/reactos/ntoskrnl/kd64/kdapi.c +++ b/reactos/ntoskrnl/kd64/kdapi.c @@ -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;