Geoff Chappell, Software Analyst
DRAFT: Take more than your usual care.
A service DLL running in a SVCHOST process calls this function to stop an RPC server instance.
Access to the function is indirect, through the StopRpcServerEx 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_EX (RPC_IF_HANDLE IfSpec);
The IfSpec argument is the address of a MIDL-generated structure that describes the interface to remove.
The function returns zero for success, else an error code.
The function asks that the given interface be removed from the RPC Run-Time registry. The result of this call to RpcServerUnregisterIfEx 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.
The StopRpcServerEx function is exposed to service DLLs by SVCHOST.EXE in versions 5.1 and higher.