Author: dquintana
Date: Thu Jul 31 11:29:50 2014
New Revision: 63789
URL:
http://svn.reactos.org/svn/reactos?rev=63789&view=rev
Log:
[STOBJECT]
* Move SSO registration to the rgs file.
* Add more debug prints.
Modified:
branches/shell-experiments/dll/win32/stobject/resources/rgs/systray.rgs
branches/shell-experiments/dll/win32/stobject/stobject.cpp
Modified: branches/shell-experiments/dll/win32/stobject/resources/rgs/systray.rgs
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/sto…
==============================================================================
--- branches/shell-experiments/dll/win32/stobject/resources/rgs/systray.rgs [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/stobject/resources/rgs/systray.rgs [iso-8859-1]
Thu Jul 31 11:29:50 2014
@@ -11,3 +11,22 @@
}
}
}
+HKLM
+{
+ NoRemove Software
+ {
+ NoRemove Microsoft
+ {
+ NoRemove Windows
+ {
+ NoRemove CurrentVersion
+ {
+ NoRemove ShellServiceObjectDelayLoad
+ {
+ val SysTray = s '{35CEC8A3-2BE6-11D2-8773-92E220524153}'
+ }
+ }
+ }
+ }
+ }
+}
Modified: branches/shell-experiments/dll/win32/stobject/stobject.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/sto…
==============================================================================
--- branches/shell-experiments/dll/win32/stobject/stobject.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/stobject/stobject.cpp [iso-8859-1] Thu Jul 31
11:29:50 2014
@@ -17,6 +17,8 @@
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_SysTray, CSysTray)
END_OBJECT_MAP()
+
+const int ObjectMapCount = _countof(ObjectMap);
class CShellTrayModule : public CComModule
{
@@ -60,67 +62,14 @@
return TRUE;
}
-static
-HRESULT
-RegisterShellServiceObject(REFGUID guidClass, LPCWSTR lpName, BOOL bRegister)
-{
- const LPCWSTR strRegistryLocation =
L"Software\\Microsoft\\Windows\\CurrentVersion\\ShellServiceObjectDelayLoad";
-
- HRESULT hr = E_FAIL;
-
- OLECHAR strGuid[128];
-
- HKEY hKey = 0;
-
- if (!StringFromGUID2(guidClass, strGuid, _countof(strGuid)))
- {
- DbgPrint("StringFromGUID2 failed\n");
- goto cleanup;
- }
-
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, strRegistryLocation, 0, KEY_WRITE, &hKey))
- {
- DbgPrint("RegOpenKeyExW failed\n");
- goto cleanup;
- }
-
- if (bRegister)
- {
- LONG cbGuid = (lstrlenW(strGuid) + 1) * 2;
- if (RegSetValueExW(hKey, lpName, 0, REG_SZ, (const BYTE *) strGuid, cbGuid))
- {
- DbgPrint("RegSetValueExW failed\n");
- goto cleanup;
- }
- }
- else
- {
- if (RegDeleteValueW(hKey, lpName))
- {
- DbgPrint("RegDeleteValueW failed\n");
- goto cleanup;
- }
- }
-
- hr = S_OK;
-
-cleanup:
- if (hKey)
- RegCloseKey(hKey);
-
- return hr;
-}
-
STDAPI
DllRegisterServer(void)
{
HRESULT hr;
+ DbgPrint("DllRegisterServer should process %d classes...\n",
ObjectMapCount);
+
hr = g_Module.DllRegisterServer(FALSE);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
- hr = RegisterShellServiceObject(CLSID_SysTray, L"SysTray", TRUE);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
@@ -132,9 +81,7 @@
{
HRESULT hr;
- hr = RegisterShellServiceObject(CLSID_SysTray, L"SysTray", FALSE);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
+ DbgPrint("DllUnregisterServer should process %d classes...\n",
ObjectMapCount);
hr = g_Module.DllUnregisterServer(FALSE);
if (FAILED_UNEXPECTEDLY(hr))
@@ -147,7 +94,9 @@
DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT hr;
-
+
+ DbgPrint("DllGetClassObject should process %d classes...\n",
ObjectMapCount);
+
hr = g_Module.DllGetClassObject(rclsid, riid, ppv);
if (FAILED_UNEXPECTEDLY(hr))
return hr;