The RpcMgmtStopServerListening function tells a server to stop listening for remote procedure calls. This function will not affect auto-listen interfaces. See RpcServerRegisterIfEx for more details.
This function is supported by both server platforms — Windows NT and Windows 95.
#include <rpc.h>
RPC_STATUS RPC_ENTRY RpcMgmtStopServerListening(
RPC_BINDING_HANDLE Binding
);
An application calls the RpcMgmtStopServerListening routine to direct a server to stop listening for remote procedure calls. If DontWait was true, the application should call RpcMgmtWaitServerListen to wait for all calls to complete.
When it receives a stop-listening request, the RPC run-time library stops accepting new remote procedure calls for all registered interfaces. Executing calls are allowed to complete, including callbacks.
After all calls complete, the RpcServerListen routine returns to the caller. If DontWait is true, the application calls RpcMgmtWaitServerListen for all calls to complete.
Value | Meaning |
---|---|
RPC_S_OK | Success |
RPC_S_INVALID_BINDING | Invalid binding handle |
RPC_S_WRONG_KIND_OF_BINDING | Wrong kind of binding for operation |
Note From the client-side, RpcMgmtStopServerListening is disabled by default. To enable this routine, create an authorization function in your server application that returns TRUE (to allow a remote shutdown) whenever RpcMgmtStopServerListening is called. Use RpcMgmtSetAuthorizationFn to give the client access to the management function.
Windows NT: Yes
Windows CE: Unsupported.
Header: Declared in rpcdce.h.
Import Library: Link with rpcrt4.lib.
RpcEpResolveBinding, RpcMgmtWaitServerListen, RpcServerListen, RpcServerRegisterIfEx