Always use the ANSI variant of the Windows functions.
This commit is contained in:
parent
7b9bd1880c
commit
3f9f722219
@ -52,7 +52,7 @@ serial_enumerate (serial_callback_t callback, void *userdata)
|
||||
{
|
||||
// Open the registry key.
|
||||
HKEY hKey;
|
||||
LONG rc = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey);
|
||||
LONG rc = RegOpenKeyExA (HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey);
|
||||
if (rc != ERROR_SUCCESS) {
|
||||
if (rc == ERROR_FILE_NOT_FOUND)
|
||||
return 0;
|
||||
@ -74,7 +74,7 @@ serial_enumerate (serial_callback_t callback, void *userdata)
|
||||
DWORD name_len = sizeof (name);
|
||||
DWORD data_len = sizeof (data);
|
||||
DWORD type = 0;
|
||||
rc = RegEnumValue (hKey, i, name, &name_len, NULL, &type, (LPBYTE) data, &data_len);
|
||||
rc = RegEnumValueA (hKey, i, name, &name_len, NULL, &type, (LPBYTE) data, &data_len);
|
||||
if (rc != ERROR_SUCCESS) {
|
||||
RegCloseKey(hKey);
|
||||
return -1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user