Can you not call GetIpNetTable with a size of Zero initially, which should tell you how much space to allocate of size MIB_IPNETTABLE structure.
Then allocate MIB_IPNETTABLE structure + 1 or even MIB_IPNETTABLE structure * 2.
You are allocating size of MIB_IPNETTABLE structure and still getting the error ?
Regards
Chris