[PATCH v6 5/5] kernelbase: Reimplement GetVolumeInformation on top of GetVolumeInformationByHandle.

Erich E. Hoover erich.e.hoover at gmail.com
Thu Feb 11 12:23:50 CST 2021


On Wed, Feb 10, 2021 at 9:37 PM Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
>
> Just a couple small nitpicks...
>
> On 2/6/21 12:26 PM, Erich E. Hoover wrote:
> > From: "Erich E. Hoover" <erich.e.hoover at gmail.com>
> > Subject: [PATCH v6 5/5] kernelbase: Reimplement GetVolumeInformation on top of GetVolumeInformationByHandle.
> > Message-Id: <CAEU2+vrAcFN5oXJvunL0umLXW4W0je0K41cEfEtPkAkDre=StQ at mail.gmail.com>
> > Date: Sat, 6 Feb 2021 11:26:05 -0700
> > ...
> > @@ -1522,6 +1522,8 @@ static void test_GetVolumeInformationByHandle(void)
> >      FILE_FS_VOLUME_INFORMATION *volume_info = (void *)buffer;
> >      DWORD serial, filename_len, flags;
> >      WCHAR label[20], fsname[20];
> > +    char Root_Slash[]="C:\\";
>
> Why is this a local variable?

This is copied from test_GetVolumeInformationA, but it looks like I
missed adding this block:
    /* get windows drive letter and update strings for testing */
    result = GetWindowsDirectoryA(windowsdir, sizeof(windowsdir));
    ok(result < sizeof(windowsdir), "windowsdir is abnormally long!\n");
    ok(result != 0, "GetWindowsDirectory: error %d\n", GetLastError());
    Root_Colon[0] = windowsdir[0];
    Root_Slash[0] = windowsdir[0];
I'll add this missing block in so that the test always uses the
correct drive letter...

> > ...
> > -    nt_name.Length -= sizeof(WCHAR);  /* without trailing slash */
> > -    status = NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE,
> > -                         FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
> > -    nt_name.Length += sizeof(WCHAR);
> > ...
> > -    status = NtQueryVolumeInformationFile( handle, &io, &info, sizeof(info), FileFsDeviceInformation );
> > -    NtClose( handle );
> > +    status = NtOpenFile( &handle, SYNCHRONIZE | FILE_LIST_DIRECTORY, &attr, &io,
> > +                         FILE_SHARE_READ | FILE_SHARE_WRITE,
> > +                         FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
>
> Why FILE_LIST_DIRECTORY?

I honestly have no idea, I thought I copied from the original
NtOpenFile (above).  It's possible that changed at some point, but it
could also be that I copied it from somewhere else or that it's a
debugging remnant (it's been a while since I originally put this
together).

> > ...



More information about the wine-devel mailing list