windows: fall back for volume info query
Wine does not currently support FileFsVolumeInformation: https://github.com/mirrors/wine/blob/0e42fd97c0/dlls/ntdll/file.c#L2679 So check io_status and fall back to previous behavior if not implemented.
This commit is contained in:
parent
409c7b37c1
commit
2930d04e5b
@ -861,9 +861,13 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) {
|
||||
FileFsVolumeInformation);
|
||||
|
||||
/* Buffer overflow (a warning status code) is expected here. */
|
||||
if (NT_ERROR(nt_status)) {
|
||||
if (io_status.Status == STATUS_NOT_IMPLEMENTED) {
|
||||
statbuf->st_dev = 0;
|
||||
} else if (NT_ERROR(nt_status)) {
|
||||
SetLastError(pRtlNtStatusToDosError(nt_status));
|
||||
return -1;
|
||||
} else {
|
||||
statbuf->st_dev = volume_info.VolumeSerialNumber;
|
||||
}
|
||||
|
||||
/* Todo: st_mode should probably always be 0666 for everyone. We might also
|
||||
@ -920,8 +924,6 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) {
|
||||
|
||||
statbuf->st_nlink = file_info.StandardInformation.NumberOfLinks;
|
||||
|
||||
statbuf->st_dev = volume_info.VolumeSerialNumber;
|
||||
|
||||
/* The st_blksize is supposed to be the 'optimal' number of bytes for reading
|
||||
* and writing to the disk. That is, for any definition of 'optimal' - it's
|
||||
* supposed to at least avoid read-update-write behavior when writing to the
|
||||
|
||||
Loading…
Reference in New Issue
Block a user