MprConfigInterfaceTransportEnum

The MprConfigInterfaceTransportEnum function enumerates the transports configured on the specified interface.

DWORD MprConfigInterfaceTransportEnum(
  HANDLE hMprConfig,         // handle to the router configuration
  HANDLE hRouterInterface,   // handle to the interface configuration
  DWORD dwLevel,             // level of information requested
  LPBYTE *lplpBuffer,        // array of MPR_IFTRANSPORT_0 structures
  DWORD dwPrefMaxLen,        // maximum length of data to return
  LPDWORD lpdwEntriesRead,   // number of entries enumerated
  LPDWORD lpdwTotalEntries,  // number of entries that could've
                             // been enumerated
  LPDWORD lpdwResumeHandle   // handle for continuing the enumeration
);

Parameters

hMprConfig
[in] Handle to the router configuration. Obtain this handle by calling MprConfigServerConnect.
hRouterInterface
[in] Handle to the interface configuration from which to enumerate the transports. Obtain this handle by calling MprConfigInterfaceCreate, or MprConfigInterfaceEnum.
dwLevel
[in] Specifies the level of the information returned in the lplpBuffer parameter. This parameter must be zero.
lplpBuffer
[in, out] On input, pointer to pointer variable.

On output, points to an array of MPR_IFTRANSPORT_0 structures. This memory should be freed by calling MprConfigBufferFree.

dwPrefMaxLen
[in] Specifies the preferred maximum length of returned data (in 8-bit bytes). If this parameter is -1, the buffer returned will be large enough to hold all available information.
lpdwEntriesRead
[out] Pointer to a DWORD variable. This variable receives the total number of entries that were enumerated from the current resume position.
lpdwTotalEntries
[out] Pointer to a DWORD variable. This variable receives the total number of entries that could have been enumerated from the current resume position.
lpdwResumeHandle
[in, out] Pointer to a DWORD variable.

On input, the handle should be zero on the first call and left unchanged on subsequent calls.

On output, this variable contains a resume handle used to continue the enumeration. If the handle is NULL, the enumeration is complete.

If an error occurs in the enumeration, this handle is invalid.

This parameter is optional. If the calling application specifies NULL for this parameter, the function will not return a resume handle.

Return Values

If the function succeeds, the return value is NO_ERROR.

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

Value Meaning
ERROR_INVALID_PARAMETER One of the following is true:
  • hMprConfig is NULL.
  • HRouterInterface is NULL.
  • dwLevel is not zero.
  • lplpBuffer is NULL.
  • dwPrefMaxLen is smaller than the size of a single MPR_TRANSPORT_0 structure.
  • lpdwEntriesRead is NULL.
  • lpdwTotalEntries is NULL.
ERROR_NOT_ENOUGH_MEMORY Insufficient resources to complete the operation.
ERROR_NO_MORE_ITEMS No more entries available from the current resume position.
Other Use FormatMessage to retrieve the system error message that corresponds to the error code returned.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Mprapi.h.
  Library: Use Mprapi.lib.

See Also

Router Management Reference, Router Configuration Functions, FormatMessage, MPR_IFTRANSPORT_0, MprConfigBufferFree, MprConfigInterfaceCreate, MprConfigInterfaceEnum, MprConfigInterfaceGetHandle