Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
windows: fall back for volume info query
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ihnorton authored and saghul committed Mar 3, 2014
1 parent 409c7b3 commit 2930d04
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/win/fs.c
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2930d04

Please sign in to comment.