MprAdminPortEnum

[This is preliminary documentation and subject to change.]

The MprAdminPortEnum function enumerates all active ports in a specific connection, or all ports available for use or currently in use by RAS.

DWORD MprAdminPortEnum(
  RAS_SERVER_HANDLE hRasServer,        // handle to the server
  DWORD             dwLevel,           // must be zero
  HANDLE            hConnection,       // handle to connection
  LPBYTE *          lplpbBuffer,       // pointer to array of port structs
  DWORD             dwPrefMaxLen,      // maximum preferred length of returned data
  DWORD             lpdwEntriesRead,   // number of ports enumerated
  DWORD             lpdwTotalEntries,  // number of ports that could've been enumerated
  LPDWORD           lpdwResumeHandle   // handle with which to 
                                       // resume enumeration
);
 

Parameters

hRasServer
Handle to the Remote Access Server on which to enumerate ports. Obtain this handle by calling MprAdminServerConnect.
dwLevel
This parameter must be zero.
hConnection
Handle to a connection within which the active ports will be enumerated. If hConnection is INVALID_HANDLE_VALUE, all the ports in use or available for use by Routing and RAS will be enumerated. Obtain the hConnection handle by calling MprAdminConnectionEnum.
lplpbBuffer
Pointer to a pointer variable that will point to an array of RAS_PORT_0 structures on successful return. Free this memory by calling MprAdminBufferFree.
dwPrefMaxLen
Preferred maximum length of returned data (in 8-bit bytes). If dwPrefMaxLen is -1, the buffer returned will be large enough to hold all available information.
lpdwEntriesRead
Pointer to a DWORD variable. Upon successful return, this variable contains the total number of ports enumerated from the current resume position.
lpdwTotalEntries
Pointer to a DWORD variable. Upon successful return, this variable contains the total number of ports that could have been enumerated from the current resume position.
lpdwResumeHandle
Pointer to a DWORD variable. Upon successful execution, lpdwResumeHandle contains a resume handle that can be used to continue the enumeration. LpdwResumeHandle should be zero on the first call, and left unchanged on subsequent calls. If the return code is ERROR_MORE_DATA, the call may be re-issued with the handle to retrieve more data. If the handle is NULL upon return, the enumeration cannot be continued. This handle is invalid for other types of error returns.

Return Values

If the function succeeds, the return value will be NO_ERROR.

If the function fails, the return value will be ERROR_INVALID_PARAMETER.

QuickInfo

  Windows NT: Use version 5.0 and later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in mprapi.h.
  Import Library: Link with mprapi.lib.

See Also

MprAdminBufferFree, MprAdminServerConnect, MprAdminConnectionEnum