Windows API - GetAdaptersInfo()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JoderCoder
    New Member
    • Feb 2008
    • 18

    Windows API - GetAdaptersInfo()

    I am using GetAdaptersInfo ( pAdapterInfo,pO utBufLen); to get the adapters info of the machine. I am using GetBestInterfac e() to get the index of my connection with the far end. So then I am matching this index with pAdapterInfo->index to find out which interface i am using. Then if I disable (disconnect) the interface and connect it back again it wont be able match. I guess pAdapterInfo is changed in the meantime. If I call GetAdaptersInfo () again, then i will be able to match. Is that the expected behaviour?

    On what occasions should i call GetAdaptersInfo ()? Say if i disconnect an interface that i dont use for my connection with the far end, will pAdapterInfo again change? Will I not be able to match the index?

    Do I have to call GetAdaptersInfo () whenever an interface is disabled or enabled?
    Do I have to call GetAdaptersInfo () whenever an interface is disconnected or connected (from network without disabling or enabling)?
    In other words on what occasion pAdapterInfo will change?


    Thanks very much for any help!!

    DB

    Ps, If anyone thinks this thread should belong to another topic, pls let me know, i'll move it accordingly.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    I assume you have read this: http://msdn2.microsoft.com/en-us/lib...17(VS.85).aspx.

    It doesn't mention anything about connecting or disconnecting an interface.

    Are you checking the return value from GetAdaptersInfo ?

    Comment

    • TamusJRoyce
      New Member
      • Apr 2008
      • 108

      #3
      It would help if you could explain what's the purpose of using this part of lphlpapi's library. I'm not that familiar with Iphlpapi or the iphelper library, but it's interesting what you can do with it.

      Are you trying to change settings within the local computer, gather info from a local computer for a user to see, or use this info to perform some other function?

      If it's to perform some other function, explain the purpose of this function alone (and not the whole project : )

      Comment

      Working...