I want to set subnet mask for Windows (.eg: 255.255.255.0). Which Windows API functions is suitable for this?
I try using CreateUnicastIpAddressEntry(&ipRow) with the parameter ipRow. OnLinkPrefixLength that content size of subnet to set (prefixlength get based on calling ConvertIpv4MaskToLength(&mask, maskLength)). However, there is two problems:
1. the input parameter mask is kind of integer I don’t know how to set it from “255.255.255.0”.
2. I try setting mask with value 16777215 and ConvertIpv4MaskToLength(&mask, maskLength) return error “Access violation writing location 0x00000000” related memory area of parameter maskLength.