Author: janderwald
Date: Tue Sep 9 05:20:12 2008
New Revision: 36079
URL:
http://svn.reactos.org/svn/reactos?rev=36079&view=rev
Log:
- Check for NULL before releasing INetCfg and INetCfgLock interface
- ONLY destroy property sheet page on success !!!
- Fix registration of LANStatusUI LANPropertyUI interfaces
- Fix creating LanPropertyUI interface
- Release LANPropertyUI interface when finished
Modified:
trunk/reactos/dll/win32/netshell/lanconnectui.c
trunk/reactos/dll/win32/netshell/netshell.c
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] Tue Sep 9 05:20:12 2008
@@ -433,9 +433,19 @@
if (!refCount)
{
- INetCfg_Release(This->pNCfg);
- INetCfgLock_Release(This->NCfgLock);
- NcFreeNetconProperties(This->pProperties);
+ if (This->pNCfg)
+ {
+ INetCfg_Uninitialize(This->pNCfg);
+ INetCfg_Release(This->pNCfg);
+ }
+ if (This->NCfgLock)
+ {
+ INetCfgLock_Release(This->NCfgLock);
+ }
+ if (This->pProperties)
+ {
+ NcFreeNetconProperties(This->pProperties);
+ }
CoTaskMemFree (This);
}
return refCount;
@@ -486,7 +496,7 @@
if (FAILED(hr))
return hr;
- hProp = InitializePropertySheetPage(MAKEINTRESOURCEW(IDD_NETPROPERTIES),
LANPropertiesUIDlg, (LPARAM)This, This->pProperties->pszwName);
+ hProp = InitializePropertySheetPage(MAKEINTRESOURCEW(IDD_NETPROPERTIES),
LANPropertiesUIDlg, (LPARAM)This, This->pProperties->pszwName);
if (hProp)
{
ret = (*pfnAddPage)(hProp, lParam);
@@ -494,7 +504,10 @@
{
hr = NOERROR;
}
- DestroyPropertySheetPage(hProp);
+ else
+ {
+ DestroyPropertySheetPage(hProp);
+ }
}
return hr;
}
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] Tue Sep 9 05:20:12 2008
@@ -8,8 +8,8 @@
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 szLanConnectUI[] =
L"CLSID\\{7007ACC5-3202-11D1-AAD2-00805FC1270E}";
+static const WCHAR szLanConnectStatusUI[] =
L"CLSID\\{7007ACCF-3202-11D1-AAD2-00805FC1270E}";
static const WCHAR szNamespaceKey[] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}";
static INTERFACE_TABLE InterfaceTable[] =
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] Tue Sep 9 05:20:12 2008
@@ -36,6 +36,7 @@
#include <docobj.h>
#include <netcfgx.h>
#include <netcfgn.h>
+#include <prsht.h>
#include "wine/debug.h"
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] Tue Sep 9 05:20:12
2008
@@ -745,7 +745,7 @@
pinfo->u3.phpage[pinfo->nPages++] = hPage;
return TRUE;
}
- return FALSE;
+ return FALSE;
}
/**************************************************************************
@@ -788,7 +788,7 @@
if (SUCCEEDED(hr))
{
/* FIXME perform version checks */
- hr = CoCreateInstance(&ClassID, NULL, 0,
&IID_INetConnectionPropertyUi, (LPVOID)&pNCP);
+ hr = CoCreateInstance(&ClassID, NULL, CLSCTX_INPROC_SERVER,
&IID_INetConnectionPropertyUi, (LPVOID)&pNCP);
if (SUCCEEDED(hr))
{
hr = INetConnectionPropertyUi_SetConnection(pNCP, val->pItem);
@@ -799,8 +799,9 @@
pinfo.dwSize = sizeof(PROPSHEETHEADERW);
pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW;
pinfo.u3.phpage = hppages;
+ pinfo.hwndParent = lpcmi->hwnd;
+
pinfo.pszCaption = pProperties->pszwName;
-
hr = INetConnectionPropertyUi_AddPages(pNCP, lpcmi->hwnd,
PropSheetExCallback, (LPARAM)&pinfo);
if (SUCCEEDED(hr))
{
@@ -808,7 +809,9 @@
hr = E_FAIL;
}
}
+ INetConnectionPropertyUi_Release(pNCP);
}
+
}
NcFreeNetconProperties(pProperties);
return hr;