Browse Source

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 ec8924b3a9)
cherry-pick-c5513cf9
Steve Lhomme 3 years ago
parent
commit
047b27e1e0
  1. 6
      modules/services_discovery/windrive.c

6
modules/services_discovery/windrive.c

@ -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;

Loading…
Cancel
Save