3.1.4.7.1 RpcEnumMonitors (Opnum 36)

The RpcEnumMonitors method retrieves information about the port monitors installed on the specified server.

 DWORD RpcEnumMonitors(
   [in, string, unique] STRING_HANDLE pName,
   [in] DWORD Level,
   [in, out, unique, size_is(cbBuf), disable_consistency_check] 
     BYTE* pMonitor,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded,
   [out] DWORD* pcReturned
 );

pName: This parameter MUST adhere to the parameter specification in Print Server Name Parameters, section 3.1.4.1.4.

Level: This value refers to the level of port monitor information structure, as follows.

Value

Description

0x00000001

Corresponds to _MONITOR_INFO_1 (section 2.2.2.7.1).

0x00000002

Corresponds to _MONITOR_INFO_2 (section 2.2.2.7.2).

pMonitor: This parameter SHOULD be ignored if cbBuf equals zero; otherwise, it is a pointer to the BUFFER, as specified in INFO Structures Query Parameters, section 3.1.4.1.9.

BUFFER TYPE: _MONITOR_INFO.

cbBuf: This parameter MUST adhere to the parameter specification in INFO Structures Query Parameters, section 3.1.4.1.9.

pcbNeeded: This parameter MUST adhere to the parameter specification in INFO Structures Query Parameters, section 3.1.4.1.9.

pcReturned: This parameter MUST adhere to the parameter specification in INFO Structures Query Parameters, section 3.1.4.1.9.

Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error code to indicate failure [MS-ERREF].

Upon receiving this message, the server MUST validate parameters as follows:

  • Perform the validation steps that are specified in Print Server Name Parameters, section 3.1.4.1.4.

  • Perform the validation steps that are specified in INFO Structures Query Parameters, section 3.1.4.1.9.

  • Additional validation MAY<353> be performed.

If parameter validation fails, the server MUST fail the operation immediately and return a nonzero error response to the client. Otherwise, the server MUST process the message and compose a response to the client as follows:

  • Enumerate all port monitors supporting the methods listed as required or optional in section Monitor Module Methods (section 3.1.4.11) on the print server.<354>

  • Using the enumerated objects, perform the processing and response steps specified in INFO Structures Query Parameters, section 3.1.4.1.9.

  • Return the status of the operation.