The current implementation of the GetDriveTypeW/A function relies on native system calls (such as fstatfs() in Linux) to determine the actual type of the drive, disregarding any configuration set through the mounts manager (wincfg). This patch changes the priority, giving precedence to the mounts manager configuration, making the user responsible for mapping drives. System calls will only be used if the drive is not explicitly configured by the user. I acknowledge that this is a breaking change, but I believe it enforces the correct behavior for GetDriveType.
From: robert robert.ayrapetyan@gmail.com
--- dlls/kernelbase/volume.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c index d4895228525..1ee93d1e6b1 100644 --- a/dlls/kernelbase/volume.c +++ b/dlls/kernelbase/volume.c @@ -580,13 +580,13 @@ UINT WINAPI DECLSPEC_HOTPATCH GetDriveTypeW( LPCWSTR root ) HANDLE handle; UINT ret;
+ ret = get_mountmgr_drive_type( root ); + if (ret != DRIVE_UNKNOWN) { + return ret; + } + if (!open_device_root( root, &handle )) { - /* CD ROM devices do not necessarily have a volume, but a drive type */ - ret = get_mountmgr_drive_type( root ); - if (ret == DRIVE_CDROM || ret == DRIVE_REMOVABLE) - return ret; - return DRIVE_NO_ROOT_DIR; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148613
Your paranoid android.
=== debian11b (64 bit WoW report) ===
kernel32: drive.c:68: Test failed: got 3 for drive spec 'Z?' drive.c:72: Test failed: got 3 for drive spec 'Z' drive.c:122: Test failed: got 3 for drive spec 'L"Z?"' drive.c:126: Test failed: got 3 for drive spec 'L"Z"'
wmp: media: Timeout