wnaspi32: Fix Controller -> H/C mapping.

This commit is contained in:
Rok Mandeljc 2007-11-01 08:09:10 +01:00 committed by Alexandre Julliard
parent 1161d0e15e
commit 3a59ac0829
1 changed files with 4 additions and 3 deletions

View File

@ -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 )