Skip to content

Commit 8b3fae2

Browse files
authored
Use Wide String variants explicitly for Windows API calls (microsoft#7235)
This PR changes some code in ExecutionTests.cpp to use the wide string variants of Windows API calls explicitly. This is because some internal builds will get confused about which overload to resolve the GetModuleHandle function to. By being explicit, this should eliminate the error that an arg can't be converted to LPCWSTR.
1 parent 9e8a698 commit 8b3fae2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,10 +820,10 @@ class ExecutionTest {
820820
return false;
821821
}
822822

823-
if (GetModuleHandle("d3d10warp.dll") != NULL) {
824-
CHAR szFullModuleFilePath[MAX_PATH] = "";
825-
GetModuleFileName(GetModuleHandle("d3d10warp.dll"),
826-
szFullModuleFilePath, sizeof(szFullModuleFilePath));
823+
if (GetModuleHandleW(L"d3d10warp.dll") != NULL) {
824+
WCHAR szFullModuleFilePath[MAX_PATH] = L"";
825+
GetModuleFileNameW(GetModuleHandleW(L"d3d10warp.dll"),
826+
szFullModuleFilePath, sizeof(szFullModuleFilePath));
827827
WEX::Logging::Log::Comment(WEX::Common::String().Format(
828828
L"WARP driver loaded from: %S", szFullModuleFilePath));
829829
}

0 commit comments

Comments
 (0)