Author: tkreuzer
Date: Tue Oct 13 02:33:04 2009
New Revision: 43432
URL:
http://svn.reactos.org/svn/reactos?rev=43432&view=rev
Log:
Add back some stuff that got lost in syncing
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/kdapi.c
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/kdapi.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/kdapi.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/kdapi.c [iso-8859-1] Tue Oct 13
02:33:04 2009
@@ -179,7 +179,7 @@
VOID
NTAPI
-DumpTraceData(IN PSTRING TraceData)
+DumpTraceData(OUT PSTRING TraceData)
{
/* Update the buffer */
TraceDataBuffer[0] = TraceDataBufferPosition;
@@ -196,7 +196,7 @@
NTAPI
KdpSetCommonState(IN ULONG NewState,
IN PCONTEXT Context,
- IN PDBGKD_WAIT_STATE_CHANGE64 WaitStateChange)
+ OUT PDBGKD_WAIT_STATE_CHANGE64 WaitStateChange)
{
USHORT InstructionCount;
BOOLEAN HadBreakpoints;
@@ -267,6 +267,7 @@
STRING Header;
ULONG Length = State->u.ReadMemory.TransferCount;
NTSTATUS Status = STATUS_SUCCESS;
+ ULONG64 TargetBaseAddress = State->u.ReadMemory.TargetBaseAddress;
/* Validate length */
if (Length > (PACKET_MAX_SIZE - sizeof(DBGKD_MANIPULATE_STATE64)))
@@ -284,7 +285,15 @@
}
#endif
- if (!State->u.ReadMemory.TargetBaseAddress)
+ // HACK for x64, until KD stops sending bogus addresses to WinDbg
+ if (TargetBaseAddress < (ULONG_PTR)MM_LOWEST_SYSTEM_ADDRESS)
+ {
+ FrLdrDbgPrint("Trying to read memory at 0x%p\n", TargetBaseAddress);
+// DPRINT1("Trying to read memory at 0x%p\n", TargetBaseAddress);
+ TargetBaseAddress = 0;
+ }
+
+ if (!TargetBaseAddress)
{
Length = 0;
Status = STATUS_UNSUCCESSFUL;
@@ -1245,7 +1254,7 @@
KdpSetContextState(&WaitStateChange, Context);
/* Setup the actual header to send to KD */
- Header.Length = sizeof(DBGKD_WAIT_STATE_CHANGE64);
+ Header.Length = sizeof(DBGKD_WAIT_STATE_CHANGE64) - sizeof(CONTEXT);
Header.Buffer = (PCHAR)&WaitStateChange;
/* Setup the trace data */