mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 07:46:29 +00:00
[NTOS:KDBG]: Sync back the code that I copied in FreeLdr (r70403) for COM port selection.
svn path=/trunk/; revision=70404
This commit is contained in:
parent
7642306ded
commit
38814b24c9
1 changed files with 5 additions and 6 deletions
|
@ -28,6 +28,8 @@ const ULONG BaseArray[] = {0, 0xF1012000};
|
||||||
#error Unknown architecture
|
#error Unknown architecture
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MAX_COM_PORTS (sizeof(BaseArray) / sizeof(BaseArray[0]) - 1)
|
||||||
|
|
||||||
/* STATIC VARIABLES ***********************************************************/
|
/* STATIC VARIABLES ***********************************************************/
|
||||||
|
|
||||||
// static CPPORT DefaultPort = {0, 0, 0};
|
// static CPPORT DefaultPort = {0, 0, 0};
|
||||||
|
@ -35,7 +37,6 @@ const ULONG BaseArray[] = {0, 0xF1012000};
|
||||||
/* The COM port must only be initialized once! */
|
/* The COM port must only be initialized once! */
|
||||||
// static BOOLEAN PortInitialized = FALSE;
|
// static BOOLEAN PortInitialized = FALSE;
|
||||||
|
|
||||||
|
|
||||||
/* REACTOS FUNCTIONS **********************************************************/
|
/* REACTOS FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -58,7 +59,6 @@ KdPortInitializeEx(
|
||||||
/*
|
/*
|
||||||
* Find the port if needed
|
* Find the port if needed
|
||||||
*/
|
*/
|
||||||
SIZE_T i;
|
|
||||||
|
|
||||||
if (!PortInitialized)
|
if (!PortInitialized)
|
||||||
{
|
{
|
||||||
|
@ -72,12 +72,11 @@ KdPortInitializeEx(
|
||||||
* If we reach the first element of the list, the invalid COM port,
|
* If we reach the first element of the list, the invalid COM port,
|
||||||
* then it means that no valid port was found.
|
* then it means that no valid port was found.
|
||||||
*/
|
*/
|
||||||
for (i = sizeof(BaseArray) / sizeof(BaseArray[0]) - 1; i > 0; i--)
|
for (ComPortNumber = MAX_COM_PORTS; ComPortNumber > 0; ComPortNumber--)
|
||||||
{
|
{
|
||||||
if (CpDoesPortExist(UlongToPtr(BaseArray[i])))
|
if (CpDoesPortExist(UlongToPtr(BaseArray[ComPortNumber])))
|
||||||
{
|
{
|
||||||
PortInformation->Address = DefaultPort.Address = BaseArray[i];
|
PortInformation->Address = DefaultPort.Address = BaseArray[ComPortNumber];
|
||||||
ComPortNumber = (ULONG)i;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue