mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 11:51:58 +00:00
[NTOS:KD] Merge KdpPrintString()/KdpPromptString() with kd64 version
This commit is contained in:
parent
d5fe15e5e6
commit
5730394bd0
2 changed files with 71 additions and 71 deletions
|
@ -508,12 +508,25 @@ KdpScreenInit(PKD_DISPATCH_TABLE DispatchTable,
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
KdpPrintString(
|
KdpPrintString(
|
||||||
_In_ PSTRING Output)
|
_In_ PSTRING Output);
|
||||||
|
|
||||||
|
extern STRING KdbPromptString;
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KdSendPacket(
|
||||||
|
IN ULONG PacketType,
|
||||||
|
IN PSTRING MessageHeader,
|
||||||
|
IN PSTRING MessageData,
|
||||||
|
IN OUT PKD_CONTEXT Context)
|
||||||
{
|
{
|
||||||
|
if (PacketType == PACKET_TYPE_KD_DEBUG_IO)
|
||||||
|
{
|
||||||
|
PSTRING Output = MessageData;
|
||||||
PLIST_ENTRY CurrentEntry;
|
PLIST_ENTRY CurrentEntry;
|
||||||
PKD_DISPATCH_TABLE CurrentTable;
|
PKD_DISPATCH_TABLE CurrentTable;
|
||||||
|
|
||||||
if (!KdpDebugMode.Value) return FALSE;
|
if (!KdpDebugMode.Value) return;
|
||||||
|
|
||||||
/* Call the registered handlers */
|
/* Call the registered handlers */
|
||||||
CurrentEntry = KdProviders.Flink;
|
CurrentEntry = KdProviders.Flink;
|
||||||
|
@ -535,16 +548,19 @@ KdpPrintString(
|
||||||
if (WrapperTable.KdpPrintRoutine)
|
if (WrapperTable.KdpPrintRoutine)
|
||||||
WrapperTable.KdpPrintRoutine(Output->Buffer, Output->Length);
|
WrapperTable.KdpPrintRoutine(Output->Buffer, Output->Length);
|
||||||
|
|
||||||
return FALSE;
|
return;
|
||||||
|
}
|
||||||
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern STRING KdbPromptString;
|
KDSTATUS
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
NTAPI
|
NTAPI
|
||||||
KdpPromptString(
|
KdReceivePacket(
|
||||||
_In_ PSTRING PromptString,
|
IN ULONG PacketType,
|
||||||
_In_ PSTRING ResponseString)
|
OUT PSTRING MessageHeader,
|
||||||
|
OUT PSTRING MessageData,
|
||||||
|
OUT PULONG DataLength,
|
||||||
|
IN OUT PKD_CONTEXT Context)
|
||||||
{
|
{
|
||||||
#ifdef KDBG
|
#ifdef KDBG
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
|
@ -552,12 +568,21 @@ KdpPromptString(
|
||||||
CHAR Response;
|
CHAR Response;
|
||||||
USHORT i;
|
USHORT i;
|
||||||
ULONG DummyScanCode;
|
ULONG DummyScanCode;
|
||||||
|
CHAR MessageBuffer[100];
|
||||||
|
STRING ResponseString;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (PacketType != PACKET_TYPE_KD_DEBUG_IO)
|
||||||
|
return KdPacketTimedOut;
|
||||||
|
|
||||||
|
#ifdef KDBG
|
||||||
|
ResponseString.Buffer = MessageBuffer;
|
||||||
|
ResponseString.Length = 0;
|
||||||
|
ResponseString.MaximumLength = min(sizeof(MessageBuffer), MessageData->MaximumLength);
|
||||||
StringChar.Buffer = &Response;
|
StringChar.Buffer = &Response;
|
||||||
StringChar.Length = StringChar.MaximumLength = sizeof(Response);
|
StringChar.Length = StringChar.MaximumLength = sizeof(Response);
|
||||||
|
|
||||||
/* Display the string and print a new line for log neatness */
|
/* Display the string and print a new line for log neatness */
|
||||||
KdpPrintString(PromptString);
|
|
||||||
*StringChar.Buffer = '\n';
|
*StringChar.Buffer = '\n';
|
||||||
KdpPrintString(&StringChar);
|
KdpPrintString(&StringChar);
|
||||||
|
|
||||||
|
@ -573,7 +598,7 @@ KdpPromptString(
|
||||||
KbdDisableMouse();
|
KbdDisableMouse();
|
||||||
|
|
||||||
/* Loop the whole string */
|
/* Loop the whole string */
|
||||||
for (i = 0; i < ResponseString->MaximumLength; i++)
|
for (i = 0; i < ResponseString.MaximumLength; i++)
|
||||||
{
|
{
|
||||||
/* Check if this is serial debugging mode */
|
/* Check if this is serial debugging mode */
|
||||||
if (KdbDebugState & KD_DEBUG_KDSERIAL)
|
if (KdbDebugState & KD_DEBUG_KDSERIAL)
|
||||||
|
@ -618,19 +643,24 @@ KdpPromptString(
|
||||||
* Null terminate the output string -- documentation states that
|
* Null terminate the output string -- documentation states that
|
||||||
* DbgPrompt does not null terminate, but it does
|
* DbgPrompt does not null terminate, but it does
|
||||||
*/
|
*/
|
||||||
*(PCHAR)(ResponseString->Buffer + i) = 0;
|
*(PCHAR)(ResponseString.Buffer + i) = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write it back and print it to the log */
|
/* Write it back and print it to the log */
|
||||||
*(PCHAR)(ResponseString->Buffer + i) = Response;
|
*(PCHAR)(ResponseString.Buffer + i) = Response;
|
||||||
KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
|
KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
|
||||||
KdpPrintString(&StringChar);
|
KdpPrintString(&StringChar);
|
||||||
OldIrql = KdpAcquireLock(&KdpSerialSpinLock);
|
OldIrql = KdpAcquireLock(&KdpSerialSpinLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Print a new line */
|
||||||
|
*StringChar.Buffer = '\n';
|
||||||
|
KdpPrintString(&StringChar);
|
||||||
|
|
||||||
/* Return the length */
|
/* Return the length */
|
||||||
ResponseString->Length = i;
|
RtlCopyMemory(MessageData->Buffer, ResponseString.Buffer, i);
|
||||||
|
*DataLength = i;
|
||||||
|
|
||||||
if (!(KdbDebugState & KD_DEBUG_KDSERIAL))
|
if (!(KdbDebugState & KD_DEBUG_KDSERIAL))
|
||||||
KbdEnableMouse();
|
KbdEnableMouse();
|
||||||
|
@ -638,38 +668,8 @@ KdpPromptString(
|
||||||
/* Release the spinlock */
|
/* Release the spinlock */
|
||||||
KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
|
KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
|
||||||
|
|
||||||
/* Print a new line */
|
|
||||||
*StringChar.Buffer = '\n';
|
|
||||||
KdpPrintString(&StringChar);
|
|
||||||
#endif
|
#endif
|
||||||
|
return KdPacketReceived;
|
||||||
/* Success; we don't need to resend */
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
|
||||||
NTAPI
|
|
||||||
KdSendPacket(
|
|
||||||
IN ULONG PacketType,
|
|
||||||
IN PSTRING MessageHeader,
|
|
||||||
IN PSTRING MessageData,
|
|
||||||
IN OUT PKD_CONTEXT Context)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
KDSTATUS
|
|
||||||
NTAPI
|
|
||||||
KdReceivePacket(
|
|
||||||
IN ULONG PacketType,
|
|
||||||
OUT PSTRING MessageHeader,
|
|
||||||
OUT PSTRING MessageData,
|
|
||||||
OUT PULONG DataLength,
|
|
||||||
IN OUT PKD_CONTEXT Context)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
#ifdef _WINKD_
|
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
KdpPrintString(
|
KdpPrintString(
|
||||||
|
@ -132,6 +130,8 @@ KdpPromptString(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WINKD_
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KdpCommandString(IN PSTRING NameString,
|
KdpCommandString(IN PSTRING NameString,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue