diff --git a/dll/win32/kernel32/client/file/disk.c b/dll/win32/kernel32/client/file/disk.c index 12751c6b1ad..07d0c15b85e 100644 --- a/dll/win32/kernel32/client/file/disk.c +++ b/dll/win32/kernel32/client/file/disk.c @@ -608,6 +608,9 @@ GetDriveTypeW(IN LPCWSTR lpRootPathName) return DRIVE_NO_ROOT_DIR; } + /* We will work with a device object, so trim the trailing backslash now */ + PathName.Length -= sizeof(WCHAR); + /* Let's probe for it, by forcing open failure! */ RetryOpen = TRUE; InitializeObjectAttributes(&ObjectAttributes, &PathName,