Skip to content

Commit 59afe4b

Browse files
committed
[NETCFGX][UUID] Add private interface used by WinXPs ifmon.dll
When I loaded WinXPs ifmon.dll into our netsh.exe and ran the 'interface ip show address' command ifmon tried to query an unknown interface. Google found a name for the GUID: INetCfgComponentPrivate. I implemented the three standard methods of the interface and ran some more tests. After adding a 4th method with tree parameters to the interface, there are no more failures.
1 parent d6db7fb commit 59afe4b

File tree

2 files changed

+71
-4
lines changed

2 files changed

+71
-4
lines changed

dll/win32/netcfgx/inetcfgcomp_iface.c

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
typedef struct
44
{
55
const INetCfgComponent *lpVtbl;
6-
const INetCfgComponentBindings *lpVtblComponentBindings;
6+
const INetCfgComponentBindings *lpVtblBindings;
7+
const INetCfgComponentPrivate *lpVtblPrivate;
78
LONG ref;
89
NetCfgComponentItem * pItem;
910
INetCfgComponentPropertyUi * pProperty;
@@ -21,9 +22,13 @@ typedef struct
2122

2223
static __inline INetCfgComponentImpl* impl_from_INetCfgComponentBindings(INetCfgComponentBindings *iface)
2324
{
24-
return (INetCfgComponentImpl*)((char *)iface - FIELD_OFFSET(INetCfgComponentImpl, lpVtblComponentBindings));
25+
return (INetCfgComponentImpl*)((char *)iface - FIELD_OFFSET(INetCfgComponentImpl, lpVtblBindings));
2526
}
2627

28+
static __inline INetCfgComponentImpl* impl_from_INetCfgComponentPrivate(INetCfgComponentPrivate *iface)
29+
{
30+
return (INetCfgComponentImpl*)((char *)iface - FIELD_OFFSET(INetCfgComponentImpl, lpVtblPrivate));
31+
}
2732

2833
/***************************************************************
2934
* INetCfgComponentBindings
@@ -179,6 +184,59 @@ static const INetCfgComponentBindingsVtbl vt_NetCfgComponentBindings =
179184
INetCfgComponentBindings_fnMoveAfter,
180185
};
181186

187+
/***************************************************************
188+
* INetCfgComponentPrivate
189+
*/
190+
191+
HRESULT
192+
WINAPI
193+
INetCfgComponentPrivate_fnQueryInterface(
194+
INetCfgComponentPrivate *iface,
195+
REFIID iid,
196+
LPVOID *ppvObj)
197+
{
198+
INetCfgComponentImpl *This = impl_from_INetCfgComponentPrivate(iface);
199+
return INetCfgComponent_QueryInterface((INetCfgComponent*)This, iid, ppvObj);
200+
}
201+
202+
ULONG
203+
WINAPI
204+
INetCfgComponentPrivate_fnAddRef(
205+
INetCfgComponentPrivate *iface)
206+
{
207+
INetCfgComponentImpl *This = impl_from_INetCfgComponentPrivate(iface);
208+
return INetCfgComponent_AddRef((INetCfgComponent*)This);
209+
}
210+
211+
ULONG
212+
WINAPI
213+
INetCfgComponentPrivate_fnRelease(
214+
INetCfgComponentPrivate *iface)
215+
{
216+
INetCfgComponentImpl *This = impl_from_INetCfgComponentPrivate(iface);
217+
return INetCfgComponent_Release((INetCfgComponent*)This);
218+
}
219+
220+
HRESULT
221+
WINAPI
222+
INetCfgComponentPrivate_fnUnknown1(
223+
INetCfgComponentPrivate *iface,
224+
DWORD dwParam1,
225+
DWORD dwParam2)
226+
{
227+
// INetCfgComponentImpl *This = impl_from_INetCfgComponentPrivate(iface);
228+
ERR("INetCfgComponentPrivate_fnUnknown1(%p %lx %lx)\n", iface, dwParam1, dwParam2);
229+
return S_OK;
230+
}
231+
232+
static const INetCfgComponentPrivateVtbl vt_NetCfgComponentPrivate =
233+
{
234+
INetCfgComponentPrivate_fnQueryInterface,
235+
INetCfgComponentPrivate_fnAddRef,
236+
INetCfgComponentPrivate_fnRelease,
237+
INetCfgComponentPrivate_fnUnknown1,
238+
};
239+
182240
/***************************************************************
183241
* INetCfgComponent
184242
*/
@@ -202,10 +260,17 @@ INetCfgComponent_fnQueryInterface(
202260
}
203261
else if (IsEqualIID (iid, &IID_INetCfgComponentBindings))
204262
{
205-
*ppvObj = (LPVOID)&This->lpVtblComponentBindings;
263+
*ppvObj = (LPVOID)&This->lpVtblBindings;
206264
INetCfgComponentBindings_AddRef(iface);
207265
return S_OK;
208266
}
267+
else if (IsEqualIID (iid, &IID_INetCfgComponentPrivate))
268+
{
269+
TRACE("IID_INetCfgComponentPrivate\n");
270+
*ppvObj = (LPVOID)&This->lpVtblPrivate;
271+
INetCfgComponentPrivate_AddRef(iface);
272+
return S_OK;
273+
}
209274

210275
return E_NOINTERFACE;
211276
}
@@ -693,7 +758,8 @@ INetCfgComponent_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv, N
693758

694759
This->ref = 1;
695760
This->lpVtbl = (const INetCfgComponent*)&vt_NetCfgComponent;
696-
This->lpVtblComponentBindings = (const INetCfgComponentBindings*)&vt_NetCfgComponentBindings;
761+
This->lpVtblBindings = (const INetCfgComponentBindings*)&vt_NetCfgComponentBindings;
762+
This->lpVtblPrivate = (const INetCfgComponentPrivate*)&vt_NetCfgComponentPrivate;
697763
This->pProperty = NULL;
698764
This->pItem = pItem;
699765
This->pNCfg = pNCfg;

sdk/lib/uuid/otherguids.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ DEFINE_GUID(IID_INetCfgClass, 0xC0E8AE97,0x306E,0x11D1,0xAA,0xCF,
2222
DEFINE_GUID(IID_INetCfgComponent, 0xC0E8AE99,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E);
2323
DEFINE_GUID(IID_INetCfgClassSetup, 0xC0E8AE9D,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E);
2424
DEFINE_GUID(IID_INetCfgComponentBindings, 0xC0E8AE9E,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E);
25+
DEFINE_GUID(IID_INetCfgComponentPrivate, 0x98133273,0x4B20,0x11D1,0xAB,0x01,0x00,0x80,0x5F,0xC1,0x27,0x0E);
2526
DEFINE_GUID(IID_INetCfgLock, 0xC0E8AE9F,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E);
2627
DEFINE_GUID(IID_INetConnectionPropertyUi2, 0xC08956B9,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E);
2728
DEFINE_GUID(IID_INetCfgPnpReconfigCallback, 0x8D84BD35,0xE227,0x11D2,0xB7,0x00,0x00,0xA0,0xC9,0x8A,0x6A,0x85);

0 commit comments

Comments
 (0)