summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-07 13:08:54 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-07 13:08:54 +0300
commit48e20e975ee04e6e84cf920d590c94f82306527e (patch)
treea37903e6b97431374956f006b297118a6b4becc5
parent72a33d5bb87d6c8b355fb246d3ab4b1a3015df3c (diff)
fixes #4103 (DbChecker не работает в сервисном режиме)
-rw-r--r--src/mir_core/src/Windows/miranda.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mir_core/src/Windows/miranda.cpp b/src/mir_core/src/Windows/miranda.cpp
index 5649a69e4c..caae854b7a 100644
--- a/src/mir_core/src/Windows/miranda.cpp
+++ b/src/mir_core/src/Windows/miranda.cpp
@@ -390,17 +390,27 @@ MIR_CORE_DLL(void) LeaveMessageLoop()
/////////////////////////////////////////////////////////////////////////////////////////
// entry point
+HMODULE hMsfteditDll = nullptr;
+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, uint32_t fdwReason, LPVOID)
{
- if (fdwReason == DLL_PROCESS_ATTACH) {
+ switch (fdwReason) {
+ case DLL_PROCESS_ATTACH:
g_hInst = hinstDLL;
+ hMsfteditDll = LoadLibrary(L"msftedit.dll");
mir_tls = TlsAlloc();
LoadCoreModule();
- }
- else if (fdwReason == DLL_THREAD_DETACH) {
+ break;
+
+ case DLL_PROCESS_DETACH:
+ FreeLibrary(hMsfteditDll);
+ break;
+
+ case DLL_THREAD_DETACH:
HANDLE hEvent = TlsGetValue(mir_tls);
if (hEvent)
CloseHandle(hEvent);
+ break;
}
return TRUE;
}