diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-07 13:08:54 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-07 13:08:54 +0300 |
commit | 48e20e975ee04e6e84cf920d590c94f82306527e (patch) | |
tree | a37903e6b97431374956f006b297118a6b4becc5 | |
parent | 72a33d5bb87d6c8b355fb246d3ab4b1a3015df3c (diff) |
fixes #4103 (DbChecker не работает в сервисном режиме)
-rw-r--r-- | src/mir_core/src/Windows/miranda.cpp | 16 |
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;
}
|