468,513 Members | 1,686 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

Windows API - GetAdaptersInfo()

I am using GetAdaptersInfo( pAdapterInfo,pOutBufLen); to get the adapters info of the machine. I am using GetBestInterface() 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.
Apr 16 '08 #1
2 7609
weaknessforcats
9,207 Expert Mod 8TB
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?
Apr 16 '08 #2
TamusJRoyce
110 100+
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 : )
Apr 17 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
4 posts views Thread by Rod Gill | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.