diff options
Diffstat (limited to 'plugins/SMS/src/main.cpp')
-rw-r--r-- | plugins/SMS/src/main.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/SMS/src/main.cpp b/plugins/SMS/src/main.cpp index bd13654fb8..0d8d9de589 100644 --- a/plugins/SMS/src/main.cpp +++ b/plugins/SMS/src/main.cpp @@ -58,7 +58,21 @@ void VersionConversions(); BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved)
{
- hInst = hInstance;
+ switch(dwReason) {
+ case DLL_PROCESS_ATTACH:
+ ZeroMemory(&ssSMSSettings, sizeof(ssSMSSettings));
+ ssSMSSettings.hInstance = hInstance;
+ ssSMSSettings.hHeap = HeapCreate(0, 0, 0);
+ DisableThreadLibraryCalls((HMODULE)hInstance);
+ break;
+ case DLL_PROCESS_DETACH:
+ HeapDestroy(ssSMSSettings.hHeap);
+ ssSMSSettings.hHeap = NULL;
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ break;
+ }
+
return TRUE;
}
|