Link to home
Start Free TrialLog in
Avatar of ames
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.
Avatar of kinkajou
kinkajou

To get the version information use GetVersionEx().
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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\CurrentControlSet\Services\<Network 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\CurrentControlSet\Services\LanmanWorkstation\Linkage\Route' (binary data). Only valid if 'LanmanWorkstation' is listed first in 'HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order', alter it if not.
Avatar of ames

ASKER

There could be multiple network adapters and hence many subnet masks. I used ipconfig or winipcfg. Thanks.