Fix df output on Windows#12244
Conversation
|
If I’m honest, I have a minor preference for the short device node path rather than the volume GUID path; however, the volume guid is immediately accessible in an object browser, so… eh |
|
it will need new tests |
|
|
||
| use windows_sys::Win32::Foundation::NTSTATUS; | ||
|
|
||
| pub const SYNCHRONIZE: u32 = 0x00100000; |
There was a problem hiding this comment.
this is a lot of hardcoded values here
isn't that available in windows sys ?
There was a problem hiding this comment.
I didn't realize we exported NT symbols via windows_sys::Wdk. I based lots of this on my own C++ snippets. I'll make the necessary changes.
|
GNU testsuite comparison: |
|
Does this break MSYS2 compatibility if people prefer native |
|
I'm not sure what you - could you explain in more detail? |
|
BTW I apologize, but I'll need some more time to get back to this PR. I'm currently ironing out some other kinks at Microsoft. (1-2 weeks.) |
This properly implements
FsUsageusing NT APIs. The choiceof GUID volume IDs is intentional as this matches PowerShell.
To assist with this, the PR introduces a new
ntmodule,which contains various helpers to interface with the NT API.
I expect their number to increase in the future, as the NT API
is rather well documented nowadays and expected to be stable.
They permit various implementations to be technically perfect,
such as the use of
FILE_STAT_LX_INFORMATION.Before:
After: