Author: dquintana
Date: Sat Dec 20 16:12:35 2014
New Revision: 65758

URL: http://svn.reactos.org/svn/reactos?rev=65758&view=rev
Log:
[NETSHELL]
* Move to shellext folder.
* Do not initialize the notification SSO, stobject will do so (like in Windows).
* Move some GUIDs to a shared header.

[STOBJECT]
* Initialize netshell's SSO the way Windows does it. Fixes network icon 
inconsistency.
* Move some GUIDs to a shared header.

CORE-8818 #resolve Fixed in trunk r65758.

Added:
    trunk/reactos/dll/shellext/netshell/
      - copied from r65755, trunk/reactos/dll/win32/netshell/
Removed:
    trunk/reactos/dll/win32/netshell/
Modified:
    trunk/reactos/dll/shellext/CMakeLists.txt
    trunk/reactos/dll/shellext/netshell/CMakeLists.txt
    trunk/reactos/dll/shellext/netshell/netshell.cpp
    trunk/reactos/dll/shellext/netshell/precomp.h
    trunk/reactos/dll/shellext/netshell/shfldr_netconnect.cpp
    trunk/reactos/dll/shellext/stobject/csystray.cpp
    trunk/reactos/dll/shellext/stobject/csystray.h
    trunk/reactos/dll/shellext/stobject/precomp.h
    trunk/reactos/dll/win32/CMakeLists.txt
    trunk/reactos/include/reactos/shlguid_undoc.h

