Author: tfaber
Date: Sat Nov 14 08:55:46 2015
New Revision: 69883
URL:
http://svn.reactos.org/svn/reactos?rev=69883&view=rev
Log:
[NTOS:KD]
- Actually write back the response to the user buffer in KdpPrompt
Modified:
trunk/reactos/ntoskrnl/kd64/kdprint.c
Modified: trunk/reactos/ntoskrnl/kd64/kdprint.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kdprint.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/kd64/kdprint.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kd64/kdprint.c [iso-8859-1] Sat Nov 14 08:55:46 2015
@@ -212,7 +212,7 @@
NTAPI
KdpPrompt(IN LPSTR PromptString,
IN USHORT PromptLength,
- OUT LPSTR ResponseString,
+ OUT PCHAR ResponseString,
IN USHORT MaximumResponseLength,
IN KPROCESSOR_MODE PreviousMode,
IN PKTRAP_FRAME TrapFrame,
@@ -220,7 +220,8 @@
{
STRING PromptBuffer, ResponseBuffer;
BOOLEAN Enable, Resend;
- PVOID CapturedPrompt, CapturedResponse;
+ PVOID CapturedPrompt;
+ PCHAR SafeResponseString;
/* Normalize the lengths */
PromptLength = min(PromptLength,
@@ -250,8 +251,7 @@
ProbeForWrite(ResponseString,
MaximumResponseLength,
1);
- CapturedResponse = _alloca(MaximumResponseLength);
- ResponseString = CapturedResponse;
+ SafeResponseString = _alloca(MaximumResponseLength);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -259,12 +259,16 @@
_SEH2_YIELD(return 0);
}
_SEH2_END;
+ }
+ else
+ {
+ SafeResponseString = ResponseString;
}
/* Setup the prompt and response buffers */
PromptBuffer.Buffer = PromptString;
PromptBuffer.Length = PromptLength;
- ResponseBuffer.Buffer = ResponseString;
+ ResponseBuffer.Buffer = SafeResponseString;
ResponseBuffer.Length = 0;
ResponseBuffer.MaximumLength = MaximumResponseLength;