ames
asked on
Any API call to find OS? Any API to find Subnet Mask?
MFC App. Need to find OS, such as NT, 95, or 98. Any API? Also need to find subnet mask.
To get the version information use GetVersionEx().
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That will explain why I couldn't find an API function to get teh subnet mask.
The 'inofficial' location of the subnet mask is HKLM\System\CurrentControl Set\Servic es\<Networ k Adapter Name>\Parameters\Tcpip
Cool, thanks. How does one go about getting the <Network Adapter Name>? Is there an API call or say a device look-up?
See 'HKLM\SYSTEM\CurrentContro lSet\Servi ces\Lanman Workstatio n\Linkage\ Route' (binary data). Only valid if 'LanmanWorkstation' is listed first in 'HKLM\SYSTEM\CurrentContro lSet\Contr ol\Network Provider\O rder', alter it if not.
ASKER
There could be multiple network adapters and hence many subnet masks. I used ipconfig or winipcfg. Thanks.