[MSPORTS]

- Only use the first port base address for parallel port identification. ECP ports have a second base address that confused the identification code.
- Apply the same check to the serial port identification code because it can prevent potential malfunction. At least it doesn't hurt to be on the safe side.

svn path=/trunk/; revision=59082
This commit is contained in:
Eric Kohl 2013-05-25 18:28:28 +00:00
parent 6b5c8cd891
commit c5855337f5

View file

@ -129,7 +129,7 @@ GetSerialPortNumber(IN HDEVINFO DeviceInfoSet,
TRACE("Port: Start: %I64x Length: %lu\n",
lpResDes->u.Port.Start.QuadPart,
lpResDes->u.Port.Length);
if (lpResDes->u.Port.Start.HighPart == 0)
if ((lpResDes->u.Port.Start.HighPart == 0) && (dwBaseAddress == 0))
dwBaseAddress = (DWORD)lpResDes->u.Port.Start.LowPart;
break;
@ -201,7 +201,7 @@ GetParallelPortNumber(IN HDEVINFO DeviceInfoSet,
TRACE("Port: Start: %I64x Length: %lu\n",
lpResDes->u.Port.Start.QuadPart,
lpResDes->u.Port.Length);
if (lpResDes->u.Port.Start.HighPart == 0)
if ((lpResDes->u.Port.Start.HighPart == 0) && (dwBaseAddress == 0))
dwBaseAddress = (DWORD)lpResDes->u.Port.Start.LowPart;
break;
@ -416,12 +416,16 @@ InstallParallelPort(IN HDEVINFO DeviceInfoSet,
/* ... try to determine the port number from its resources */
if (dwPortNumber == 0)
{
dwPortNumber = GetParallelPortNumber(DeviceInfoSet,
DeviceInfoData);
TRACE("GetParallelPortNumber() returned port number: %lu\n", dwPortNumber);
}
if (dwPortNumber == 0)
{
/* FIXME */
FIXME("Got no valid port numer!\n");
}
if (dwPortNumber != 0)
@ -486,6 +490,8 @@ InstallParallelPort(IN HDEVINFO DeviceInfoSet,
szPortName);
}
TRACE("Friendly name: %S\n", szFriendlyName);
/* Set the friendly name for the device */
SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet,
DeviceInfoData,