ntdll: Try2: Fix IOCTL_SCSI_GET_ADDRESS and HKLM\HARDWARE\DEVICEMAP\Scsi entries

Alexandre Julliard julliard at winehq.org
Thu Jul 28 11:52:57 CDT 2005


Vitaliy Margolen <wine-patch at kievinfo.com> writes:

> @@ -235,14 +249,18 @@ static void create_hardware_branch(void)
>      int i;
>      HANDLE handle;
>      char drive[] = "\\\\.\\A:";
> +    char drive1[] = "A:\\";
> +    UINT uNumber = 0;
>  
>      /* create entries for cdroms (skipping A: and B:) */
>      for (i = 2; i < 26; i++)
>      {
>          drive[4] = 'A' + i;
> +        drive1[0] = 'A' + i;
> +        if (GetDriveTypeA(drive1) != DRIVE_CDROM) continue;
>          handle = CreateFileA( drive, 0, 0, NULL, OPEN_EXISTING, 0, 0 );
>          if (handle == INVALID_HANDLE_VALUE) continue;

You shouldn't use GetDriveType here, you should determine the device
type from the ioctls you do on the handle. The GetDriveType result
doesn't necessarily correspond to the device since it can be changed
in the registry.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list