Rok Mandeljc : wnaspi32: Fix Controller -> H/C mapping.

Alexandre Julliard julliard at winehq.org
Fri Nov 2 08:10:32 CDT 2007


Module: wine
Branch: master
Commit: 3a59ac0829cefece6fa551bf5062af8e1670372a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3a59ac0829cefece6fa551bf5062af8e1670372a

Author: Rok Mandeljc <manrok at email.si>
Date:   Thu Nov  1 08:09:10 2007 +0100

wnaspi32: Fix Controller -> H/C mapping.

---

 dlls/wnaspi32/aspi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/wnaspi32/aspi.c b/dlls/wnaspi32/aspi.c
index e950d7d..11c3f3b 100644
--- a/dlls/wnaspi32/aspi.c
+++ b/dlls/wnaspi32/aspi.c
@@ -181,7 +181,8 @@ DWORD ASPI_GetHCforController( int controller )
     HKEY hkeyScsi, hkeyPort;
     DWORD i = 0, numPorts;
     int num_ha = controller + 1;
-    WCHAR wPortName[11];
+    WCHAR wPortName[15];
+    WCHAR wBusName[15];
 
     if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wDevicemapScsi, 0,
         KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, &hkeyScsi) != ERROR_SUCCESS )
@@ -212,7 +213,7 @@ DWORD ASPI_GetHCforController( int controller )
         return 0xFFFFFFFF;
     }
 
-    if (RegEnumKeyW(hkeyPort, -num_ha, wPortName, sizeof(wPortName)) != ERROR_SUCCESS)
+    if (RegEnumKeyW(hkeyPort, -num_ha, wBusName, sizeof(wBusName)) != ERROR_SUCCESS)
     {
         ERR("Failed to enumerate keys\n");
         RegCloseKey(hkeyPort);
@@ -220,7 +221,7 @@ DWORD ASPI_GetHCforController( int controller )
     }
     RegCloseKey(hkeyPort);
 
-    return ((--i) << 16) + atoiW(&wPortName[9]);
+    return (atoiW(&wPortName[9]) << 16) + atoiW(&wBusName[9]);
 }
 
 int SCSI_OpenDevice( int h, int c, int t, int d )




More information about the wine-cvs mailing list