No, you don't want to do that. The size returned by the first call to
GetAdaptersInfo() is already used to allocate the buffer and it's a much
better number than the IP_ADAPTER_INFO_SIZE, which is only used when
constructing an IP_ADAPTER_INFO instance for one of the items in the linked
list returned by GetAdaptersInfo(). That is, when you try to extract entry
three in the linked list, a different constructor is used and it copies the
right bytes out of the linked list and into its own byte[]. If you do what
you did there, enumeration of the list of adapters will *not* work
correctly.
You *should* get an error from that first call to GetAdaptersInfo() (you're
passing it a null pointer and a size of zero, so you get a 'buffer not big
enough error'). However, it also returned the right size to use. If you
look at the code, I'm using that fact to figure out how much memory to
allocate.
If you set the IP_ADAPTER_INFO_SIZE back to the right value, we should be
able to continue. Trace into the rfSignalStrengthString() call made when
you click on the Get Signal Strength button. Trace into
rfSignalStrengthDB(), which is the function which actually calls the NDISUIO
driver to get the information. In that routine, we need to be sure that the
CreateFile() call works. If it does not, your device may not have NDISUIO
on it and my scheme will not work. If the CreateFile is successful,
however, step through the rest of the routine. I would guess that the
problem is that DeviceIoControl() is returning FALSE. There may be a
problem with one of the constants that I'm passing or something. Let me
know on that.
Paul T.