https://bugs.winehq.org/show_bug.cgi?id=37408
Bug ID: 37408 Summary: GetDiskFreeSpaceExW - Does not accept path to file Product: Wine Version: 1.7.28 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: james.d@hexhost.net
Created attachment 49751 --> https://bugs.winehq.org/attachment.cgi?id=49751 Trace Log
According to standard Microsoft documentation the GetDiskFreeSpaceExW WINAPI call should fail if a directory is not given as the path to check free disk space for. The documentation is incorrect. Making a call to GetDiskFreeSpaceExW with a full path to a file (and not a directory) does indeed succeed on standard windows.
Doing this in Wine on Mac OSX results in open_device_root being called on a non directory path and that non directory path makes it all the way to the wineserver request to open the path with a type of FILE_DIRECTORY_FILE. Which in turn gets an error from wineserver of NOT_A_DIRECTORY as expected.
Here is a unwinding of the code to show what is happening:
http://source.winehq.org/source/server/fd.c#1839 http://source.winehq.org/source/dlls/ntdll/file.c#0112 http://source.winehq.org/source/dlls/ntdll/file.c#0242 http://source.winehq.org/source/dlls/kernel32/volume.c#0174 http://source.winehq.org/source/dlls/kernel32/volume.c#1681
Attached is a use case example.