diff options
Diffstat (limited to 'plugins/ShellExt/src/main.cpp')
-rw-r--r-- | plugins/ShellExt/src/main.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
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();
}
/////////////////////////////////////////////////////////////////////////////////////////
|