+ /* Handle user-mode buffers safely */
+ _SEH2_TRY
+ {
+ /* Probe the prompt */
+ ProbeForRead(PromptString,
+ PromptLength,
+ 1);
+
+ /* Capture prompt */
+ KdpMoveMemory(CapturedPrompt,
+ PromptString,
+ PromptLength);
+ PromptString = CapturedPrompt;
+
+ /* Probe and make room for response */
+ ProbeForWrite(ResponseString,
+ MaximumResponseLength,
+ 1);
+ SafeResponseString = SafeResponseBuffer;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Bad string pointer, bail out */
+ _SEH2_YIELD(return 0);
+ }
+ _SEH2_END;
+ }
+ else
+ {
+ SafeResponseString = ResponseString;