Partager via


GetExtendedUdpTable (Compact 7)

3/12/2014

This function retrieves a table that contains a list of UDP endpoints available to the application.

Syntax

DWORD GetExtendedUdpTable(
  __out    PVOID pUdpTable,
  __inout  PDWORD pdwSize,
  __in     BOOL bOrder,
  __in     ULONG ulAf,
  __in     UDP_TABLE_CLASS TableClass,
  __in     ULONG Reserved
);

Parameters

  • pUdpTable
    A pointer to the table structure that contains the filtered UDP endpoints available to the application. For information about how to determine the kind of table returned based on specific input parameter combinations, see the Remarks section later in this document.
  • pdwSize
    The estimated size of the structure returned in pUdpTable, in bytes. If this value is set too small, ERROR_INSUFFICIENT_BUFFER is returned by this function, and this field will contain the correct size of the structure.
  • bOrder
    A value that specifies whether the UDP endpoint table should be sorted. If this parameter is set to TRUE, the UDP endpoints in the table are sorted in ascending order, starting with the lowest local IP address. If this parameter is set to FALSE, the UDP endpoints in the table appear in the order in which they were retrieved.

    The following values are compared as listed when ordering the UDP endpoints:

    1. Local IP address.
    2. Local scope ID (applicable when the ulAf parameter is set to AF_INET6).
    3. Local UDP port.
  • ulAf
    The version of IP used by the UDP endpoint.

    Value Meaning

    AF_INET

    IPv4 is used.

    AF_INET6

    IPv6 is used.

  • TableClass
    The kind of the UDP table structure to retrieve. This parameter can be one of the values from the UDP_TABLE_CLASS enumeration.

    The header file organization has changed and the UDP_TABLE_CLASS enumeration is defined in the Iprtrmib.h header file instead of in the Iphlpapi.h header file.

    The UDP_TABLE_CLASS enumeration value is combined with the value of the ulAf parameter to determine the extended UDP information to retrieve.

  • Reserved
    Reserved; set to 0 (zero).

Return Value

Return code Description

NO_ERROR

The call is successful.

ERROR_INSUFFICIENT_BUFFER

An insufficient amount of space was allocated for the table. The size of the table is returned in the pdwSize parameter, and must be used in a later call to this function in order to successfully retrieve the table.

This error is also returned if the pUdpTable parameter is NULL.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function. This error is returned if the TableClass parameter contains a value that is not defined in the UDP_TABLE_CLASS enumeration.

Remarks

The table type returned by this function depends on the specific combination of the ulAf parameter and the TableClass parameter.

When the ulAf parameter is set to AF_INET, the following table indicates the UDP table type to retrieve in the structure pointed to by the pUdpTable parameter for each possible TableClass value.

TableClass value pUdpTable structure

UDP_TABLE_BASIC

MIB_UDPTABLE

UDP_TABLE_OWNER_MODULE

MIB_UDPTABLE_OWNER_MODULE

UDP_TABLE_OWNER_PID

MIB_UDPTABLE_OWNER_PID

When the ulAf parameter is set to AF_INET6, the following table indicates the TCP table type to retrieve in the structure pointed to by the pUdpTable parameter for each possible TableClass value.

TableClass value pUdpTable structure

UDP_TABLE_BASIC

MIB_UDPTABLE

UDP_TABLE_OWNER_MODULE

MIB_UDPTABLE_OWNER_MODULE

UDP_TABLE_OWNER_PID

MIB_UDPTABLE_OWNER_PID

The header file organization has changed. The various MIB_UDPTABLE structures are defined in the Udpmib.h header file instead of in the Iprtrmib.h header file. Be aware that the Udpmib.h header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h and Iprtrmib.h header files should never be used directly.

See Also

Reference

IP Helper Functions
MIB_UDP6TABLE
MIB_UDP6TABLE_OWNER_MODULE
MIB_UDP6TABLE_OWNER_PID
MIB_UDPTABLE
MIB_UDPTABLE_OWNER_MODULE
MIB_UDPTABLE_OWNER_PID
UDP_TABLE_CLASS