From 839f69d249a616972250c86201df296231ff7770 Mon Sep 17 00:00:00 2001 From: Ryan Lai Date: Tue, 22 Jun 2021 14:31:20 -0700 Subject: [PATCH] Implement WINRT_IMPL_LoadLibraryW to avoid calling LoadLibraryW directly (#8065) * Override load library w in cppwinrt * Add comment --- winml/dll/module.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/winml/dll/module.cpp b/winml/dll/module.cpp index e38dcc3cf3..43e4969efc 100644 --- a/winml/dll/module.cpp +++ b/winml/dll/module.cpp @@ -134,3 +134,8 @@ STDAPI DllGetActivationFactory(HSTRING classId, void** factory) { return ret; } + +// LoadLibraryW isn't support on Windows 8.1. This is a workaround so that CppWinRT calls this function for loading libraries +void* __stdcall WINRT_IMPL_LoadLibraryW(wchar_t const* name) noexcept { + return LoadLibraryExW(name, nullptr, 0); +} \ No newline at end of file