RpcMgmtStopServerListening  FFPBH_

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

 

   );

 

 

Parameters

Binding

To direct a remote application to stop listening for remote procedure calls, specify a server binding handle for that application. To direct your own (local) application to stop listening for remote procedure calls, specify a value of NULL.

 

Remarks

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 RpcMgmtServerListen for all calls to complete.

Return Values

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 RpcMgmtSetAuthorizationFnBF5ROB to give the client access to the management function.

 

See Also

RpcEpResolveBinding, RpcMgmtWaitServerListen, RpcServerListen, RpcServerRegisterIfEx