153{
156
157 PCHAR CommandLine, PortString, BaudString, IrqString;
159
160
161 if (LoaderBlock)
162 {
163
164 CommandLine = LoaderBlock->LoadOptions;
165
166
168
169
170 PortString =
strstr(CommandLine,
"DEBUGPORT");
171 BaudString =
strstr(CommandLine,
"BAUDRATE");
172 IrqString =
strstr(CommandLine,
"IRQ");
173
174
175 if (PortString)
176 {
177
178 PortString +=
strlen(
"DEBUGPORT");
179
180
181 while (*PortString == ' ') PortString++;
182 PortString++;
183
184
185 if (
strncmp(PortString,
"COM", 3) != 0)
186 {
188 }
189
190
191 PortString += 3;
194 {
196 }
197
198
199 ComPortNumber =
Value;
200 }
201
202
203 if (BaudString)
204 {
205
206 BaudString +=
strlen(
"BAUDRATE");
207
208
209 while (*BaudString == ' ') BaudString++;
210
211
212 if (*BaudString)
213 {
214
217 }
218 }
219
220
221 if (IrqString)
222 {
223
224 IrqString +=
strlen(
"IRQ");
225
226
227 while (*IrqString == ' ') IrqString++;
228
229
230 if (*IrqString)
231 {
232
235 }
236 }
237 }
238
239#ifdef KDDEBUG
240
241
242
243
244 {
245
246
247
248
249
250
253 {
254
256 break;
257 }
258 if (ComPort != 0)
260 }
261#endif
262
263
265}
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
NTSTATUS NTAPI CpInitialize(IN PCPPORT Port, IN PUCHAR Address, IN ULONG BaudRate)
BOOLEAN NTAPI CpDoesPortExist(IN PUCHAR Address)
static const ULONG BaseArray[]
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
#define DEFAULT_DEBUG_PORT
#define DEFAULT_DEBUG_BAUD_RATE
NTSTATUS NTAPI KdpPortInitialize(IN ULONG ComPortNumber, IN ULONG ComPortBaudRate)
#define DEFAULT_BAUD_RATE
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value