Exemplo n.º 1
0
void rpcSrv_inProcess_terminate() {
	RPC_STATUS status;
	for(int i=0;i<ARRAYSIZE(availableInterfaces);++i) {
		if((status=RpcServerUnregisterIfEx(availableInterfaces[i],NULL,1))!=RPC_S_OK) {
			LOG_ERROR(L"RpcServerUnregisterIfEx for interface at index "<<i<<L" failed with status "<<status);
		}
	}
}
Exemplo n.º 2
0
void rpcSrv_terminate() {
	RPC_STATUS status;
	CloseHandle(nvdaUnregisteredEvent);
	nvdaUnregisteredEvent=NULL;
	UUID_VECTOR nvdaInprocUuidVector={1,&nvdaInprocUuid};
	for(int i=0;i<ARRAYSIZE(availableInterfaces);++i) {
		if((status=RpcEpUnregister(availableInterfaces[i],bindingVector,&nvdaInprocUuidVector))!=RPC_S_OK) {
			LOG_ERROR(L"RpcEpUnregister failed for interface at index "<<i<<L" with status "<<status);
		}
		if((status=RpcServerUnregisterIfEx(availableInterfaces[i],NULL,1))!=RPC_S_OK) {
			LOG_ERROR(L"RpcServerUnregisterIfEx for interface at index "<<i<<L" failed with status "<<status);
		}
	}
	RpcBindingVectorFree(&bindingVector);
}
Exemplo n.º 3
0
NTSTATUS
NTAPI
RpcpStopRpcServerEx (
    _In_ RPC_IF_HANDLE IfSpec
    )
{
    RPC_STATUS rpcStatus;

    /* Unregister the interface */
    rpcStatus = RpcServerUnregisterIfEx(IfSpec, NULL, TRUE);

    /* Acquire the lock while we dereference the RPC services */
    EnterCriticalSection(&RpcpCriticalSection);
    if (--RpcpNumInstances == 0)
    {
        /* All RPC services stopped, rundown the server */
        RpcMgmtStopServerListening(NULL);
        RpcMgmtWaitServerListen();
    }

    /* Release the lock and return the unregister result */
    LeaveCriticalSection(&RpcpCriticalSection);
    return I_RpcMapWin32Status(rpcStatus);
}