- 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

svn path=/trunk/; revision=36079
This commit is contained in:
Johannes Anderwald 2008-09-09 10:20:12 +00:00
parent a0c4f776f2
commit fd6ffc2459
4 changed files with 27 additions and 10 deletions

View file

@ -433,9 +433,19 @@ INetConnectionPropertyUi2_fnRelease(
if (!refCount) if (!refCount)
{ {
INetCfg_Release(This->pNCfg); if (This->pNCfg)
INetCfgLock_Release(This->NCfgLock); {
NcFreeNetconProperties(This->pProperties); INetCfg_Uninitialize(This->pNCfg);
INetCfg_Release(This->pNCfg);
}
if (This->NCfgLock)
{
INetCfgLock_Release(This->NCfgLock);
}
if (This->pProperties)
{
NcFreeNetconProperties(This->pProperties);
}
CoTaskMemFree (This); CoTaskMemFree (This);
} }
return refCount; return refCount;
@ -486,7 +496,7 @@ INetConnectionPropertyUi2_fnAddPages(
if (FAILED(hr)) if (FAILED(hr))
return 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) if (hProp)
{ {
ret = (*pfnAddPage)(hProp, lParam); ret = (*pfnAddPage)(hProp, lParam);
@ -494,7 +504,10 @@ INetConnectionPropertyUi2_fnAddPages(
{ {
hr = NOERROR; hr = NOERROR;
} }
DestroyPropertySheetPage(hProp); else
{
DestroyPropertySheetPage(hProp);
}
} }
return hr; return hr;
} }

View file

@ -8,8 +8,8 @@ const GUID CLSID_NetworkConnections = {0x7007ACC7, 0x3202, 0x11D1, {0xAA, 0
const GUID CLSID_LanConnectStatusUI = {0x7007ACCF, 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 szNetConnectClass[] = L"CLSID\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}";
static const WCHAR szLanConnectUI[] = L"CLSID\\{7007ACC5-3202-11D1-AA-D200805FC1270E}"; static const WCHAR szLanConnectUI[] = L"CLSID\\{7007ACC5-3202-11D1-AAD2-00805FC1270E}";
static const WCHAR szLanConnectStatusUI[] = L"CLSID\\{7007ACCF-3202-11D1-AA-D200805FC1270E}"; 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 const WCHAR szNamespaceKey[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}";
static INTERFACE_TABLE InterfaceTable[] = static INTERFACE_TABLE InterfaceTable[] =

View file

@ -36,6 +36,7 @@
#include <docobj.h> #include <docobj.h>
#include <netcfgx.h> #include <netcfgx.h>
#include <netcfgn.h> #include <netcfgn.h>
#include <prsht.h>
#include "wine/debug.h" #include "wine/debug.h"

View file

@ -745,7 +745,7 @@ PropSheetExCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
pinfo->u3.phpage[pinfo->nPages++] = hPage; pinfo->u3.phpage[pinfo->nPages++] = hPage;
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
/************************************************************************** /**************************************************************************
@ -788,7 +788,7 @@ static HRESULT WINAPI ISF_NetConnect_IContextMenu2_InvokeCommand(
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
/* FIXME perform version checks */ /* 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)) if (SUCCEEDED(hr))
{ {
hr = INetConnectionPropertyUi_SetConnection(pNCP, val->pItem); hr = INetConnectionPropertyUi_SetConnection(pNCP, val->pItem);
@ -799,8 +799,9 @@ static HRESULT WINAPI ISF_NetConnect_IContextMenu2_InvokeCommand(
pinfo.dwSize = sizeof(PROPSHEETHEADERW); pinfo.dwSize = sizeof(PROPSHEETHEADERW);
pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW; pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW;
pinfo.u3.phpage = hppages; pinfo.u3.phpage = hppages;
pinfo.pszCaption = pProperties->pszwName; pinfo.hwndParent = lpcmi->hwnd;
pinfo.pszCaption = pProperties->pszwName;
hr = INetConnectionPropertyUi_AddPages(pNCP, lpcmi->hwnd, PropSheetExCallback, (LPARAM)&pinfo); hr = INetConnectionPropertyUi_AddPages(pNCP, lpcmi->hwnd, PropSheetExCallback, (LPARAM)&pinfo);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
@ -808,7 +809,9 @@ static HRESULT WINAPI ISF_NetConnect_IContextMenu2_InvokeCommand(
hr = E_FAIL; hr = E_FAIL;
} }
} }
INetConnectionPropertyUi_Release(pNCP);
} }
} }
NcFreeNetconProperties(pProperties); NcFreeNetconProperties(pProperties);
return hr; return hr;