3.1.4.3.2 RpcAsyncEnumPorts (Opnum 47)

RpcAsyncEnumPorts enumerates the ports that are available for printing on a specified server.

The counterpart of this method in the Print System Remote Protocol is RpcEnumPorts. All parameters not defined below are specified in [MS-RPRN] section 3.1.4.6.1.

 DWORD RpcAsyncEnumPorts(
   [in] handle_t hRemoteBinding,
   [in, string, unique] wchar_t* pName,
   [in] DWORD Level,
   [in, out, unique, size_is(cbBuf)] 
     unsigned char* pPort,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded,
   [out] DWORD* pcReturned
 );

hRemoteBinding: An RPC explicit binding handle.

Return Values: This method returns zero to indicate successful completion or a nonzero Win32 error code ([MS-ERREF] section 2.2) to indicate failure. Aside from the specific nonzero return values documented in section 3.1.4, the client MUST treat any nonzero return value as a fatal error.

Exceptions Thrown: This method MUST NOT throw any exceptions other than those that are thrown by the underlying RPC protocol [MS-RPCE].

This method MUST adhere to the parameter validation, processing, and response requirements that are specified in [MS-RPRN] section 3.1.4.6.1.