Commit 3a59ac08 authored by Rok Mandeljc's avatar Rok Mandeljc Committed by Alexandre Julliard

wnaspi32: Fix Controller -> H/C mapping.

parent 1161d0e1
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment