3.1.4.7.3 RpcDeleteMonitor (Opnum 47)

RpcDeleteMonitor removes a port monitor.

 DWORD RpcDeleteMonitor(
   [in, string, unique] STRING_HANDLE Name,
   [in, string, unique] wchar_t* pEnvironment,
   [in, string] wchar_t* pMonitorName
 );

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

pEnvironment: This parameter MUST adhere to the parameter specification in Environment Name Parameters, section 3.1.4.1.3.

pMonitorName: A pointer to a string that specifies the name of the monitor to remove. For rules governing monitor names, see section 2.2.4.8.

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 the following:

  • 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 Environment Name Parameters, section 3.1.4.1.3.

  • Verify that the pMonitorName parameter points to a string identifying a port monitor installed on the system and, if that verification fails, return ERROR_UNKNOWN_PRINT_MONITOR as specified in MS-ERREF section 2.2.

  • Verify that there are no ports (in use by any printer or print job) on the system that are controlled by this monitor at this time and, if that verification fails, return ERROR_PRINT_MONITOR_IN_USE as specified in MS-ERREF section 2.2.

  • Additional validation MAY be performed.<369>

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:

  • Clear references to the port monitor from any other data structures.

  • Delete the port monitor object.

  • Return the status of the operation.