RpcServerUnregisterIfEx function (rpcdce.h)

The RpcServerUnregisterIfEx function removes an interface from the RPC run-time library registry. This function extends the functionality of the RpcServerUnregisterIf function.


RPC_STATUS RpcServerUnregisterIfEx(
  [in] RPC_IF_HANDLE IfSpec,
  [in] UUID          *MgrTypeUuid,
  [in] int           RundownContextHandles


[in] IfSpec

Interface to remove from the registry.

Specify a null value to remove all interfaces previously registered with the type UUID value specified in the MgrTypeUuid parameter.

[in] MgrTypeUuid

Pointer to the type UUID of the manager entry-point vector (EPV) to remove from the registry. The value of MgrTypeUuid should be the same value as was provided in a call to the RpcServerRegisterIf function, RpcServerRegisterIf2 function, or the RpcServerRegisterIfEx function.

Specify a null value to remove the interface specified in the IfSpec parameter for all previously registered type UUIDs from the registry.

Specify a nil UUID to remove the MIDL-generated default manager EPV from the registry. In this case, all manager EPVs registered with a non-nil type UUID remain registered.

[in] RundownContextHandles

Specifies whether rundown is called for active context handles. If non-zero, the rundown is called once all calls on the interface have completed. If set to zero, the RPC run time assumes the server has already destroyed its portion of the context handle and it will not call the rundown routines.

Return value

Returns RPC status. RpcServerUnregisterIfEx does not fail unless supplied with invalid values.

Note  For a list of valid error codes, see RPC Return Values.


The RpcServerUnregisterIfEx function waits for all calls on a given interface to complete before unregistering the context handles.

The RpcServerUnregisterIfEx function supplies all the functionality provided in the RpcServerUnregisterIf function. In addition, the RpcServerUnregisterIfEx function unregisters all context handles registered by the given interface. The interface must use the strict_context_handle attribute, otherwise the results are undefined.

RpcServerUnregisterIfEx is the only function that provides safe unloading of a DLL with active context handles outside of process shutdown. It is available on Windows XP and later versions of Windows only.


Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header rpcdce.h (include Rpc.h)
Library Rpcrt4.lib
DLL Rpcrt4.dll

See also


Registering Interfaces





Using Context Handles