diff --git a/dlls/wnaspi32/aspi.c b/dlls/wnaspi32/aspi.c index e950d7da0a2..11c3f3bc070 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 )