次の方法で共有


ConvertLengthToIpv4Mask (Compact 2013)

3/26/2014

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

Syntax

NETIO_STATUS WINAPI ConvertLengthToIpv4Mask(
  __in   ULONG MaskLength,
  __out  PULONG Mask
);

Parameters

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

Return Value

On success, ConvertLengthToIpv4Mask returns NO_ERROR. Any nonzero return value indicates failure and the Mask parameter is set to INADDR_NONE defined in the Ws2def.h header file.

Error code

Meaning

ERROR_INVALID_PARAMETER

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

See Also

Reference

IP Helper Functions
ConvertIpv4MaskToLength