次の方法で共有


GetOwnerModuleFromTcp6Entry (Compact 2013)

3/26/2014

This function retrieves data about the module that issued the context bind for a specific IPv6 TCP endpoint in a MIB table row.

Syntax

DWORD GetOwnerModuleFromTcp6Entry(
  __in     PMIB_TCP6ROW_OWNER_MODULE pTcpEntry,
  __in     TCPIP_OWNER_MODULE_INFO_CLASS Class,
  __out    PVOID Buffer,
  __inout  PDWORD pdwSize
);

Parameters

  • pTcpEntry
    A pointer to a MIB_TCP6ROW_OWNER_MODULE structure that contains the IPv6 TCP endpoint entry used to obtain the owner module.
  • Class
    A TCPIP_OWNER_MODULE_INFO_CLASS enumeration value that indicates the type of data to obtain about the owner module. The TCPIP_OWNER_MODULE_INFO_CLASS enumeration is defined in the Iprtrmib.h header file.

    This parameter must be set to TCPIP_OWNER_MODULE_INFO_BASIC.

  • Buffer
    A pointer to a buffer that contains a TCPIP_OWNER_MODULE_BASIC_INFO structure with the owner module data. The type of data returned in this buffer is indicated by the value of the Class parameter.

    The following structures are used for the data in Buffer when Class is set to the corresponding value.

    Class enumeration value

    Buffer data format

    TCPIP_OWNER_MODULE_BASIC_INFO

    TCPIP_OWNER_MODULE_BASIC_INFO

  • pdwSize
    The estimated size of the structure returned in Buffer, in bytes. If this value is set too small, ERROR_INSUFFICIENT_BUFFER is returned by this function, and this field will contain the correct structure size.

Return Value

If the function call is successful, the value NO_ERROR is returned.

If the function fails, the return value is one of the following error codes.

Return code

Description

ERROR_INSUFFICIENT_BUFFER

Insufficient 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.

ERROR_INVALID_PARAMETER

A parameter is incorrect. This value is returned if either of the pTcpEntry or pdwSize parameters are NULL. This value is also returned if the Class parameter is not equal to TCPIP_OWNER_MODULE_INFO_BASIC.

ERROR_NOT_ENOUGH_MEMORY

Insufficient memory is available to complete the operation.

ERROR_NOT_FOUND

The element was not found. This value is returned if the dwOwningPid member of the MIB_TCP6ROW_OWNER_MODULE pointed to by the pTcpEntry parameter was zero or could not be found.

ERROR_PARTIAL_COPY

Only part of a request was completed.

Remarks

The Buffer parameter contains not only a structure with pointers to specific data, for example, pointers to the zero-terminated strings that contain the name and path of the owner module, but the actual data itself; that is the name and path strings. Therefore, when calculating the size of the buffer, make sure that you have sufficient space for both the structure and the data the members of the structure point to.

The resolution of TCP table entries to owner modules is a best practice. In several cases, the owner module name returned in the TCPIP_OWNER_MODULE_BASIC_INFO structure can be a process name (such as "svchost.exe"), a service name (such as "RPC"), or a component name (such as "timer.dll").

See Also

Reference

IP Helper Functions
MIB_TCP6ROW_OWNER_MODULE
TCPIP_OWNER_MODULE_INFO_CLASS