diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-24 07:01:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-24 07:01:05 +0000 |
commit | 77e9149fcd326fbb3aec4be4fdf5847a57ab4a28 (patch) | |
tree | 194fcb0fc1acd1ca64524db4b51837466e6b9b57 /plugins/ShellExt/src/main.cpp | |
parent | 22a7ffc73ec791f682edd2983a8f2279539f68b0 (diff) |
first version that compiles ok
git-svn-id: http://svn.miranda-ng.org/main/trunk@5800 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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();
}
/////////////////////////////////////////////////////////////////////////////////////////
|