[PATCH v2 2/2] wbemprox: Get the disk drive serial number from mountmgr.

Zebediah Figura z.figura12 at gmail.com
Mon May 25 13:28:30 CDT 2020


On 5/25/20 12:51 PM, Hans Leidekker wrote:
> On Mon, 2020-05-25 at 10:02 -0500, Zebediah Figura wrote:
>> On 5/25/20 8:46 AM, Hans Leidekker wrote:
>>> +static WCHAR *get_diskdrive_serialnumber( WCHAR letter )
>>> +{
>>> +    WCHAR *ret = NULL;
>>> +    STORAGE_DEVICE_DESCRIPTOR *desc;
>>> +    HANDLE handle = INVALID_HANDLE_VALUE;
>>> +    STORAGE_PROPERTY_QUERY query = {0};
>>> +    WCHAR drive[7];
>>> +    DWORD size;
>>> +
>>> +    swprintf( drive, ARRAY_SIZE(drive), L"\\\\.\\%c:", letter );
>>> +    handle = CreateFileW( drive, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
>>
>> You shouldn't need read permissions to open the file;
>> IOCTL_STORAGE_QUERY_PROPERTY has FILE_ANY_ACCESS permissions.
> 
> Passing 0 desired access make no difference here, it ends up in the same
> open(O_RDONLY) call on the Unix device file.
> 
> 
> 

Sure, though I think that's something that should be addressed 
independently.



More information about the wine-devel mailing list