kernel32: Implement and test GetVolumePathNamesForVolumeName. (try 2)

Alexandre Julliard julliard at winehq.org
Wed Mar 16 10:05:46 CDT 2011


Hans Leidekker <hans at codeweavers.com> writes:

> +    for (i = 0; i < output->NumberOfMountPoints; i++)
> +    {
> +        if (output->MountPoints[i].DeviceNameOffset)
> +        {
> +            const WCHAR *device = (const WCHAR *)((const char *)output + output->MountPoints[i].DeviceNameOffset);
> +            UINT device_len = output->MountPoints[i].DeviceNameLength / sizeof(WCHAR);
> +            int drive = map_dos_device( device, device_len );
> +
> +            if (drive != -1)
> +            {
> +                len += 4;
> +                if (volumepathname && len < buflen)
> +                {
> +                    path[0] = 'A' + drive;
> +                    path[1] = ':';
> +                    path[2] = '\\';
> +                    path[3] = 0;
> +                    path += 4;
> +                }
> +            }
> +        }

This won't allow you to support GUID volume names. I think you should
query all mount points that match the device, not just the DOS drives.
Either way you should use MOUNTMGR_QUERY_POINTS instead of trying every
drive one by one.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list