126.96.36.199.2 RpcDeletePort (Opnum 39)
DWORD RpcDeletePort( [in, string, unique] STRING_HANDLE pName, [in] ULONG_PTR hWnd, [in, string] wchar_t* pPortName );
pName: A parameter specified in Print Server Name Parameters (section 188.8.131.52.4).
hWnd: The value of this parameter SHOULD be set to zero when sent and MUST be ignored on receipt.
pPortName: A pointer to a string that specifies the name of the port that is deleted. For rules governing port names, see section 184.108.40.206.
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 specified in Print Server Name Parameters (section 220.127.116.11.4).
Verify that the string that is referenced by pPortName represents a port installed on the server, and if that validation fails, return ERROR_UNKNOWN_PORT.
Verify that the port is not being used by any printer or print job in the system, and if that validation fails, return ERROR_BUSY.
Additional validation MAY<342> 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:
Clear the references to this port from any other data structures.
Delete the port object.
Modify the list of ports in the system to exclude the deleted port.
If any clients have registered for notification of server object changes, a notification MUST be broadcast to them.
Return the status of the operation.