Author: ekohl
Date: Sat May 25 18:28:28 2013
New Revision: 59082

URL: http://svn.reactos.org/svn/reactos?rev=59082&view=rev
Log:
[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.

Modified:
    trunk/reactos/dll/win32/msports/classinst.c

Modified: trunk/reactos/dll/win32/msports/classinst.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msports/classinst.c?rev=59082&r1=59081&r2=59082&view=diff
==============================================================================
--- trunk/reactos/dll/win32/msports/classinst.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msports/classinst.c [iso-8859-1] Sat May 25 
18:28:28 2013
@@ -129,7 +129,7 @@
                         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 @@
                         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 @@
 
     /* ... 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)
@@ -485,6 +489,8 @@
                  L"Parallel Port (%s)",
                  szPortName);
     }
+
+    TRACE("Friendly name: %S\n", szFriendlyName);
 
     /* Set the friendly name for the device */
     SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet,


Reply via email to