Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IpHlpApi.GetAdaptersAddresses() GatewayAddresses Member is always zero #472

Open
shouhujishu opened this issue Jul 12, 2024 · 3 comments
Open

Comments

@shouhujishu
Copy link

IpHlpApi.GetAdaptersAddresses(Vanara.PInvoke.IpHlpApi.GetAdaptersAddressesFlags.GAA_FLAG_INCLUDE_ALL_INTERFACES);
The gateway list is always zero when iterating over the results
os: windows11 23H2
Thanks for the help

@dahall
Copy link
Owner

dahall commented Jul 12, 2024

That is odd. I'm running the same OS ver and get a list of like 50 interfaces. Try some different flag values and see if the absence remains.

dahall added a commit that referenced this issue Jul 12, 2024
@shouhujishu
Copy link
Author

That is odd. I'm running the same OS ver and get a list of like 50 interfaces. Try some different flag values and see if the absence remains.

Thank you for your reply. I have tried to switch different flags, and the result is normal. Only the GatewayAddresses enumeration is always empty.

@dahall
Copy link
Owner

dahall commented Aug 1, 2024

Are you running your code as 32 or 64 bit? Can you try with second param as , ADDRESS_FAMILY.AF_UNSPEC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants