次の方法で共有


GetNetworkParams (Compact 2013)

3/26/2014

This function retrieves network parameters for the local device.

Syntax

DWORD GetNetworkParams(
  PFIXED_INFO pFixedInfo, 
  PULONG pOutBufLen
);

Parameters

  • pFixedInfo
    [out] A pointer to a buffer that contains a FIXED_INFO structure that receives the network parameters for the local device, if the function was successful. This buffer must be allocated by the caller.
  • pOutBufLen
    [in, out] A pointer to a ULONG variable that specifies the size of the FIXED_INFO structure. If this size is insufficient to hold the information, GetNetworkParams fills in this variable with the required size, and returns an error code of ERROR_BUFFER_OVERFLOW.

Return Value

Return code

Description

ERROR_SUCCESS

The function succeeds.

ERROR_BUFFER_OVERFLOW

The buffer to receive the network parameter information is too small. This value is returned if the pOutBufLen parameter is too small to hold the network parameter information or the pFixedInfo parameter was a NULL pointer. When this error code is returned, the pOutBufLen parameter points to the required buffer size.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function. This error is returned if the pOutBufLen parameter is a NULL pointer, the calling process does not have read/write permission to the memory pointed to by pOutBufLen, or the calling process does not have write access to the memory pointed to by the pFixedInfo parameter.

ERROR_NO_DATA

No network parameter information exists for the local device.

ERROR_NOT_SUPPORTED

GetNetworkParams is not supported by the operating system that is running on the local device.

Other

If the function fails, use FormatMessage to obtain the message string for the returned error.

Requirements

Header

iphlpapi.h

Library

Iphlpapi.lib

See Also

Reference

IP Helper Functions
FIXED_INFO

Other Resources

IP Helper