From 25dc14f80520eb13f3836b2a2aa24148e12b1394 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Tue, 26 Oct 2021 03:04:03 +0200 Subject: [PATCH] util/library: Load wstring instead of string --- source/util/util-library.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/util/util-library.cpp b/source/util/util-library.cpp index c7311512..0f1ce7a7 100644 --- a/source/util/util-library.cpp +++ b/source/util/util-library.cpp @@ -38,9 +38,9 @@ streamfx::util::library::library(std::filesystem::path file) : _library(nullptr) { #if defined(ST_WINDOWS) SetLastError(ERROR_SUCCESS); - file = ::streamfx::util::platform::utf8_to_native(file); - _library = reinterpret_cast(LoadLibraryExW( - file.wstring().c_str(), nullptr, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)); + auto wfile = ::streamfx::util::platform::utf8_to_native(file.u8string()); + _library = reinterpret_cast( + LoadLibraryExW(wfile.c_str(), nullptr, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)); if (!_library) { DWORD error = GetLastError(); if (error != ERROR_PROC_NOT_FOUND) {