ConvertIpv4MaskToLength (Compact 2013)

3/26/2014

This function converts an IPv4 subnet mask to an IPv4 prefix length.

Syntax

NETIO_STATUS WINAPI ConvertIpv4MaskToLength(
  __in   ULONG Mask,
  __out  PUINT8 MaskLength
);

Parameters

  • Mask
    The IPv4 subnet mask.
  • MaskLength
    A pointer to a UINT8 value to hold the IPv4 prefix length, in bits, when the function returns successfully.

Return Value

On success, ConvertIpv4MaskToLength returns NO_ERROR. Any nonzero return value indicates failure.

Error code

Meaning

ERROR_INVALID_PARAMETER

One of the parameters was invalid. This error is returned if the Mask parameter was invalid.

See Also

Reference

IP Helper Functions
ConvertLengthToIpv4Mask