답변됨 Removing of virtual network adapter

  • 2012년 2월 29일 수요일 오전 11:33
     
     

    I'm using a notify object to create a virtual network adapter. After the adapter has been installed by means of INetCfgClassSetup::Install the method SysNotifyComponent of the notify object is called and indicates that the adapter has been added. In the following the notify object is notified via SysNotifyBindingPath et cetera that bindings are added to the new adapter. So all is as expected.

    When I destroy the virtual network adapter by means of INetCfgClassSetup::DeInstall the notify object is neither notified via SysNotifyBindingPath that the bindings are removed nor via SysNotifyComponent that the adapter is removed. Why?

모든 응답

  • 2012년 2월 29일 수요일 오후 3:35
     
     

    Are you sure that there is no pending packets and other things that prevent removing of a miniport?

    Just like with normal miniports.

    -- pa

  • 2012년 3월 1일 목요일 오전 7:01
     
     
    The virtual network adapter is bound to two physical adapters. On the test machine both physical adapters have no connection to any network.
  • 2012년 3월 1일 목요일 오후 12:32
     
     

    There can be other things besides of packets that can hold a miniport from stopping, such as pending OIDs, certain memory allocations...

    -- pa

  • 2012년 3월 12일 월요일 오후 12:39
     
     
    The virtual network adapter will be removed successfully. So the problem is actually not that it is locked by any reason. The problem is: Why is the interface not called as expected?
  • 2012년 3월 13일 화요일 오전 6:46
     
     

    @Doron Holan from Microsoft: Why did you marked an unanswered question as answered?

    By the way I thought this is the job of the one that asked the question ;-)

    However, since you are now involved, please could you answer the question?

  • 2012년 3월 14일 수요일 오전 12:07
     
     답변됨

    The way it works is that notifications are delivered after changes are made.  Therefore, your NotifyObject has already been removed by the time that NetCfg goes to deliver SysNotifyComponent(NCN_REMOVE) to all NotifyObjects.  (I know this is a little weird, since it's not parallel with installation.)

    If you want a notification when your adapter is removed, you should implement INetCfgComponentSetup::Removing.

  • 2012년 3월 14일 수요일 오전 7:31
     
     
    Thanks Jeffrey for making this clear. It's indeed a little wired and not what I expected according to the description of the API. INetCfgComponentSetup::Removing is called when the component is uninstalled that owns the notify object. It's the place where I call INetCfgClassSetup::DeInstall to destroy the virtual network adapter. But it's not called for the removed adapters (as expected according to the documentation). Anyway, due to your explanation I understand the network configuration subsystem something better.