[vlc-commits] [Git][videolan/vlc][master] access: file: fix detection of mapped network drives
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Sep 1 05:31:12 UTC 2022
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
8aaf4675 by Steve Lhomme at 2022-09-01T05:16:17+00:00
access: file: fix detection of mapped network drives
Regression from a89c7662b3cc7956547ed00730a002fa8a962a26 that is still usable
in UWP.
- - - - -
1 changed file:
- modules/access/file.c
Changes:
=====================================
modules/access/file.c
=====================================
@@ -128,6 +128,27 @@ static bool IsRemote(int fd, const char *path)
return false;
if (path[0] == '\\' && path[1] == '\\')
return true;
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_RS3
+ if (path[1] == ':')
+ {
+ char drive[4];
+ drive[0] = path[0]; // can only be < 0x80 if second char is ':'
+ drive[1] = ':';
+ drive[2] = '\\';
+ drive[3] = '\0';
+ UINT driveType = GetDriveTypeA(drive);
+ switch (driveType)
+ {
+ case DRIVE_FIXED:
+ case DRIVE_REMOVABLE: // but a floppy drive is slower than network
+ case DRIVE_RAMDISK:
+ case DRIVE_CDROM:
+ return false;
+ default:
+ return true;
+ }
+ }
+#endif
return false;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8aaf4675e6ec513df1c784bbf0eb1d45aa1e7d00
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8aaf4675e6ec513df1c784bbf0eb1d45aa1e7d00
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list