Author: janderwald
Date: Sat Aug 30 14:05:19 2008
New Revision: 35814
URL:
http://svn.reactos.org/svn/reactos?rev=35814&view=rev
Log:
- Implement enumerating network components (Client/Service/Transport) using NetCfg COM
api
- Add a check box to for enabling/disabling notification for network problems
- Implement IOleCommandTarget interface for the LAN status dialog
- Register the LAN property and LAN status CLSIDs
Added:
trunk/reactos/dll/win32/netshell/lanstatusui.c (with props)
Modified:
trunk/reactos/dll/win32/netshell/lanconnectui.c
trunk/reactos/dll/win32/netshell/lang/de-DE.rc
trunk/reactos/dll/win32/netshell/lang/en-US.rc
trunk/reactos/dll/win32/netshell/netshell.c
trunk/reactos/dll/win32/netshell/netshell.rbuild
trunk/reactos/dll/win32/netshell/precomp.h
trunk/reactos/dll/win32/netshell/shfldr_netconnect.c
Modified: trunk/reactos/dll/win32/netshell/lanconnectui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/lanconn…
==============================================================================
--- trunk/reactos/dll/win32/netshell/lanconnectui.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/lanconnectui.c [iso-8859-1] Sat Aug 30 14:05:19 2008
@@ -1,4 +1,8 @@
#include <precomp.h>
+
+/// CLASSID
+/// {7007ACC5-3202-11D1-AAD2-00805FC1270E}
+/// open network properties and wlan properties
typedef enum
{
@@ -20,11 +24,6 @@
INetConnection * pCon;
LONG ref;
}INetConnectionPropertyUiImpl, *LPINetConnectionPropertyUiImpl;
-
-
-/// CLASSID
-/// {7007ACC5-3202-11D1-AAD2-00805FC1270E}
-/// open network properties and wlan properties
HPROPSHEETPAGE
InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR
szTitle)
@@ -46,56 +45,6 @@
return CreatePropertySheetPageW(&ppage);
}
-HRESULT
-LaunchUIDlg(UINT * pResourceIDs, DLGPROC * pDlgs, UINT Count, NETCON_PROPERTIES *
pProperties)
-{
- HPROPSHEETPAGE * hpsp;
- PROPSHEETHEADERW psh;
- BOOL ret;
- UINT Index, Offset;
-
- hpsp = CoTaskMemAlloc(Count * sizeof(HPROPSHEETPAGE));
- if (!hpsp)
- return E_OUTOFMEMORY;
-
- ZeroMemory(hpsp, Count * sizeof(HPROPSHEETPAGE));
-
- Index = 0;
- Offset = 0;
- do
- {
- hpsp[Offset] = InitializePropertySheetPage(MAKEINTRESOURCEW(pResourceIDs[Index]),
pDlgs[Index], (LPARAM)pProperties, NULL);
- if (hpsp[Offset])
- Offset++;
-
- }while(++Index < Count);
-
- if (!Offset)
- {
- CoTaskMemFree(hpsp);
- return E_FAIL;
- }
-
-
- ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
- psh.dwSize = sizeof(PROPSHEETHEADERW);
- psh.dwFlags = PSP_DEFAULT | PSH_PROPTITLE;
- psh.pszCaption = pProperties->pszwName;
- psh.hwndParent = NULL;
- psh.u3.phpage = hpsp;
- psh.nPages = Offset;
- psh.hInstance = netshell_hInstance;
-
-
- ret = PropertySheetW(&psh);
- CoTaskMemFree(hpsp);
-
- if (ret < 0)
- return E_FAIL;
- else
- return S_OK;
-}
-
VOID
AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName)
{
@@ -106,8 +55,8 @@
lvItem.pszText = szName;
lvItem.lParam = (LPARAM)pItem;
lvItem.iItem = ListView_GetItemCount(hDlgCtrl);
-
- SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
+ lvItem.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
+ ListView_SetCheckState(hDlgCtrl, lvItem.iItem, TRUE);
}
VOID
@@ -117,8 +66,8 @@
DWORD dwSize;
DWORD dwRetVal;
DWORD dwCharacteristics;
- WCHAR szName[60];
- WCHAR szText[40];
+ WCHAR szName[100];
+ WCHAR szText[100];
WCHAR szHelp[200];
HKEY hSubKey;
static WCHAR szNDI[] = L"\\Ndi";
@@ -173,6 +122,10 @@
RegCloseKey(hSubKey);
}
+ if (!wcslen(szText))
+ continue;
+
+
pItem = CoTaskMemAlloc(sizeof(NET_ITEM));
if (!pItem)
continue;
@@ -192,40 +145,96 @@
}
+VOID
+EnumComponents(HWND hDlgCtrl, INetCfg * pNCfg, const GUID * CompGuid, UINT Type)
+{
+ HRESULT hr;
+ IEnumNetCfgComponent * pENetCfg;
+ INetCfgComponent *pNCfgComp;
+ ULONG Num;
+ DWORD dwCharacteristics;
+ LPOLESTR pDisplayName, pHelpText;
+ PNET_ITEM pItem;
+
+
+ hr = INetCfg_EnumComponents(pNCfg, CompGuid, &pENetCfg);
+ if (FAILED(hr))
+ {
+ INetCfg_Release(pNCfg);
+ return;
+ }
+ while(IEnumNetCfgComponent_Next(pENetCfg, 1, &pNCfgComp, &Num) == S_OK)
+ {
+ hr = INetCfgComponent_GetCharacteristics(pNCfgComp, &dwCharacteristics);
+ if (SUCCEEDED(hr) && (dwCharacteristics & NCF_HIDDEN))
+ {
+ INetCfgComponent_Release(pNCfgComp);
+ continue;
+ }
+ pDisplayName = NULL;
+ pHelpText = NULL;
+ hr = INetCfgComponent_GetDisplayName(pNCfgComp, &pDisplayName);
+ hr = INetCfgComponent_GetHelpText(pNCfgComp, &pHelpText);
+
+ pItem = CoTaskMemAlloc(sizeof(NET_ITEM));
+ if (!pItem)
+ continue;
+ pItem->dwCharacteristics = dwCharacteristics;
+ pItem->szHelp = pHelpText;
+ pItem->Type = Type;
+ AddItemToListView(hDlgCtrl, pItem, pDisplayName);
+ CoTaskMemFree(pDisplayName);
+
+ INetCfgComponent_Release(pNCfgComp);
+ }
+ IEnumNetCfgComponent_Release(pENetCfg);
+}
+
VOID
InitializeLANPropertiesUIDlg(HWND hwndDlg)
{
- static WCHAR szNetClient[] =
L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4d36e973-e325-11ce-bfc1-08002be10318}";
- static WCHAR szNetService[] =
L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4d36e974-e325-11ce-bfc1-08002be10318}";
- static WCHAR szNetProtocol[]
=L"System\\CurrentControlSet\\Control\\Network\\{4D36E975-E325-11CE-BFC1-08002BE10318}";
- HKEY hKey;
- HWND hDlgCtrl;
-
- hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
- /* Enumerate Clients */
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szNetClient, 0, KEY_READ, &hKey) ==
ERROR_SUCCESS)
- {
- EnumClientServiceProtocol(hwndDlg, hKey, NET_TYPE_CLIENT);
- RegCloseKey(hKey);
- }
-
- /* Enumerate Service */
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szNetService, 0, KEY_READ, &hKey) ==
ERROR_SUCCESS)
- {
- EnumClientServiceProtocol(hwndDlg, hKey, NET_TYPE_SERVICE);
- RegCloseKey(hKey);
- }
-
- /* Enumerate Protocol */
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szNetProtocol, 0, KEY_READ, &hKey) ==
ERROR_SUCCESS)
- {
- EnumClientServiceProtocol(hwndDlg, hKey, NET_TYPE_PROTOCOL);
- RegCloseKey(hKey);
- }
-
-
-}
+ HRESULT hr;
+ INetCfg * pNCfg;
+ HWND hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
+ LVCOLUMNW lc;
+ RECT rc;
+ DWORD dwStyle;
+
+ memset(&lc, 0, sizeof(LV_COLUMN));
+ lc.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT;
+ lc.fmt = LVCFMT_FIXED_WIDTH;
+ if (GetClientRect(hDlgCtrl, &rc))
+ {
+ lc.mask |= LVCF_WIDTH;
+ lc.cx = rc.right - rc.left;
+ }
+ lc.pszText = L"";
+ (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc);
+ dwStyle = (DWORD) SendMessage(hDlgCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
+ dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
+ SendMessage(hDlgCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
+
+
+
+ hr = CoCreateInstance(&CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER,
&IID_INetCfg, (LPVOID*)&pNCfg);
+ if (FAILED(hr))
+ return;
+
+ hr = INetCfg_Initialize(pNCfg, NULL);
+ if (FAILED(hr))
+ {
+ INetCfg_Release(pNCfg);
+ return;
+ }
+
+ EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETCLIENT, NET_TYPE_CLIENT);
+ EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETSERVICE, NET_TYPE_SERVICE);
+ EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETTRANS, NET_TYPE_PROTOCOL);
+
+ INetCfg_Release(pNCfg);
+}
+
INT_PTR
@@ -238,7 +247,11 @@
)
{
PROPSHEETPAGE *page;
- NETCON_PROPERTIES * pProperties = (NETCON_PROPERTIES*)GetWindowLongPtr(hwndDlg,
DWLP_USER);
+ LPNMLISTVIEW lppl;
+ LVITEMW li;
+ PNET_ITEM pItem;
+ NETCON_PROPERTIES * pProperties;
+
switch(uMsg)
{
case WM_INITDIALOG:
@@ -257,52 +270,39 @@
}
InitializeLANPropertiesUIDlg(hwndDlg);
return TRUE;
+ case WM_NOTIFY:
+ lppl = (LPNMLISTVIEW) lParam;
+ if (lppl->hdr.code == LVN_ITEMCHANGING)
+ {
+ ZeroMemory(&li, sizeof(li));
+ li.mask = LVIF_PARAM;
+ li.iItem = lppl->iItem;
+ if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0,
(LPARAM)&li))
+ return TRUE;
+
+ pItem = (PNET_ITEM)li.lParam;
+ if (!pItem)
+ return TRUE;
+
+ if (!(lppl->uOldState & LVIS_FOCUSED) &&
(lppl->uNewState & LVIS_FOCUSED))
+ {
+ /* new focused item */
+ if (pItem->dwCharacteristics & NCF_NOT_USER_REMOVABLE)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UNINSTALL), FALSE);
+ else
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UNINSTALL), TRUE);
+
+ if (pItem->dwCharacteristics & NCF_HAS_UI)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROPERTIES), TRUE);
+ else
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROPERTIES), FALSE);
+
+ SendDlgItemMessageW(hwndDlg, IDC_DESCRIPTION, WM_SETTEXT, 0,
(LPARAM)pItem->szHelp);
+ }
+ }
+ break;
}
return FALSE;
-}
-
-
-HRESULT
-ShowLANConnectionPropertyDialog(NETCON_PROPERTIES * pProperties)
-{
- UINT ResourceId[1] = { IDD_NETPROPERTIES };
- DLGPROC Dlgs[1] = {LANPropertiesUIDlg};
- INITCOMMONCONTROLSEX ic;
-
-
- ic.dwSize = sizeof(INITCOMMONCONTROLSEX);
- ic.dwICC = ICC_LISTVIEW_CLASSES;
- InitCommonControlsEx(&ic);
-
- return LaunchUIDlg(ResourceId, Dlgs, 1, pProperties);
-}
-
-INT_PTR
-CALLBACK
-LANStatusUIDlg(
- HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam
-)
-{
- NETCON_PROPERTIES * pProperties = (NETCON_PROPERTIES*)GetWindowLongPtr(hwndDlg,
DWLP_USER);
- switch(uMsg)
- {
- case WM_INITDIALOG:
- pProperties = (NETCON_PROPERTIES*)lParam;
- return TRUE;
- }
- return FALSE;
-}
-
-
-HRESULT
-ShowLANConnectionStatusDialog(NETCON_PROPERTIES * pProperties)
-{
- UINT ResourceId[1] = { IDD_NETSTATUS };
- DLGPROC Dlgs[1] = {LANStatusUIDlg};
- return LaunchUIDlg(ResourceId, Dlgs, 1, pProperties);
}
static
Modified: trunk/reactos/dll/win32/netshell/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/lang/de…
==============================================================================
--- trunk/reactos/dll/win32/netshell/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/lang/de-DE.rc [iso-8859-1] Sat Aug 30 14:05:19 2008
@@ -5,11 +5,11 @@
CAPTION "Allgemein"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "List3", IDC_COMPONENTSLIST, "SysListView32",
LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | WS_BORDER |
WS_TABSTOP | LVS_EX_FULLROWSELECT, 9, 71, 230, 55
LTEXT "Verbindung herstellen über:", -1, 9,9,217,8
- EDITTEXT IDC_NETCARDNAME, 9, 21, 230, 12, WS_BORDER | WS_DISABLED | WS_TABSTOP
+ EDITTEXT IDC_NETCARDNAME, 9, 21, 230, 12, WS_BORDER | WS_TABSTOP | ES_READONLY
PUSHBUTTON "&Konfigurieren", IDC_CONFIGURE, 189, 38, 50, 14
LTEXT "Diese &Verbindung verwendet folgende Elemente:", -1, 9, 59, 217, 8
- CONTROL "List3", IDC_COMPONENTSLIST, "SysListView32",
LVS_REPORT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 9, 71, 230, 55
PUSHBUTTON "&Installieren", IDC_INSTALL, 9, 130, 65, 14, WS_DISABLED |
WS_TABSTOP
PUSHBUTTON "&Deinstallieren", IDC_UNINSTALL, 90, 130, 65, 14, WS_DISABLED
| WS_TABSTOP
PUSHBUTTON "&Eigenschaften", IDC_PROPERTIES, 174, 130, 65, 14
Modified: trunk/reactos/dll/win32/netshell/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/lang/en…
==============================================================================
--- trunk/reactos/dll/win32/netshell/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/lang/en-US.rc [iso-8859-1] Sat Aug 30 14:05:19 2008
@@ -5,11 +5,11 @@
CAPTION "General"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_COMPONENTSLIST, "SysListView32", LVS_LIST |
LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 9, 71, 230, 55
LTEXT "Connect Using:", -1, 9,9,217,8
EDITTEXT IDC_NETCARDNAME, 9, 21, 230, 12, WS_BORDER | WS_DISABLED | WS_TABSTOP
PUSHBUTTON "&Configure", IDC_CONFIGURE, 189, 38, 50, 14
LTEXT "Components checked are used by this connection:", -1, 9, 59, 217, 8
- CONTROL "", IDC_COMPONENTSLIST, "SysListView32", LVS_LIST |
LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 9, 71, 230, 55
PUSHBUTTON "&Install", IDC_INSTALL, 9, 130, 65, 14, WS_DISABLED |
WS_TABSTOP
PUSHBUTTON "&Uninstall", IDC_UNINSTALL, 90, 130, 65, 14, WS_DISABLED |
WS_TABSTOP
PUSHBUTTON "&Properties", IDC_PROPERTIES, 174, 130, 65, 14
Added: trunk/reactos/dll/win32/netshell/lanstatusui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/lanstat…
==============================================================================
--- trunk/reactos/dll/win32/netshell/lanstatusui.c (added)
+++ trunk/reactos/dll/win32/netshell/lanstatusui.c [iso-8859-1] Sat Aug 30 14:05:19 2008
@@ -1,0 +1,170 @@
+#include <precomp.h>
+
+
+/// CLSID
+/// HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{7007ACCF-3202-11D1-AAD2-00805FC1270E}
+// IID B722BCCB-4E68-101B-A2BC-00AA00404770
+typedef struct
+{
+ IOleCommandTarget * lpVtbl;
+ LONG ref;
+}ILanStatusImpl, *LPILanStatusImpl;
+
+
+INT_PTR
+CALLBACK
+LANStatusUIDlg(
+ HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam
+)
+{
+ switch(uMsg)
+ {
+ case WM_INITDIALOG:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+
+static
+HRESULT
+WINAPI
+IOleCommandTarget_fnQueryInterface(
+ IOleCommandTarget * iface,
+ REFIID iid,
+ LPVOID * ppvObj)
+{
+ ILanStatusImpl * This = (ILanStatusImpl*)iface;
+ *ppvObj = NULL;
+
+ if (IsEqualIID (iid, &IID_IUnknown) ||
+ IsEqualIID (iid, &IID_IOleCommandTarget))
+ {
+ *ppvObj = This;
+ IUnknown_AddRef(iface);
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
+}
+
+static
+ULONG
+WINAPI
+IOleCommandTarget_fnAddRef(
+ IOleCommandTarget * iface)
+{
+ ILanStatusImpl * This = (ILanStatusImpl*)iface;
+ ULONG refCount = InterlockedIncrement(&This->ref);
+
+ return refCount;
+}
+
+static
+ULONG
+WINAPI
+IOleCommandTarget_fnRelease(
+ IOleCommandTarget * iface)
+{
+ ILanStatusImpl * This = (ILanStatusImpl*)iface;
+ ULONG refCount = InterlockedDecrement(&This->ref);
+
+ if (!refCount)
+ {
+ CoTaskMemFree (This);
+ }
+ return refCount;
+}
+
+static
+HRESULT
+WINAPI
+IOleCommandTarget_fnQueryStatus(
+ IOleCommandTarget * iface,
+ const GUID *pguidCmdGroup,
+ ULONG cCmds,
+ OLECMD *prgCmds,
+ OLECMDTEXT *pCmdText)
+{
+ MessageBoxW(NULL, L"IOleCommandTarget_fnQueryStatus", NULL, MB_OK);
+ return E_NOTIMPL;
+}
+
+static
+HRESULT
+WINAPI
+IOleCommandTarget_fnExec(
+ IOleCommandTarget * iface,
+ const GUID *pguidCmdGroup,
+ DWORD nCmdID,
+ DWORD nCmdexecopt,
+ VARIANT *pvaIn,
+ VARIANT *pvaOut)
+{
+ NOTIFYICONDATA nid;
+ HWND hwndDlg;
+ //ILanStatusImpl * This = (ILanStatusImpl*)iface;
+
+ hwndDlg = CreateDialogW(netshell_hInstance, MAKEINTRESOURCEW(IDD_NETSTATUS), NULL,
LANStatusUIDlg);
+ if (pguidCmdGroup)
+ {
+ if (IsEqualIID(pguidCmdGroup, &CGID_ShellServiceObject))
+ {
+ nid.cbSize = sizeof(nid);
+ nid.uID = 100;
+ nid.uFlags = NIF_ICON;
+ nid.u.uVersion = NOTIFYICON_VERSION;
+ nid.hWnd = hwndDlg;
+ nid.hIcon = LoadIcon(netshell_hInstance,
MAKEINTRESOURCE(IDI_SHELL_NETWORK_FOLDER));
+
+ Shell_NotifyIcon(NIM_ADD, &nid);
+ return S_OK;
+ }
+ }
+ return S_OK;
+}
+
+
+static const IOleCommandTargetVtbl vt_OleCommandTarget =
+{
+ IOleCommandTarget_fnQueryInterface,
+ IOleCommandTarget_fnAddRef,
+ IOleCommandTarget_fnRelease,
+ IOleCommandTarget_fnQueryStatus,
+ IOleCommandTarget_fnExec,
+};
+
+
+HRESULT WINAPI LanConnectStatusUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID
* ppv)
+{
+ ILanStatusImpl * This;
+
+ if (!ppv)
+ return E_POINTER;
+
+ if (pUnkOuter)
+ return CLASS_E_NOAGGREGATION;
+
+ This = (ILanStatusImpl *) CoTaskMemAlloc(sizeof (ILanStatusImpl));
+ if (!This)
+ return E_OUTOFMEMORY;
+
+ This->ref = 1;
+ This->lpVtbl = (IOleCommandTarget*)&vt_OleCommandTarget;
+
+ if (!SUCCEEDED (IOleCommandTarget_fnQueryInterface ((IOleCommandTarget*)This, riid,
ppv)))
+ {
+ IOleCommandTarget_Release((IUnknown*)This);
+ return E_NOINTERFACE;
+ }
+
+ IOleCommandTarget_Release((IUnknown*)This);
+ return S_OK;
+}
+
+
+
Propchange: trunk/reactos/dll/win32/netshell/lanstatusui.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/netshell/netshell.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/netshel…
==============================================================================
--- trunk/reactos/dll/win32/netshell/netshell.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/netshell.c [iso-8859-1] Sat Aug 30 14:05:19 2008
@@ -1,12 +1,15 @@
#include "precomp.h"
+#include <initguid.h>
+#include <devguid.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 GUID_DEVCLASS_NET = {0x4d36e972, 0xe325, 0x11ce, {0xbf, 0xc1,
0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}};
-
-static const WCHAR szNetConnectClass[] =
L"CLSID\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}";
-static const WCHAR szLanConnectUI[] =
L"CLSID\\{7007ACC5-3202-11D1-AA-D200805FC1270E}";
+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-AA-D200805FC1270E}";
+static const WCHAR szLanConnectStatusUI[] =
L"CLSID\\{7007ACCF-3202-11D1-AA-D200805FC1270E}";
static const WCHAR szNamespaceKey[] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}";
static INTERFACE_TABLE InterfaceTable[] =
@@ -22,6 +25,10 @@
{
&CLSID_LANConnectUI,
LanConnectUI_Constructor
+ },
+ {
+ &CLSID_LanConnectStatusUI,
+ LanConnectStatusUI_Constructor
},
{
NULL,
@@ -62,6 +69,7 @@
WCHAR szNet[20];
UINT Length, Offset;
+
if (RegCreateKeyExW(HKEY_CLASSES_ROOT, szNetConnectClass, 0, NULL, 0, KEY_WRITE,
NULL, &hKey, NULL) != ERROR_SUCCESS)
return SELFREG_E_CLASS;
@@ -98,6 +106,7 @@
if (RegCreateKeyExW(hKey, L"InProcServer32", 0, NULL, 0, KEY_WRITE, NULL,
&hSubKey, NULL) == ERROR_SUCCESS)
{
RegSetValueW(hSubKey, NULL, REG_SZ, &szName[1], (Offset+1) * sizeof(WCHAR));
+ RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ,
(LPBYTE)L"Both", 10);
RegCloseKey(hSubKey);
}
@@ -108,6 +117,32 @@
}
RegCloseKey(hKey);
+
+ if (RegCreateKeyExW(HKEY_CLASSES_ROOT, szLanConnectUI, 0, NULL, 0, KEY_WRITE, NULL,
&hKey, NULL) != ERROR_SUCCESS)
+ return SELFREG_E_CLASS;
+
+ if (RegCreateKeyExW(hKey, L"InProcServer32", 0, NULL, 0, KEY_WRITE, NULL,
&hSubKey, NULL) == ERROR_SUCCESS)
+ {
+ RegSetValueW(hSubKey, NULL, REG_SZ, &szName[1], (Offset+1) * sizeof(WCHAR));
+ RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ,
(LPBYTE)L"Both", 10);
+ RegCloseKey(hSubKey);
+ }
+
+ RegCloseKey(hKey);
+
+ if (RegCreateKeyExW(HKEY_CLASSES_ROOT, szLanConnectStatusUI, 0, NULL, 0, KEY_WRITE,
NULL, &hKey, NULL) != ERROR_SUCCESS)
+ return SELFREG_E_CLASS;
+
+ if (RegCreateKeyExW(hKey, L"InProcServer32", 0, NULL, 0, KEY_WRITE, NULL,
&hSubKey, NULL) == ERROR_SUCCESS)
+ {
+ RegSetValueW(hSubKey, NULL, REG_SZ, &szName[1], (Offset+1) * sizeof(WCHAR));
+ RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ,
(LPBYTE)L"Both", 10);
+ RegCloseKey(hSubKey);
+ }
+
+ RegCloseKey(hKey);
+
+
return S_OK;
}
@@ -128,7 +163,7 @@
{
UINT i;
HRESULT hres = E_OUTOFMEMORY;
- IClassFactory * pcf = NULL;
+ IClassFactory * pcf = NULL;
if (!ppv)
return E_INVALIDARG;
Modified: trunk/reactos/dll/win32/netshell/netshell.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/netshel…
==============================================================================
--- trunk/reactos/dll/win32/netshell/netshell.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/netshell.rbuild [iso-8859-1] Sat Aug 30 14:05:19
2008
@@ -27,4 +27,5 @@
<file>connectmanager.c</file>
<file>netshell.spec</file>
<file>lanconnectui.c</file>
+ <file>lanstatusui.c</file>
</module>
Modified: trunk/reactos/dll/win32/netshell/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/precomp…
==============================================================================
--- trunk/reactos/dll/win32/netshell/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/precomp.h [iso-8859-1] Sat Aug 30 14:05:19 2008
@@ -33,6 +33,9 @@
#include <setupapi.h>
#include <devguid.h>
#include <netcon.h>
+#include <docobj.h>
+#include <netcfgx.h>
+
#include "wine/debug.h"
#include "wine/unicode.h"
@@ -94,7 +97,9 @@
/* lanconnectui.c */
HRESULT WINAPI LanConnectUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID *
ppv);
-HRESULT ShowLANConnectionStatusDialog(NETCON_PROPERTIES * pProperties);
+
+/* lanstatusui.c */
+HRESULT WINAPI LanConnectStatusUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID
* ppv);
#define NCCF_NOTIFY_DISCONNECTED 0x100000
Modified: trunk/reactos/dll/win32/netshell/shfldr_netconnect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/shfldr_…
==============================================================================
--- trunk/reactos/dll/win32/netshell/shfldr_netconnect.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/shfldr_netconnect.c [iso-8859-1] Sat Aug 30 14:05:19
2008
@@ -773,11 +773,13 @@
if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_NET_STATUS))
{
+#if 0
if (pProperties->MediaType == NCM_LAN)
{
hr = ShowLANConnectionStatusDialog(pProperties);
NcFreeNetconProperties(pProperties);
}
+#endif
return hr;
}
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_NET_PROPERTIES))