Author: sginsberg Date: Sat Sep 19 13:58:08 2015 New Revision: 69286
URL: http://svn.reactos.org/svn/reactos?rev=69286&view=rev Log: [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.
Modified: trunk/reactos/include/reactos/windbgkd.h trunk/reactos/ntoskrnl/kd64/kdapi.c
Modified: trunk/reactos/include/reactos/windbgkd.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/windbgkd.h?... ============================================================================== --- trunk/reactos/include/reactos/windbgkd.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/windbgkd.h [iso-8859-1] Sat Sep 19 13:58:08 2015 @@ -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 @@ } 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
Modified: trunk/reactos/ntoskrnl/kd64/kdapi.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kdapi.c?rev=6... ============================================================================== --- trunk/reactos/ntoskrnl/kd64/kdapi.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd64/kdapi.c [iso-8859-1] Sat Sep 19 13:58:08 2015 @@ -1359,24 +1359,29 @@ KdpNotSupported(&ManipulateState); break;
- case 0x315f: // This one is unknown, but used by WinDbg, keep silent! + /* Unsupported Messages */ + default: + + /* 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; - - /* Send it */ - KdSendPacket(PACKET_TYPE_KD_STATE_MANIPULATE, - &Header, - &Data, - &KdpContext); - break; - - /* Unsupported Message */ - default: - - /* Setup an empty message, with failure */ - KdpDprintf("Received Unhandled API %lx\n", ManipulateState.ApiNumber); Data.Length = 0; ManipulateState.ReturnStatus = STATUS_UNSUCCESSFUL;