mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-21 02:29:06 +00:00
expect TCHAR returns from RegQueryValueEx now that we are potentially building with _UNICODE
This commit is contained in:
parent
07e9db881c
commit
837c82d8b8
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "sysdeps.h"
|
#include "sysdeps.h"
|
||||||
#include "user_strings.h"
|
#include "user_strings.h"
|
||||||
|
#include "util_windows.h"
|
||||||
|
|
||||||
// Platform-specific string definitions
|
// Platform-specific string definitions
|
||||||
user_string_def platform_strings[] = {
|
user_string_def platform_strings[] = {
|
||||||
@ -81,7 +81,11 @@ static const char *get_volume_name(void)
|
|||||||
HKEY hHelpKey;
|
HKEY hHelpKey;
|
||||||
DWORD key_type, cbData;
|
DWORD key_type, cbData;
|
||||||
|
|
||||||
static char volume[256];
|
#ifdef _UNICODE
|
||||||
|
static char out_volume[256];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static TCHAR volume[256];
|
||||||
memset(volume, 0, sizeof(volume));
|
memset(volume, 0, sizeof(volume));
|
||||||
|
|
||||||
// Try Windows 2000 key first
|
// Try Windows 2000 key first
|
||||||
@ -118,14 +122,20 @@ static const char *get_volume_name(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fix the error that some "tweak" apps do.
|
// Fix the error that some "tweak" apps do.
|
||||||
if (_stricmp(volume, "%USERNAME% on %COMPUTER%") == 0)
|
if (_tcsicmp(volume, TEXT("%USERNAME% on %COMPUTER%")) == 0)
|
||||||
volume[0] = '\0';
|
volume[0] = TEXT('\0');
|
||||||
|
|
||||||
// No volume name found, default to "My Computer"
|
// No volume name found, default to "My Computer"
|
||||||
if (volume[0] == 0)
|
if (volume[0] == 0)
|
||||||
strcpy(volume, "My Computer");
|
_tcscpy(volume, TEXT("My Computer"));
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _UNICODE
|
||||||
|
strlcpy(out_volume, volume, 256);
|
||||||
|
return out_volume;
|
||||||
|
#else
|
||||||
return volume;
|
return volume;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user