I’m trying to extend the C# listadapters example to display information on WAN links, but the RAS_LINKS structure returned by GetRasLinks always has nNumberOfLinks of 0. I’m adding the following code inside the adapter loop, after it prints the adapter mode.
The C++ example returns the proper information on links when i plug in a 3g card, but from C# it always tells me nothing is there. To get this to run, I did have to change RAS_LINKS_MAX to 32 so that the runtime would stop complaining about too large a data structure to marshal, so maybe that has something to do with it?
When driver receives the memory block it checks if it has the correct size before filling it with data. If you shrinked the RAS_LINKS structure and passed smaller memory block to driver then it just has failed the operation. Is there a problem in C# with allocating large block of unmanaged memory?