Problem with UnbindFrom()



I have problem with unbinding IM driver from all above and bellow components.
I have tried it by this way:

INetCfgComponent* cfgCompBuff[256];
INetCfgComponent* pncc=NULL;
INetCfgComponentBindings* inetCfgCompBindings = NULL;
INetCfgBindingPath* pncbp=NULL;

hr = pnc->FindComponent(szComponentId, &pncc);

while (S_OK == (hr = HrGetNextBindingPathToDelete(pncc, EBP_BELOW,
&pncbp, &inetCfgCompBindings)))
{
ZeroMemory(cfgCompBuff, sizeof(cfgCompBuff));
hr = pnc->EnumComponents(&GUID_DEVCLASS_NET, &enumCfgComp);
if(hr == S_OK) {
hr = enumCfgComp->Next(256, (INetCfgComponent**)&cfgCompBuff,
&celtFetched);
for(i = 0; i < celtFetched; i++) {
hr = inetCfgCompBindings->UnbindFrom(cfgCompBuff[i]);
}
}
enumCfgComp->Release();
ReleaseObj(pncbp);
}
while (S_OK == (hr = HrGetNextBindingPathToDelete(pncc, EBP_ABOVE,
&pncbp, &inetCfgCompBindings)))
{
ZeroMemory(cfgCompBuff, sizeof(cfgCompBuff));
hr = pnc->EnumComponents(&GUID_DEVCLASS_NETTRANS, &enumCfgComp);
if(hr == S_OK) {
hr = enumCfgComp->Next(256, (INetCfgComponent**)&cfgCompBuff,
&celtFetched);
for(i = 0; i < celtFetched; i++) {
hr = inetCfgCompBindings->UnbindFrom(cfgCompBuff[i]);
}
}
enumCfgComp->Release();
ReleaseObj(pncbp);
}


Return values from UnbindFrom() functions are S_OK in case that binding exist,
but when I see Properties dialog of unbinded network connection - check box
is still there and IM driver is functional.
What is wrong with that way of unbinding ?

Peter
.



Relevant Pages


Loading