Skip to content
Snippets Groups Projects
Commit 047b27e1 authored by Steve Lhomme's avatar Steve Lhomme
Browse files

windrive: use ANSI API's to test drive letters

No need for wide chars for that. The API is supported in UWP [1].
The code was also puttin a WCHAR letter in a char string.

[1] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdrivetypea

(cherry picked from commit ec8924b3)
parent 51c25f6a
No related branches found
No related tags found
1 merge request!6429[3.0] win32: backport some long path potential issues
......@@ -60,19 +60,19 @@ static int Open (vlc_object_t *obj)
LONG drives = GetLogicalDrives ();
char mrl[12] = "file:///A:/", name[3] = "A:";
WCHAR path[4] = TEXT("A:\\");
CHAR path[4] = "A:\\";
for (char d = 0; d < 26; d++)
{
input_item_t *item;
WCHAR letter = 'A' + d;
CHAR letter = 'A' + d;
/* Does this drive actually exist? */
if (!(drives & (1 << d)))
continue;
/* Is it a disc drive? */
path[0] = letter;
if (GetDriveType (path) != DRIVE_CDROM)
if (GetDriveTypeA (path) != DRIVE_CDROM)
continue;
mrl[8] = name[0] = letter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment