DRAFT: Take more than your usual care.


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


Access to the function is indirect, through the StartRpcServer 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:

    RPC_WSTR PipeName,
    RPC_IF_HANDLE IfSpec);


The PipeName argument names the pipe that is to be the endpoint for delivery of RPCs.

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

Return Value

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


The function tells the RPC Run-Time to use the ncacn_np protocol sequence in combination with the named pipe “\\PIPE\\PipeName” (in C-language notation with escaped backslashes). If this succeeds, or if the named pipe is a duplicate endpoint, the function registers the given interface. Failure at either step is failure for the function. This much starts an instance of the RPC server. If the process does not already have an instance started, the function asks the RPC Run-Time to start listening, and the function returns without waiting. Failure, except because the server is already listening, is failure for the function.


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