00117 :
00118
00119 This routine prints a string, then reads a reply string.
00120
00121 Arguments:
00122
00123 Output - Supplies a pointer to a string descriptor
for the output string.
00124
00125 Input - Supplies a pointer to a string descriptor
for the input string.
00126 (Length stored/returned in Input->Length)
00127
00128 Return Value:
00129
00130
TRUE -
A Breakin sequence was seen, caller should breakpoint and retry
00131
FALSE - No Breakin seen.
00132
00133 --*/
00134
00135 {
00136
00137 ULONG Length;
00138 STRING MessageData;
00139 STRING MessageHeader;
00140 DBGKD_DEBUG_IO DebugIo;
00141 ULONG ReturnCode;
00142
00143
00144
00145
00146
00147 Length =
KdpMoveMemory(
00148 (PCHAR)KdpMessageBuffer,
00149 (PCHAR)Output->Buffer,
00150 Output->Length
00151 );
00152
00153
00154
00155
00156
00157
00158
if ((
sizeof(DBGKD_DEBUG_IO) + Length) > PACKET_MAX_SIZE) {
00159 Length = PACKET_MAX_SIZE -
sizeof(DBGKD_DEBUG_IO);
00160 }
00161
00162
00163
00164
00165
00166 DebugIo.ApiNumber = DbgKdGetStringApi;
00167 DebugIo.ProcessorLevel =
KeProcessorLevel;
00168 DebugIo.Processor = (
USHORT)
KeGetCurrentPrcb()->Number;
00169 DebugIo.u.GetString.LengthOfPromptString = Length;
00170 DebugIo.u.GetString.LengthOfStringRead = Input->MaximumLength;
00171 MessageHeader.Length =
sizeof(DBGKD_DEBUG_IO);
00172 MessageHeader.Buffer = (PCHAR)&DebugIo;
00173
00174
00175
00176
00177
00178 MessageData.Length = (
USHORT)Length;
00179 MessageData.Buffer =
KdpMessageBuffer;
00180
00181
00182
00183
00184
00185
KdpSendPacket(
00186 PACKET_TYPE_KD_DEBUG_IO,
00187 &MessageHeader,
00188 &MessageData
00189 );
00190
00191
00192
00193
00194
00195
00196 MessageHeader.MaximumLength =
sizeof(DBGKD_DEBUG_IO);
00197 MessageData.MaximumLength =
KDP_MESSAGE_BUFFER_SIZE;
00198
00199
do {
00200 ReturnCode =
KdpReceivePacket(
00201 PACKET_TYPE_KD_DEBUG_IO,
00202 &MessageHeader,
00203 &MessageData,
00204 &Length
00205 );
00206
if (ReturnCode ==
KDP_PACKET_RESEND) {
00207
return TRUE;
00208 }
00209 }
while (ReturnCode !=
KDP_PACKET_RECEIVED);
00210
00211
00212
if (Length > Input->MaximumLength) {
00213 Length = Input->MaximumLength;
00214 }
00215
00216 Input->Length = (
USHORT)
KdpMoveMemory(
00217 (PCHAR)Input->Buffer,
00218 (PCHAR)KdpMessageBuffer,
00219 Length
00220 );
00221
00222
return FALSE;
00223 }
}