When built with MSVC with unicode enabled, this gave:
warning C4133: 'function': incompatible types - from 'char *' to 'LPCWSTR'
due to CreateFile expanding to CreateFileW which accepts UTF-16 filenames.
The device name used here is in 8-bit format, having come from a call to
wc_to_utf8() in either get_root_hub_name() or get_external_hub_name(). So
we need to use CreateFileA.
return;
strcpy(device_name, "\\\\.\\");
strcat(device_name, hub_name);
- hub_device = CreateFile(device_name, GENERIC_WRITE, FILE_SHARE_WRITE,
- NULL, OPEN_EXISTING, 0, NULL);
+ hub_device = CreateFileA(device_name, GENERIC_WRITE, FILE_SHARE_WRITE,
+ NULL, OPEN_EXISTING, 0, NULL);
free(device_name);
if (hub_device == INVALID_HANDLE_VALUE)
return;