From 2d6be14fa5ae10274fd805cbda73a544cb9434d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:39:58 +0800 Subject: [PATCH] fix --- LunaTranslator/files/defaultconfig/static_data.json | 2 +- plugins/shareddllproxy/le.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/LunaTranslator/files/defaultconfig/static_data.json b/LunaTranslator/files/defaultconfig/static_data.json index 22feddb1..927ca1a7 100644 --- a/LunaTranslator/files/defaultconfig/static_data.json +++ b/LunaTranslator/files/defaultconfig/static_data.json @@ -1,5 +1,5 @@ { - "version":"v2.45.9", + "version":"v2.45.10", "themes":{ "dark":[ {"file":"dark1.qss","name":"PyQtDarkTheme"}, diff --git a/plugins/shareddllproxy/le.cpp b/plugins/shareddllproxy/le.cpp index 636e6b5f..afbfce63 100644 --- a/plugins/shareddllproxy/le.cpp +++ b/plugins/shareddllproxy/le.cpp @@ -34,8 +34,14 @@ int lewmain(int argc, wchar_t *argv[]) ULONG64 Unused = 0; } LEB; GetTimeZoneInformation(&LEB.Timezone); - ((LONG(__stdcall *)(decltype(&LEB), LPCWSTR appName, LPWSTR commandLine, LPCWSTR currentDir, void *, void *, PROCESS_INFORMATION *, void *, void *, void *, void *)) - GetProcAddress(localeEmulator, "LeCreateProcess"))(&LEB, NULL, cmd_x, path.c_str(), NULL, NULL, &info, NULL, NULL, NULL, NULL); + auto ret = ((LONG(__stdcall *)(decltype(&LEB), LPCWSTR appName, LPWSTR commandLine, LPCWSTR currentDir, void *, void *, PROCESS_INFORMATION *, void *, void *, void *, void *)) + GetProcAddress(localeEmulator, "LeCreateProcess"))(&LEB, NULL, cmd_x, path.c_str(), NULL, NULL, &info, NULL, NULL, NULL, NULL); + if (ret == 0) + { + WaitForSingleObject(info.hProcess, INFINITE); + CloseHandle(info.hProcess); + CloseHandle(info.hThread); + } } return 1; }