[Pkg-owncloud-commits] [owncloud-client] 81/115: Windows Shell Integration: Register icons with well known name

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Aug 29 22:04:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 76e0d61b1926eed33732d0160670be0d703eae72
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Tue Aug 19 15:50:10 2014 +0200

    Windows Shell Integration: Register icons with well known name
---
 shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp | 2 +-
 .../OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp  | 7 ++++---
 .../OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h    | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp b/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp
index a124b95..545f0c9 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp
@@ -108,7 +108,7 @@ HRESULT RegisterCLSID(LPCOLESTR guidStr, PCWSTR overlayStr, PCWSTR szModule)
 		return hResult;
 	}
 
-	hResult = OCOverlayRegistrationHandler::RegisterCOMObject(szModule, guid);
+	hResult = OCOverlayRegistrationHandler::RegisterCOMObject(szModule, overlayStr, guid);
 
 	if (!SUCCEEDED(hResult)) {
 		return hResult;
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp
index 7b6985d..b81bc34 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp
@@ -70,7 +70,7 @@ HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PCWSTR friendlyName)
 	return hResult;
 }
 
-HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, const CLSID& clsid)
+HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, PCWSTR friendlyName, const CLSID& clsid)
 {
     if (modulePath == NULL) {
         return E_FAIL;
@@ -92,14 +92,15 @@ HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, const
 		return hResult;
 	}
 
+	hResult = HRESULT_FROM_WIN32(RegSetValue(clsidKey, NULL, REG_SZ, friendlyName, (DWORD) wcslen(friendlyName)));
+
 	HKEY inprocessKey = NULL;
 	hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(clsidKey, REGISTRY_IN_PROCESS, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &inprocessKey, NULL));
 	if(!SUCCEEDED(hResult))	{
 		return hResult;
 	}
 
-	DWORD cbData = lstrlen(modulePath) * sizeof(*modulePath);
-	hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, NULL, REG_SZ, modulePath, cbData));
+	hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, NULL, REG_SZ, modulePath, (DWORD) wcslen(modulePath)));
 
 	if(!SUCCEEDED(hResult)) {
 		return hResult;
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h
index 606b9e8..2b3a52f 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h
@@ -23,7 +23,7 @@ class __declspec(dllexport) OCOverlayRegistrationHandler
 {
 	public:
 		static HRESULT MakeRegistryEntries(const CLSID& clsid, PCWSTR fileType);
-		static HRESULT RegisterCOMObject(PCWSTR modulePath, const CLSID& clsid);
+		static HRESULT RegisterCOMObject(PCWSTR modulePath, PCWSTR friendlyName, const CLSID& clsid);
 		static HRESULT RemoveRegistryEntries(PCWSTR friendlyName);
 		static HRESULT UnregisterCOMObject(const CLSID& clsid);
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list