[PATCH v2 1/2] ntdll: Return a unique volume number from NtQueryInformationFile(FileIdInformation).

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Mar 5 03:24:03 CST 2020


Hi Zebediah,

On 5/3/20 2:04 pm, Zebediah Figura wrote:
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
> v2: Shift the device number by 4 bytes, since the lower 4 bytes are used by the
> volume serial number.
> 
>   dlls/ntdll/file.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
> index 7dfb0a4800e..2aa5d8f979f 100644
> --- a/dlls/ntdll/file.c
> +++ b/dlls/ntdll/file.c
> @@ -2508,7 +2508,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
>           else
>           {
>               FILE_ID_INFORMATION *info = ptr;
> -            info->VolumeSerialNumber = 0;  /* FIXME */
> +            info->VolumeSerialNumber = (ULONGLONG)st.st_dev << 32;
>               memset( &info->FileId, 0, sizeof(info->FileId) );
>               *(ULONGLONG *)&info->FileId = st.st_ino;
>           }
> 
Each partition is assigned a unique Serial Number when the driver is 
formatted and the serial never changes.

The above will return, possibly, the same serial for each drive queried 
(assuming the drives are on the same HDD).

The staging wineboot-serial patchset might be a better solution.

Regards
Alistair




More information about the wine-devel mailing list