DRAFT: Take more than your usual care.

StopRpcServer

A service DLL running in a SVCHOST process calls this function to stop an RPC server instance.

Declaration

Access to the function is indirect, through the StopRpcServer member of the SVCHOST_GLOBAL_DATA structure whose address was passed to the service DLL’s SvchostPushServiceGlobals function. The member has the following type definition:

typedef NTSTATUS (WINAPI *) LPSTOP_RPC_SERVER (RPC_IF_HANDLE IfSpec);

Parameters

The IfSpec argument is the address of a MIDL-generated structure that describes the interface to remove.

Return Value

The function returns zero for success, else an error code.

Behaviour

The function asks that the given interface be removed from the RPC Run-Time registry. The result of this call to RpcServerUnregisterIf becomes the result of the function. Whether the function succeeds or fails, an instance is considered to have stopped. If no other instance is running, the function tells the server to stop listening for RPCs and then waits for all calls to complete.

Availability

The StopRpcServer function is exposed to service DLLs by SVCHOST.EXE in versions 5.1 and higher.