Modified: trunk/reactos/dll/shellext/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/CMakeLists.txt?rev=65758&r1=65757&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/CMakeLists.txt   [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/CMakeLists.txt   [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -3,5 +3,6 @@
 add_subdirectory(deskmon)
 add_subdirectory(devcpux)
 add_subdirectory(fontext)
+add_subdirectory(netshell)
 add_subdirectory(slayer)
 add_subdirectory(stobject)

Modified: trunk/reactos/dll/shellext/netshell/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/CMakeLists.txt?rev=65758&r1=65755&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/netshell/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/netshell/CMakeLists.txt  [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -1,3 +1,5 @@
+
+project(SHELL)
 
 set_cpp(WITH_RUNTIME)
 

Modified: trunk/reactos/dll/shellext/netshell/netshell.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/netshell.cpp?rev=65758&r1=65755&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/netshell/netshell.cpp    [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/netshell/netshell.cpp    [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -3,9 +3,6 @@
 #include <olectl.h>
 
 HINSTANCE netshell_hInstance;
-const GUID CLSID_LANConnectUI            = {0x7007ACC5, 0x3202, 0x11D1, {0xAA, 
0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E}};
-const GUID CLSID_NetworkConnections      = {0x7007ACC7, 0x3202, 0x11D1, {0xAA, 
0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E}};
-const GUID CLSID_LanConnectStatusUI      = {0x7007ACCF, 0x3202, 0x11D1, {0xAA, 
0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E}};
 
 static const WCHAR szNetConnectClass[]    = 
L"CLSID\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}";
 static const WCHAR szLanConnectUI[]       = 
L"CLSID\\{7007ACC5-3202-11D1-AAD2-00805FC1270E}";

Modified: trunk/reactos/dll/shellext/netshell/precomp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/precomp.h?rev=65758&r1=65755&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/netshell/precomp.h       [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/netshell/precomp.h       [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -18,6 +18,7 @@
 #include <setupapi.h>
 #include <devguid.h>
 #include <netcon.h>
+#include <shlguid_undoc.h>
 
 #include <wine/debug.h>
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
@@ -54,9 +55,6 @@
 
 /* globals */
 extern HINSTANCE netshell_hInstance;
-extern const GUID CLSID_NetworkConnections;
-extern const GUID CLSID_LANConnectUI;
-extern const GUID CLSID_LanConnectStatusUI;
 
 /* shfldr_netconnect.c */
 HRESULT ShowNetConnectionProperties(INetConnection * pNetConnect, HWND hwnd);

Modified: trunk/reactos/dll/shellext/netshell/shfldr_netconnect.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/shfldr_netconnect.cpp?rev=65758&r1=65755&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/netshell/shfldr_netconnect.cpp   [iso-8859-1] 
(original)
+++ trunk/reactos/dll/shellext/netshell/shfldr_netconnect.cpp   [iso-8859-1] 
Sat Dec 20 16:12:35 2014
@@ -138,20 +138,6 @@
 
 CNetworkConnections::CNetworkConnections()
 {
-    ref = 0;
-    HRESULT hr = CoCreateInstance(CLSID_LanConnectStatusUI, NULL, 
CLSCTX_INPROC_SERVER, IID_IOleCommandTarget, (LPVOID*)&lpOleCmd);
-    if (FAILED(hr))
-    {
-        ERR("CoCreateInstance failed\n");
-        lpOleCmd = NULL;
-    }
-    else
-    {
-        hr = lpOleCmd->Exec(&CGID_ShellServiceObject, 2, 
OLECMDEXECOPT_DODEFAULT, NULL, NULL);
-        if (FAILED(hr))
-            ERR("Exec CGID_ShellServiceObject failed\n");
-    }
-
     pidlRoot = _ILCreateNetConnect();  /* my qualified pidl */
 }
 

Modified: trunk/reactos/dll/shellext/stobject/csystray.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/csystray.cpp?rev=65758&r1=65757&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/stobject/csystray.cpp    [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/stobject/csystray.cpp    [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -15,11 +15,31 @@
 };
 const int             g_NumIcons = _countof(g_IconHandlers);
 
-const GUID CLSID_SysTray = { 0x35CEC8A3, 0x2BE6, 0x11D2, { 0x87, 0x73, 0x92, 
0xE2, 0x20, 0x52, 0x41, 0x53 } };
-
 CSysTray::CSysTray() {}
 CSysTray::~CSysTray() {}
 
+HRESULT CSysTray::InitNetShell()
+{
+    HRESULT hr = CoCreateInstance(CLSID_ConnectionTray, 0, 1u, 
IID_PPV_ARG(IOleCommandTarget, &pctNetShell));
+    if (FAILED(hr))
+        return hr;
+
+    return pctNetShell->Exec(&CGID_ShellServiceObject,
+                             OLECMDID_NEW,
+                             OLECMDEXECOPT_DODEFAULT, NULL, NULL);
+}
+
+HRESULT CSysTray::ShutdownNetShell()
+{
+    if (!pctNetShell)
+        return S_FALSE;
+    HRESULT hr = pctNetShell->Exec(&CGID_ShellServiceObject,
+                                   OLECMDID_SAVE,
+                                   OLECMDEXECOPT_DODEFAULT, NULL, NULL);
+    pctNetShell.Release();
+    return hr;
+}
+
 HRESULT CSysTray::InitIcons()
 {
     TRACE("Initializing Notification icons...\n");
@@ -30,7 +50,7 @@
             return hr;
     }
 
-    return S_OK;
+    return InitNetShell();
 }
 
 HRESULT CSysTray::ShutdownIcons()
@@ -43,7 +63,7 @@
             return hr;
     }
 
-    return S_OK;
+    return ShutdownNetShell();
 }
 
 HRESULT CSysTray::UpdateIcons()

Modified: trunk/reactos/dll/shellext/stobject/csystray.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/csystray.h?rev=65758&r1=65757&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/stobject/csystray.h      [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/stobject/csystray.h      [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -22,6 +22,8 @@
     public CWindowImpl<CSysTray, CWindow, CMessageWndClass>,
     public IOleCommandTarget
 {
+    CComPtr<IOleCommandTarget> pctNetShell;
+
     // TODO: keep icon handlers here
 
     HWND hwndSysTray;
@@ -36,6 +38,9 @@
     HRESULT ShutdownIcons();
     HRESULT UpdateIcons();
     HRESULT ProcessIconMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+    HRESULT InitNetShell();
+    HRESULT ShutdownNetShell();
 
 public:
     HRESULT NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip);

Modified: trunk/reactos/dll/shellext/stobject/precomp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/precomp.h?rev=65758&r1=65757&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/shellext/stobject/precomp.h       [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/stobject/precomp.h       [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -26,6 +26,8 @@
 #include <atlbase.h>
 #include <atlcom.h>
 #include <atlwin.h>
+#include <undocshell.h>
+#include <shellutils.h>
 
 #include <shellapi.h>
 
@@ -62,46 +64,3 @@
 extern HRESULT STDMETHODCALLTYPE Volume_Shutdown(_In_ CSysTray * pSysTray);
 extern HRESULT STDMETHODCALLTYPE Volume_Update(_In_ CSysTray * pSysTray);
 extern HRESULT STDMETHODCALLTYPE Volume_Message(_In_ CSysTray * pSysTray, UINT 
uMsg, WPARAM wParam, LPARAM lParam);
-
-/* --------------- Utils ------------------------------ */
-
-static __inline ULONG
-Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
-{
-    char szMsg[512];
-    char *szMsgStart;
-    const char *fname;
-    va_list vl;
-    ULONG uRet;
-
-    fname = strrchr(filename, '\\');
-    if (fname == NULL)
-    {
-        fname = strrchr(filename, '/');
-    }
-
-    if (fname == NULL)
-        fname = filename;
-    else
-        fname++;
-
-    szMsgStart = szMsg + sprintf(szMsg, "[%10lu] %s:%d: ", GetTickCount(), 
fname, line);
-
-    va_start(vl, lpFormat);
-    uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl);
-    va_end(vl);
-
-    OutputDebugStringA(szMsg);
-
-    return uRet;
-}
-
-#define DbgPrint(fmt, ...) \
-    Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
-
-#if 1
-#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure 
%08x.\n", hr), TRUE))
-#else
-#define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
-#endif
-

Modified: trunk/reactos/dll/win32/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/CMakeLists.txt?rev=65758&r1=65757&r2=65758&view=diff
==============================================================================
--- trunk/reactos/dll/win32/CMakeLists.txt      [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/CMakeLists.txt      [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -133,7 +133,6 @@
 add_subdirectory(netcfgx)
 add_subdirectory(netevent)
 add_subdirectory(netid)
-add_subdirectory(netshell)
 add_subdirectory(newdev)
 add_subdirectory(npptools)
 add_subdirectory(ntdsapi)

Modified: trunk/reactos/include/reactos/shlguid_undoc.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/shlguid_undoc.h?rev=65758&r1=65757&r2=65758&view=diff
==============================================================================
--- trunk/reactos/include/reactos/shlguid_undoc.h       [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/shlguid_undoc.h       [iso-8859-1] Sat Dec 20 
16:12:35 2014
@@ -114,6 +114,15 @@
 
 DEFINE_GUID(CGID_MenuDeskBar,              0x5C9F0A12, 0x959E, 0x11D0, 0xA3, 
0xA4, 0x00, 0xA0, 0xC9, 0x08, 0x26, 0x36);
 
+DEFINE_GUID(CLSID_LANConnectUI,            0x7007ACC5, 0x3202, 0x11D1, 0xAA, 
0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E);
+DEFINE_GUID(CLSID_NetworkConnections,      0x7007ACC7, 0x3202, 0x11D1, 0xAA, 
0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E);
+DEFINE_GUID(CLSID_LanConnectStatusUI,      0x7007ACCF, 0x3202, 0x11D1, 0xAA, 
0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E);
+
+DEFINE_GUID(CLSID_SysTray,                 0x35CEC8A3, 0x2BE6, 0x11D2, 0x87, 
0x73, 0x92, 0xE2, 0x20, 0x52, 0x41, 0x53);
+
+
+#define CLSID_ConnectionTray CLSID_LanConnectStatusUI
+
 #define CGID_IExplorerToolbar IID_IExplorerToolbar
 #define SID_IExplorerToolbar IID_IExplorerToolbar
 #define SID_ITargetFrame2 IID_ITargetFrame2


Reply via email to