mirror of
https://github.com/reactos/reactos.git
synced 2025-06-30 12:31:21 +00:00
- Implement INetLanConnectionUiInfo interface
- Remove hack from ShowNetworkComponentProperties - Apply changes when OK / Cancel is pressed svn path=/trunk/; revision=36058
This commit is contained in:
parent
5ff84bd267
commit
c02505cfb2
3 changed files with 151 additions and 76 deletions
|
@ -22,13 +22,20 @@ typedef struct
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
INetConnectionPropertyUi *lpVtbl;
|
INetConnectionPropertyUi2 *lpVtbl;
|
||||||
|
INetLanConnectionUiInfo * lpLanConUiInfoVtbl;
|
||||||
INetConnection * pCon;
|
INetConnection * pCon;
|
||||||
INetCfgLock *NCfgLock;
|
INetCfgLock *NCfgLock;
|
||||||
INetCfg * pNCfg;
|
INetCfg * pNCfg;
|
||||||
|
NETCON_PROPERTIES * pProperties;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
}INetConnectionPropertyUiImpl, *LPINetConnectionPropertyUiImpl;
|
}INetConnectionPropertyUiImpl, *LPINetConnectionPropertyUiImpl;
|
||||||
|
|
||||||
|
static LPINetConnectionPropertyUiImpl __inline impl_from_NetLanConnectionUiInfo(INetLanConnectionUiInfo *iface)
|
||||||
|
{
|
||||||
|
return (LPINetConnectionPropertyUiImpl)((char *)iface - FIELD_OFFSET(INetConnectionPropertyUiImpl, lpLanConUiInfoVtbl));
|
||||||
|
}
|
||||||
|
|
||||||
HPROPSHEETPAGE
|
HPROPSHEETPAGE
|
||||||
InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
|
InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
|
||||||
{
|
{
|
||||||
|
@ -41,10 +48,10 @@ InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWS
|
||||||
ppage.pfnDlgProc = dlgproc;
|
ppage.pfnDlgProc = dlgproc;
|
||||||
ppage.lParam = lParam;
|
ppage.lParam = lParam;
|
||||||
ppage.hInstance = netshell_hInstance;
|
ppage.hInstance = netshell_hInstance;
|
||||||
ppage.pszTitle = szTitle;
|
|
||||||
if (szTitle)
|
if (szTitle)
|
||||||
{
|
{
|
||||||
ppage.dwFlags |= PSP_USETITLE;
|
ppage.dwFlags |= PSP_USETITLE;
|
||||||
|
ppage.pszTitle = szTitle;
|
||||||
}
|
}
|
||||||
return CreatePropertySheetPageW(&ppage);
|
return CreatePropertySheetPageW(&ppage);
|
||||||
}
|
}
|
||||||
|
@ -64,23 +71,17 @@ AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName, BOOL bChecked)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
GetINetCfgComponent(INetCfg * pNCfg, INetConnection * pNetCon, INetCfgComponent ** pOut)
|
GetINetCfgComponent(INetCfg * pNCfg, INetConnectionPropertyUiImpl * This, INetCfgComponent ** pOut)
|
||||||
{
|
{
|
||||||
LPWSTR pName;
|
LPWSTR pName;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
NETCON_PROPERTIES* pProps;
|
|
||||||
INetCfgComponent * pNCg;
|
INetCfgComponent * pNCg;
|
||||||
ULONG Fetched;
|
ULONG Fetched;
|
||||||
IEnumNetCfgComponent * pEnumCfg;
|
IEnumNetCfgComponent * pEnumCfg;
|
||||||
|
|
||||||
hr = INetConnection_GetProperties(pNetCon, &pProps);
|
|
||||||
if (FAILED(hr))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
hr = INetCfg_EnumComponents(pNCfg, &GUID_DEVCLASS_NET, &pEnumCfg);
|
hr = INetCfg_EnumComponents(pNCfg, &GUID_DEVCLASS_NET, &pEnumCfg);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
NcFreeNetconProperties(pProps);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,11 +90,10 @@ GetINetCfgComponent(INetCfg * pNCfg, INetConnection * pNetCon, INetCfgComponent
|
||||||
hr = INetCfgComponent_GetDisplayName(pNCg, &pName);
|
hr = INetCfgComponent_GetDisplayName(pNCg, &pName);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
if (!wcsicmp(pName, pProps->pszwDeviceName))
|
if (!wcsicmp(pName, This->pProperties->pszwDeviceName))
|
||||||
{
|
{
|
||||||
*pOut = pNCg;
|
*pOut = pNCg;
|
||||||
IEnumNetCfgComponent_Release(pEnumCfg);
|
IEnumNetCfgComponent_Release(pEnumCfg);
|
||||||
NcFreeNetconProperties(pProps);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
CoTaskMemFree(pName);
|
CoTaskMemFree(pName);
|
||||||
|
@ -101,7 +101,6 @@ GetINetCfgComponent(INetCfg * pNCfg, INetConnection * pNetCon, INetCfgComponent
|
||||||
INetCfgComponent_Release(pNCg);
|
INetCfgComponent_Release(pNCg);
|
||||||
}
|
}
|
||||||
IEnumNetCfgComponent_Release(pEnumCfg);
|
IEnumNetCfgComponent_Release(pEnumCfg);
|
||||||
NcFreeNetconProperties(pProps);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +138,7 @@ EnumComponents(HWND hDlgCtrl, INetConnectionPropertyUiImpl * This, INetCfg * pNC
|
||||||
hr = INetCfgComponent_QueryInterface(pNCfgComp, &IID_INetCfgComponentBindings, (LPVOID*)&pCompBind);
|
hr = INetCfgComponent_QueryInterface(pNCfgComp, &IID_INetCfgComponentBindings, (LPVOID*)&pCompBind);
|
||||||
|
|
||||||
bChecked = FALSE;
|
bChecked = FALSE;
|
||||||
if (GetINetCfgComponent(pNCfg, This->pCon, &pAdapterCfgComp))
|
if (GetINetCfgComponent(pNCfg, This, &pAdapterCfgComp))
|
||||||
{
|
{
|
||||||
hr = INetCfgComponentBindings_IsBoundTo(pCompBind, pAdapterCfgComp);
|
hr = INetCfgComponentBindings_IsBoundTo(pCompBind, pAdapterCfgComp);
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
|
@ -175,21 +174,16 @@ InitializeLANPropertiesUIDlg(HWND hwndDlg, INetConnectionPropertyUiImpl * This)
|
||||||
LVCOLUMNW lc;
|
LVCOLUMNW lc;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
DWORD dwStyle;
|
DWORD dwStyle;
|
||||||
NETCON_PROPERTIES * pProperties;
|
|
||||||
LPWSTR pDisplayName;
|
LPWSTR pDisplayName;
|
||||||
LVITEMW li;
|
LVITEMW li;
|
||||||
|
|
||||||
hr = INetConnection_GetProperties(This->pCon, &pProperties);
|
SendDlgItemMessageW(hwndDlg, IDC_NETCARDNAME, WM_SETTEXT, 0, (LPARAM)This->pProperties->pszwDeviceName);
|
||||||
if (FAILED(hr))
|
if (This->pProperties->dwCharacter & NCCF_SHOW_ICON)
|
||||||
return;
|
|
||||||
|
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_NETCARDNAME, WM_SETTEXT, 0, (LPARAM)pProperties->pszwDeviceName);
|
|
||||||
if (pProperties->dwCharacter & NCCF_SHOW_ICON)
|
|
||||||
{
|
{
|
||||||
/* check show item on taskbar*/
|
/* check show item on taskbar*/
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_SHOWTASKBAR, BM_SETCHECK, BST_CHECKED, 0);
|
SendDlgItemMessageW(hwndDlg, IDC_SHOWTASKBAR, BM_SETCHECK, BST_CHECKED, 0);
|
||||||
}
|
}
|
||||||
if (pProperties->dwCharacter & NCCF_NOTIFY_DISCONNECTED)
|
if (This->pProperties->dwCharacter & NCCF_NOTIFY_DISCONNECTED)
|
||||||
{
|
{
|
||||||
/* check notify item */
|
/* check notify item */
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_NOTIFYNOCONNECTION, BM_SETCHECK, BST_CHECKED, 0);
|
SendDlgItemMessageW(hwndDlg, IDC_NOTIFYNOCONNECTION, BM_SETCHECK, BST_CHECKED, 0);
|
||||||
|
@ -252,34 +246,14 @@ ShowNetworkComponentProperties(
|
||||||
HWND hDlgCtrl;
|
HWND hDlgCtrl;
|
||||||
UINT Index, Count;
|
UINT Index, Count;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
INetConnectionPropertyUi * pConUI = NULL;
|
|
||||||
INetCfgComponent * pNCfgComp;
|
INetCfgComponent * pNCfgComp;
|
||||||
PNET_ITEM pItem;
|
PNET_ITEM pItem;
|
||||||
WCHAR szBuffer[200];
|
|
||||||
|
|
||||||
hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
|
hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
|
||||||
Count = ListView_GetItemCount(hDlgCtrl);
|
Count = ListView_GetItemCount(hDlgCtrl);
|
||||||
if (!Count)
|
if (!Count)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_LANConnectUI,
|
|
||||||
NULL,
|
|
||||||
CLSCTX_INPROC_SERVER | CLSCTX_NO_CODE_DOWNLOAD,
|
|
||||||
&IID_INetConnectionPropertyUi,
|
|
||||||
(LPVOID)&pConUI);
|
|
||||||
|
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hr = INetConnectionPropertyUi_SetConnection(pConUI, This->pCon);
|
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
|
||||||
INetConnectionPropertyUi_Release(pConUI);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZeroMemory(&lvItem, sizeof(LVITEMW));
|
ZeroMemory(&lvItem, sizeof(LVITEMW));
|
||||||
lvItem.mask = LVIF_PARAM | LVIF_STATE;
|
lvItem.mask = LVIF_PARAM | LVIF_STATE;
|
||||||
lvItem.stateMask = (UINT)-1;
|
lvItem.stateMask = (UINT)-1;
|
||||||
|
@ -295,24 +269,17 @@ ShowNetworkComponentProperties(
|
||||||
|
|
||||||
if (!(lvItem.state & LVIS_SELECTED))
|
if (!(lvItem.state & LVIS_SELECTED))
|
||||||
{
|
{
|
||||||
INetConnectionPropertyUi_Release(pConUI);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pItem = (PNET_ITEM)lvItem.lParam;
|
pItem = (PNET_ITEM)lvItem.lParam;
|
||||||
pNCfgComp = (INetCfgComponent*) pItem->pNCfgComp;
|
pNCfgComp = (INetCfgComponent*) pItem->pNCfgComp;
|
||||||
|
|
||||||
hr = INetCfgComponent_RaisePropertyUi(pNCfgComp, GetParent(hwndDlg), NCRP_QUERY_PROPERTY_UI, (IUnknown*)pConUI);
|
hr = INetCfgComponent_RaisePropertyUi(pNCfgComp, GetParent(hwndDlg), NCRP_QUERY_PROPERTY_UI, (IUnknown*)This);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = INetCfgComponent_RaisePropertyUi(pNCfgComp, GetParent(hwndDlg), NCRP_SHOW_PROPERTY_UI, (IUnknown*)pConUI);
|
hr = INetCfgComponent_RaisePropertyUi(pNCfgComp, GetParent(hwndDlg), NCRP_SHOW_PROPERTY_UI, (IUnknown*)This);
|
||||||
}
|
}
|
||||||
|
|
||||||
swprintf(szBuffer, L"result %08x", hr);
|
|
||||||
MessageBoxW(NULL, szBuffer, NULL, MB_OK);
|
|
||||||
|
|
||||||
INetConnectionPropertyUi_Release(pConUI);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -330,6 +297,8 @@ LANPropertiesUIDlg(
|
||||||
LVITEMW li;
|
LVITEMW li;
|
||||||
PNET_ITEM pItem;
|
PNET_ITEM pItem;
|
||||||
INetConnectionPropertyUiImpl * This;
|
INetConnectionPropertyUiImpl * This;
|
||||||
|
LPPSHNOTIFY lppsn;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
switch(uMsg)
|
switch(uMsg)
|
||||||
{
|
{
|
||||||
|
@ -341,6 +310,33 @@ LANPropertiesUIDlg(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
lppl = (LPNMLISTVIEW) lParam;
|
lppl = (LPNMLISTVIEW) lParam;
|
||||||
|
lppsn = (LPPSHNOTIFY) lParam;
|
||||||
|
if (lppsn->hdr.code == PSN_APPLY)
|
||||||
|
{
|
||||||
|
This = (INetConnectionPropertyUiImpl*)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
||||||
|
if (This->pNCfg)
|
||||||
|
{
|
||||||
|
hr = INetCfg_Apply(This->pNCfg);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
return PSNRET_NOERROR;
|
||||||
|
else
|
||||||
|
return PSNRET_INVALID;
|
||||||
|
}
|
||||||
|
return PSNRET_NOERROR;
|
||||||
|
}
|
||||||
|
else if (lppsn->hdr.code == PSN_APPLY)
|
||||||
|
{
|
||||||
|
This = (INetConnectionPropertyUiImpl*)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
||||||
|
if (This->pNCfg)
|
||||||
|
{
|
||||||
|
hr = INetCfg_Cancel(This->pNCfg);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
return PSNRET_NOERROR;
|
||||||
|
else
|
||||||
|
return PSNRET_INVALID;
|
||||||
|
}
|
||||||
|
return PSNRET_NOERROR;
|
||||||
|
}
|
||||||
if (lppl->hdr.code == LVN_ITEMCHANGING)
|
if (lppl->hdr.code == LVN_ITEMCHANGING)
|
||||||
{
|
{
|
||||||
ZeroMemory(&li, sizeof(li));
|
ZeroMemory(&li, sizeof(li));
|
||||||
|
@ -385,30 +381,40 @@ LANPropertiesUIDlg(
|
||||||
static
|
static
|
||||||
HRESULT
|
HRESULT
|
||||||
WINAPI
|
WINAPI
|
||||||
INetConnectionPropertyUi_fnQueryInterface(
|
INetConnectionPropertyUi2_fnQueryInterface(
|
||||||
INetConnectionPropertyUi * iface,
|
INetConnectionPropertyUi2 * iface,
|
||||||
REFIID iid,
|
REFIID iid,
|
||||||
LPVOID * ppvObj)
|
LPVOID * ppvObj)
|
||||||
{
|
{
|
||||||
|
//LPOLESTR pStr;
|
||||||
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
||||||
*ppvObj = NULL;
|
*ppvObj = NULL;
|
||||||
|
|
||||||
if (IsEqualIID (iid, &IID_IUnknown) ||
|
if (IsEqualIID (iid, &IID_IUnknown) ||
|
||||||
IsEqualIID (iid, &IID_INetConnectionPropertyUi))
|
IsEqualIID (iid, &IID_INetConnectionPropertyUi) ||
|
||||||
|
IsEqualIID (iid, &IID_INetConnectionPropertyUi2))
|
||||||
{
|
{
|
||||||
*ppvObj = This;
|
*ppvObj = This;
|
||||||
IUnknown_AddRef(iface);
|
IUnknown_AddRef(iface);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
else if (IsEqualIID(iid, &IID_INetLanConnectionUiInfo))
|
||||||
|
{
|
||||||
|
*ppvObj = &This->lpLanConUiInfoVtbl;
|
||||||
|
IUnknown_AddRef(iface);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
//StringFromCLSID(iid, &pStr);
|
||||||
|
//MessageBoxW(NULL, pStr, L"INetConnectionPropertyUi_fnQueryInterface", MB_OK);
|
||||||
|
//CoTaskMemFree(pStr);
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
ULONG
|
ULONG
|
||||||
WINAPI
|
WINAPI
|
||||||
INetConnectionPropertyUi_fnAddRef(
|
INetConnectionPropertyUi2_fnAddRef(
|
||||||
INetConnectionPropertyUi * iface)
|
INetConnectionPropertyUi2 * iface)
|
||||||
{
|
{
|
||||||
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
||||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||||
|
@ -419,14 +425,17 @@ INetConnectionPropertyUi_fnAddRef(
|
||||||
static
|
static
|
||||||
ULONG
|
ULONG
|
||||||
WINAPI
|
WINAPI
|
||||||
INetConnectionPropertyUi_fnRelease(
|
INetConnectionPropertyUi2_fnRelease(
|
||||||
INetConnectionPropertyUi * iface)
|
INetConnectionPropertyUi2 * iface)
|
||||||
{
|
{
|
||||||
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
||||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
if (!refCount)
|
if (!refCount)
|
||||||
{
|
{
|
||||||
|
INetCfg_Release(This->pNCfg);
|
||||||
|
INetCfgLock_Release(This->NCfgLock);
|
||||||
|
NcFreeNetconProperties(This->pProperties);
|
||||||
CoTaskMemFree (This);
|
CoTaskMemFree (This);
|
||||||
}
|
}
|
||||||
return refCount;
|
return refCount;
|
||||||
|
@ -435,8 +444,8 @@ INetConnectionPropertyUi_fnRelease(
|
||||||
static
|
static
|
||||||
HRESULT
|
HRESULT
|
||||||
WINAPI
|
WINAPI
|
||||||
INetConnectionPropertyUi_fnSetConnection(
|
INetConnectionPropertyUi2_fnSetConnection(
|
||||||
INetConnectionPropertyUi * iface,
|
INetConnectionPropertyUi2 * iface,
|
||||||
INetConnection *pCon)
|
INetConnection *pCon)
|
||||||
{
|
{
|
||||||
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
||||||
|
@ -455,8 +464,8 @@ INetConnectionPropertyUi_fnSetConnection(
|
||||||
static
|
static
|
||||||
HRESULT
|
HRESULT
|
||||||
WINAPI
|
WINAPI
|
||||||
INetConnectionPropertyUi_fnAddPages(
|
INetConnectionPropertyUi2_fnAddPages(
|
||||||
INetConnectionPropertyUi * iface,
|
INetConnectionPropertyUi2 * iface,
|
||||||
HWND hwndParent,
|
HWND hwndParent,
|
||||||
LPFNADDPROPSHEETPAGE pfnAddPage,
|
LPFNADDPROPSHEETPAGE pfnAddPage,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
|
@ -465,7 +474,6 @@ INetConnectionPropertyUi_fnAddPages(
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
HRESULT hr = E_FAIL;
|
HRESULT hr = E_FAIL;
|
||||||
INITCOMMONCONTROLSEX initEx;
|
INITCOMMONCONTROLSEX initEx;
|
||||||
NETCON_PROPERTIES * pProperties;
|
|
||||||
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface;
|
||||||
|
|
||||||
|
|
||||||
|
@ -474,11 +482,11 @@ INetConnectionPropertyUi_fnAddPages(
|
||||||
if(!InitCommonControlsEx(&initEx))
|
if(!InitCommonControlsEx(&initEx))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
hr = INetConnection_GetProperties(This->pCon, &pProperties);
|
hr = INetConnection_GetProperties(This->pCon, &This->pProperties);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
hProp = InitializePropertySheetPage(MAKEINTRESOURCEW(IDD_NETPROPERTIES), LANPropertiesUIDlg, (LPARAM)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);
|
||||||
|
@ -488,19 +496,81 @@ INetConnectionPropertyUi_fnAddPages(
|
||||||
}
|
}
|
||||||
DestroyPropertySheetPage(hProp);
|
DestroyPropertySheetPage(hProp);
|
||||||
}
|
}
|
||||||
//NcFreeNetconProperties(pProperties);
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const INetConnectionPropertyUiVtbl vt_NetConnectionPropertyUi =
|
static
|
||||||
|
HRESULT
|
||||||
|
WINAPI
|
||||||
|
INetConnectionPropertyUi2_fnGetIcon(
|
||||||
|
INetConnectionPropertyUi2 * iface,
|
||||||
|
DWORD dwSize,
|
||||||
|
HICON *phIcon)
|
||||||
{
|
{
|
||||||
INetConnectionPropertyUi_fnQueryInterface,
|
return E_NOTIMPL;
|
||||||
INetConnectionPropertyUi_fnAddRef,
|
}
|
||||||
INetConnectionPropertyUi_fnRelease,
|
|
||||||
INetConnectionPropertyUi_fnSetConnection,
|
static const INetConnectionPropertyUi2Vtbl vt_NetConnectionPropertyUi =
|
||||||
INetConnectionPropertyUi_fnAddPages,
|
{
|
||||||
|
INetConnectionPropertyUi2_fnQueryInterface,
|
||||||
|
INetConnectionPropertyUi2_fnAddRef,
|
||||||
|
INetConnectionPropertyUi2_fnRelease,
|
||||||
|
INetConnectionPropertyUi2_fnSetConnection,
|
||||||
|
INetConnectionPropertyUi2_fnAddPages,
|
||||||
|
INetConnectionPropertyUi2_fnGetIcon,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static
|
||||||
|
HRESULT
|
||||||
|
STDCALL
|
||||||
|
INetLanConnectionUiInfo_fnQueryInterface(
|
||||||
|
INetLanConnectionUiInfo * iface,
|
||||||
|
REFIID iid,
|
||||||
|
LPVOID * ppvObj)
|
||||||
|
{
|
||||||
|
INetConnectionPropertyUiImpl * This = impl_from_NetLanConnectionUiInfo(iface);
|
||||||
|
return INetConnectionPropertyUi_QueryInterface((INetConnectionPropertyUi*)This, iid, ppvObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
ULONG
|
||||||
|
STDCALL
|
||||||
|
INetLanConnectionUiInfo_fnAddRef(
|
||||||
|
INetLanConnectionUiInfo * iface)
|
||||||
|
{
|
||||||
|
INetConnectionPropertyUiImpl * This = impl_from_NetLanConnectionUiInfo(iface);
|
||||||
|
return INetConnectionPropertyUi_AddRef((INetConnectionPropertyUi*)This);
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
ULONG
|
||||||
|
STDCALL
|
||||||
|
INetLanConnectionUiInfo_fnRelease(
|
||||||
|
INetLanConnectionUiInfo * iface)
|
||||||
|
{
|
||||||
|
INetConnectionPropertyUiImpl * This = impl_from_NetLanConnectionUiInfo(iface);
|
||||||
|
return INetConnectionPropertyUi_Release((INetConnectionPropertyUi*)This);
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
HRESULT
|
||||||
|
STDCALL
|
||||||
|
INetLanConnectionUiInfo_fnGetDeviceGuid(
|
||||||
|
INetLanConnectionUiInfo * iface,
|
||||||
|
GUID * pGuid)
|
||||||
|
{
|
||||||
|
INetConnectionPropertyUiImpl * This = impl_from_NetLanConnectionUiInfo(iface);
|
||||||
|
CopyMemory(pGuid, &This->pProperties->guidId, sizeof(GUID));
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const INetLanConnectionUiInfoVtbl vt_NetLanConnectionUiInfo =
|
||||||
|
{
|
||||||
|
INetLanConnectionUiInfo_fnQueryInterface,
|
||||||
|
INetLanConnectionUiInfo_fnAddRef,
|
||||||
|
INetLanConnectionUiInfo_fnRelease,
|
||||||
|
INetLanConnectionUiInfo_fnGetDeviceGuid,
|
||||||
|
};
|
||||||
HRESULT WINAPI LanConnectUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
|
HRESULT WINAPI LanConnectUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
|
||||||
{
|
{
|
||||||
INetConnectionPropertyUiImpl * This;
|
INetConnectionPropertyUiImpl * This;
|
||||||
|
@ -518,9 +588,12 @@ HRESULT WINAPI LanConnectUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVO
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
This->pCon = NULL;
|
This->pCon = NULL;
|
||||||
This->pNCfg = NULL;
|
This->pNCfg = NULL;
|
||||||
This->lpVtbl = (INetConnectionPropertyUi*)&vt_NetConnectionPropertyUi;
|
This->NCfgLock = NULL;
|
||||||
|
This->pProperties = NULL;
|
||||||
|
This->lpVtbl = (INetConnectionPropertyUi2*)&vt_NetConnectionPropertyUi;
|
||||||
|
This->lpLanConUiInfoVtbl = (INetLanConnectionUiInfo*)&vt_NetLanConnectionUiInfo;
|
||||||
|
|
||||||
if (!SUCCEEDED (INetConnectionPropertyUi_fnQueryInterface ((INetConnectionPropertyUi*)This, riid, ppv)))
|
if (!SUCCEEDED (INetConnectionPropertyUi2_fnQueryInterface ((INetConnectionPropertyUi2*)This, riid, ppv)))
|
||||||
{
|
{
|
||||||
IUnknown_Release((IUnknown*)This);
|
IUnknown_Release((IUnknown*)This);
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include <netcon.h>
|
#include <netcon.h>
|
||||||
#include <docobj.h>
|
#include <docobj.h>
|
||||||
#include <netcfgx.h>
|
#include <netcfgx.h>
|
||||||
|
#include <netcfgn.h>
|
||||||
|
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
|
@ -794,9 +794,10 @@ static HRESULT WINAPI ISF_NetConnect_IContextMenu2_InvokeCommand(
|
||||||
hr = INetConnectionPropertyUi_SetConnection(pNCP, val->pItem);
|
hr = INetConnectionPropertyUi_SetConnection(pNCP, val->pItem);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW));
|
ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
|
||||||
|
ZeroMemory(hppages, sizeof(hppages));
|
||||||
pinfo.dwSize = sizeof(PROPSHEETHEADERW);
|
pinfo.dwSize = sizeof(PROPSHEETHEADERW);
|
||||||
pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE;
|
pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW;
|
||||||
pinfo.u3.phpage = hppages;
|
pinfo.u3.phpage = hppages;
|
||||||
pinfo.pszCaption = pProperties->pszwName;
|
pinfo.pszCaption = pProperties->pszwName;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue