From 33dddfa5f8864237ec7c7060b2dc6f60a461df86 Mon Sep 17 00:00:00 2001 From: ePi Date: Sun, 23 Jul 2023 13:29:04 +0900 Subject: [PATCH] =?UTF-8?q?winwrap=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patch/global_minimum.hpp | 3 ++- patch/patch_exception_log.hpp | 2 +- patch/patch_warning_duplicate_plugins.cpp | 2 +- patch/winwrap | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/patch/global_minimum.hpp b/patch/global_minimum.hpp index f735d9c4..6c618e56 100644 --- a/patch/global_minimum.hpp +++ b/patch/global_minimum.hpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace GLOBAL { inline HMODULE aviutl_hmod; @@ -25,6 +26,6 @@ namespace GLOBAL { inline void init_minimum(HINSTANCE patch_hmod) { GLOBAL::patchaul_hinst = patch_hmod; - GLOBAL::aviutl_base = std::bit_cast(GetModuleHandleA(NULL)); + GLOBAL::aviutl_base = std::bit_cast(WinWrap::Module::getCallingProcessModule()); } } diff --git a/patch/patch_exception_log.hpp b/patch/patch_exception_log.hpp index 520d6521..0bf0fe4a 100644 --- a/patch/patch_exception_log.hpp +++ b/patch/patch_exception_log.hpp @@ -339,7 +339,7 @@ namespace patch { public: void operator()() { - log_dir = WinWrap::Module{}.getFileNameW(); + log_dir = WinWrap::Module::getCallingProcessModule().getFileNameW(); log_dir.resize(log_dir.find_last_of(L"/\\") + 1); log_dir += L"log\\"; diff --git a/patch/patch_warning_duplicate_plugins.cpp b/patch/patch_warning_duplicate_plugins.cpp index 32bcbc10..ab673f3f 100644 --- a/patch/patch_warning_duplicate_plugins.cpp +++ b/patch/patch_warning_duplicate_plugins.cpp @@ -140,7 +140,7 @@ static bool warning_duplicate_message( static HMODULE warning_duplicate_common(path_cache& map, LPCSTR lpLibFileName) { - static auto exe_dir = std::filesystem::path{ WinWrap::Module{GetModuleHandleA(NULL)}.getFileNameW() }.parent_path(); + static auto exe_dir = std::filesystem::path{ WinWrap::Module::getCallingProcessModule().getFileNameW() }.parent_path(); const std::filesystem::path arg_path{ lpLibFileName }; const auto arg_filename = arg_path.filename(); diff --git a/patch/winwrap b/patch/winwrap index 86cc9da6..1f7b7e4d 160000 --- a/patch/winwrap +++ b/patch/winwrap @@ -1 +1 @@ -Subproject commit 86cc9da6a842aa72fdc6963b147352c3720bbf35 +Subproject commit 1f7b7e4df8d00cf522b6b8e257ba8cf34dd0e6a5