ntdll: Fix IOCTL_SCSI_GET_ADDRESS and HKLM\HARDWARE\DEVICEMAP\Scsi entries
Vitaliy Margolen
wine-patch at kievinfo.com
Wed Jul 20 12:20:27 CDT 2005
Reverse PortNumber and PathId the way it should be. Tested against win2k.
Fix creation of HKLM\HARDWARE\DEVICEMAP\Scsi entries accordingly.
Vitaliy Margolen
changelog:
dlls/ntdll/cdrom.c
Fix IOCTL_SCSI_GET_ADDRESS
dlls/kernel/oldconfig.c
Fix creation of HKLM\HARDWARE\DEVICEMAP\Scsi entries according to fixed
IOCTL_SCSI_GET_ADDRESS.
-------------- next part --------------
Index: dlls/ntdll/cdrom.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/cdrom.c,v
retrieving revision 1.63
diff -u -p -r1.63 cdrom.c
--- dlls/ntdll/cdrom.c 20 Jul 2005 10:28:27 -0000 1.63
+++ dlls/ntdll/cdrom.c 20 Jul 2005 17:06:36 -0000
@@ -1708,9 +1713,9 @@ static NTSTATUS CDROM_GetAddress(int fd,
if ( ! CDROM_GetInterfaceInfo(fd, &portnum, &busid, &targetid, &lun))
return STATUS_NOT_SUPPORTED;
- address->PortNumber = portnum;
- address->PathId = busid; /* bus number */
- address->TargetId = targetid;
+ address->PortNumber = busid; /* bus number - primary=0 secondary=1 for ide */
+ address->PathId = portnum;
+ address->TargetId = targetid; /* master=0 slave=1 for ide */
address->Lun = lun;
return STATUS_SUCCESS;
}
Index: dlls/kernel/oldconfig.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/oldconfig.c,v
retrieving revision 1.7
diff -u -p -r1.7 oldconfig.c
--- dlls/kernel/oldconfig.c 11 Jul 2005 20:44:59 -0000 1.7
+++ dlls/kernel/oldconfig.c 20 Jul 2005 17:07:23 -0000
@@ -171,7 +171,7 @@ static void init_cdrom_registry( HANDLE
NtSetValueKey( portKey,&nameW, 0, REG_DWORD, (BYTE *)&value, sizeof(DWORD));
RtlFreeUnicodeString( &nameW );
- snprintf(buffer,40,"Scsi Bus %d", scsi_addr.PathId);
+ snprintf(buffer,40,"Scsi Bus %d", scsi_addr.TargetId);
attr.RootDirectory = portKey;
if (!RtlCreateUnicodeStringFromAsciiz( &nameW, buffer ) ||
NtCreateKey( &busKey, KEY_ALL_ACCESS, &attr, 0,
@@ -193,7 +193,7 @@ static void init_cdrom_registry( HANDLE
RtlFreeUnicodeString( &nameW );
NtClose( targetKey );
- snprintf(buffer,40,"Target Id %d", scsi_addr.TargetId);
+ snprintf(buffer,40,"Target Id %d", scsi_addr.PathId);
attr.RootDirectory = busKey;
if (!RtlCreateUnicodeStringFromAsciiz( &nameW, buffer ) ||
NtCreateKey( &targetKey, KEY_ALL_ACCESS, &attr, 0,
More information about the wine-patches
mailing list