TraceDataBuffer[0] = TraceDataBufferPosition;
/* Setup the trace data */
- TraceData->Length = TraceDataBufferPosition * sizeof(ULONG);
+ TraceData->Length = (USHORT)(TraceDataBufferPosition * sizeof(ULONG));
TraceData->Buffer = (PCHAR)TraceDataBuffer;
/* Reset the buffer location */
0,
MMDBG_COPY_UNSAFE,
&InstructionCount);
- WaitStateChange->ControlReport.InstructionCount = InstructionCount;
+ WaitStateChange->ControlReport.InstructionCount = (USHORT)InstructionCount;
/* Clear all the breakpoints in this region */
HadBreakpoints =
&Length);
/* Return the actual length read */
- Data->Length = ReadMemory->ActualBytesRead = Length;
+ ReadMemory->ActualBytesRead = Length;
+ Data->Length = (USHORT)Length;
/* Send the packet */
KdSendPacket(PACKET_TYPE_KD_STATE_MANIPULATE,
&Length);
/* Return the actual length read */
- Data->Length = ReadMemory->ActualBytesRead = Length;
+ ReadMemory->ActualBytesRead = Length;
+ Data->Length = (USHORT)Length;
/* Send the packet */
KdSendPacket(PACKET_TYPE_KD_STATE_MANIPULATE,
&Length);
/* Return the actual length read */
- Data->Length = ReadMemory->ActualBytesRead = Length;
+ ReadMemory->ActualBytesRead = Length;
+ Data->Length = (USHORT)Length;
/* Send the reply */
KdSendPacket(PACKET_TYPE_KD_STATE_MANIPULATE,
&Length);
/* Return the actual length read */
- Data->Length = GetBusData->Length = Length;
+ GetBusData->Length = Length;
+ Data->Length = (USHORT)Length;
/* Send the reply */
KdSendPacket(PACKET_TYPE_KD_STATE_MANIPULATE,
/*
* Clear the value so 1 or 2 byte reads
- * don't leave the higher bits unmodified
+ * don't leave the higher bits unmodified
*/
ReadIo->DataValue = 0;
/*
* Clear the value so 1 or 2 byte reads
- * don't leave the higher bits unmodified
+ * don't leave the higher bits unmodified
*/
ReadIoExtended->DataValue = 0;
Data.MaximumLength = sizeof(KdpMessageBuffer);
Data.Buffer = KdpMessageBuffer;
- /*
+ /*
* Reset the context state to ensure the debugger has received
* the current context before it sets it
*/
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 */
default:
/* Set up the data */
Data.Buffer = KdpPathBuffer;
- Data.Length = PathNameLength;
+ Data.Length = (USHORT)PathNameLength;
ExtraData = &Data;
}
else
/* Now set up the header and the data */
Header.Length = sizeof(DBGKD_ANY_WAIT_STATE_CHANGE);
Header.Buffer = (PCHAR)&WaitStateChange;
- Data.Length = TotalLength;
+ Data.Length = (USHORT)TotalLength;
Data.Buffer = KdpMessageBuffer;
/* Send State Change packet and wait for a reply */
{
/* Queue a DPC for the time slip */
InterlockedIncrement(&KdpTimeSlipPending);
- KeInsertQueueDpc(&KdpTimeSlipDpc, NULL, NULL);
+ KeInsertQueueDpc(&KdpTimeSlipDpc, NULL, NULL); // FIXME: this can trigger context switches!
}
}
/* We are disabled now */
KdDebuggerEnabled = FALSE;
-#undef KdDebuggerEnabled
SharedUserData->KdDebuggerEnabled = FALSE;
-#define KdDebuggerEnabled _KdDebuggerEnabled
}
}
IN OUT PULONG ReturnLength,
IN KPROCESSOR_MODE PreviousMode)
{
+ /* handle sime internal commands */
+ if (Command == ' soR')
+ {
+ switch ((ULONG_PTR)InputBuffer)
+ {
+ case 0x24:
+ MmDumpArmPfnDatabase(FALSE);
+ break;
+ }
+ return STATUS_SUCCESS;
+ }
+
/* Local kernel debugging is not yet supported */
DbgPrint("KdSystemDebugControl is unimplemented!\n");
return STATUS_NOT_IMPLEMENTED;