Actually the worst case scenario is 255.0.0.0 for 10.x.x.x based (A class) LANs. You could also use the general IP broadcast address of 255.255.255.255, but there's a chance that such packets will by dropped by interconnected bridges/switches, and definitely by any routers.
As for getting the subnet mask on win32 - beats me.
As for getting the subnet mask on win32 - beats me.