Skip to content

Commit

Permalink
Fix unicode build issues on Windows
Browse files Browse the repository at this point in the history
When building with unicode support, some Windows functions expect that
their input parameters are wide strings, which causes compilation
issues.

This commit fixes that by explicitly calling the narrow-string version
of the function.
  • Loading branch information
gflegar authored and JaxLinAMD committed Jul 9, 2021
1 parent fa6b0b7 commit 1311c5c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions shared/gpuopen/core/src/platforms/ddcWinPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace DevDriver
DD_UNUSED(lvl);

// OutputDebugString routes to the debug output in Visual Studio
OutputDebugString(pStr);
OutputDebugStringA(pStr);
}

Result GetAbsPathName(
Expand Down Expand Up @@ -219,7 +219,7 @@ namespace DevDriver

// We load the thread naming function dynamically to avoid issues when the current OS doesn't have
// support for the function.
HMODULE hModule = GetModuleHandle("kernel32.dll");
HMODULE hModule = GetModuleHandleA("kernel32.dll");
if (hModule != nullptr)
{
// Attempt to load the function for setting thread names
Expand Down Expand Up @@ -470,7 +470,7 @@ namespace DevDriver

if (pDir != nullptr)
{
const BOOL ret = CreateDirectory(pDir, NULL);
const BOOL ret = CreateDirectoryA(pDir, NULL);
if (ret != 0)
{
// The directory did not exist, and was created successfully
Expand Down Expand Up @@ -691,7 +691,7 @@ namespace DevDriver
/// Query the machine's hostname
{
DWORD nSize = ArraySize<DWORD>(pInfo->hostname);
GetComputerNameEx(ComputerNameDnsFullyQualified, pInfo->hostname, &nSize);
GetComputerNameExA(ComputerNameDnsFullyQualified, pInfo->hostname, &nSize);
DD_WARN(nSize > 0);
}

Expand Down Expand Up @@ -872,7 +872,7 @@ namespace DevDriver
DWORD isEnabled = 0;

HKEY hKey;
auto hResult = RegOpenKeyEx(
auto hResult = RegOpenKeyExA(
HKEY_LOCAL_MACHINE,
R"(SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock)",
0,
Expand All @@ -884,7 +884,7 @@ namespace DevDriver
{
DWORD valueSize = sizeof(DWORD);

hResult = RegQueryValueEx(
hResult = RegQueryValueExA(
hKey,
"AllowDevelopmentWithoutDevLicense",
0,
Expand Down

0 comments on commit 1311c5c

Please sign in to comment.