From 77e9149fcd326fbb3aec4be4fdf5847a57ab4a28 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 24 Aug 2013 07:01:05 +0000 Subject: first version that compiles ok git-svn-id: http://svn.miranda-ng.org/main/trunk@5800 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ShellExt/src/main.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'plugins/ShellExt/src/main.cpp') diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index b2c3473172..1791fc99f8 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -19,7 +19,11 @@ PLUGININFOEX pluginInfoEx = { BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - hInst = hinstDLL; + if (fdwReason == DLL_PROCESS_ATTACH) { + hInst = hinstDLL; + DisableThreadLibraryCalls(hinstDLL); + } + return TRUE; } @@ -53,13 +57,13 @@ TCHAR key1[] = _T("miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}\\Inpro HRESULT __stdcall DllRegisterServer() { - if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext", REG_SZ, str1, sizeof(str1)-1)) + if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext", REG_SZ, str1, sizeof(str1))) return E_FAIL; - if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\CLSID", REG_SZ, str2, sizeof(str2)-1)) + if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\CLSID", REG_SZ, str2, sizeof(str2))) return E_FAIL; - if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}", REG_SZ, str3, sizeof(str3)-1)) + if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}", REG_SZ, str3, sizeof(str3))) return E_FAIL; - if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}\\ProgID", REG_SZ, str3, sizeof(str3)-1)) + if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}\\ProgID", REG_SZ, str3, sizeof(str3))) return E_FAIL; TCHAR tszFileName[MAX_PATH]; @@ -73,15 +77,15 @@ HRESULT __stdcall DllRegisterServer() if ( RegSetValueA(k1, "ThreadingModel", REG_SZ, str4, sizeof(str4))) return E_FAIL; - if ( RegSetValueA(HKEY_CLASSES_ROOT, "*\\shellex\\ContextMenuHandlers\\miranda.shlext", REG_SZ, str2, sizeof(str2)-1)) + if ( RegSetValueA(HKEY_CLASSES_ROOT, "*\\shellex\\ContextMenuHandlers\\miranda.shlext", REG_SZ, str2, sizeof(str2))) return E_FAIL; - if ( RegSetValueA(HKEY_CLASSES_ROOT, "Directory\\shellex\\ContextMenuHandlers\\miranda.shlext", REG_SZ, str2, sizeof(str2)-1)) + if ( RegSetValueA(HKEY_CLASSES_ROOT, "Directory\\shellex\\ContextMenuHandlers\\miranda.shlext", REG_SZ, str2, sizeof(str2))) return E_FAIL; HRegKey k2(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved")); if (k2 == NULL) return E_FAIL; - if ( RegSetValueA(k2, str2, REG_SZ, str1, sizeof(str1)-1)) + if ( RegSetValueA(k2, str2, REG_SZ, str1, sizeof(str1))) return E_FAIL; return S_OK; @@ -89,7 +93,7 @@ HRESULT __stdcall DllRegisterServer() HRESULT __stdcall DllUnregisterServer() { - return RemoveCOMRegistryEntries(); + return RemoveCOMRegistryEntries(); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3