共用方式為


3.1.4.7.2 RpcAddMonitor (Opnum 46)

RpcAddMonitor installs a local port monitor and links the configuration, data, and monitor files.

 DWORD RpcAddMonitor(
   [in, string, unique] STRING_HANDLE Name,
   [in] MONITOR_CONTAINER* pMonitorContainer
 );

Name: A parameter that adheres to the specification in Print Server Name Parameters (section 3.1.4.1.4).

pMonitorContainer: A parameter that adheres to the specification in MONITOR_CONTAINER Parameters (section 3.1.4.1.8.9). The Level member of the MONITOR_CONTAINER MUST be 0x00000002.

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 validation steps as specified in MONITOR_CONTAINER Parameters (section 3.1.4.1.8.9).

  • Verify that the port monitor does not already exist in the system, and if that verification fails, return ERROR_PRINT_MONITOR_ALREADY_INSTALLED [MS-ERREF].

  • Additional validation MAY<368> 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:

  • Create the monitor object.

  • Return the status of the operation.