[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: ntdll: Try2: Fix IOCTL_SCSI_GET_ADDRESS and HKLM\HARDWARE\DEVICEMAP\Scsi entries
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2005-07-28 16:52:57
Message-ID: 878xzqg9ee.fsf () wine ! dyndns ! org
[Download RAW message or body]

Vitaliy Margolen <wine-patch@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@winehq.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic