windows-nt/Source/XPSP1/NT/com/rpc/runtime/mtrt/svrapip.cxx

83 lines
1.7 KiB
C++
Raw Normal View History

2020-09-26 03:20:57 -05:00
//+-------------------------------------------------------------------------
//
// Microsoft Windows
//
// Copyright (C) Microsoft Corporation, 1991 - 1999
//
// File: svrapip.cxx
//
//--------------------------------------------------------------------------
/* --------------------------------------------------------------------
Microsoft OS/2 LAN Manager
Copyright(c) Microsoft Corp., 1990
-------------------------------------------------------------------- */
/* --------------------------------------------------------------------
File : svrapip.cxx
Description :
This file contains the private entry points into the server runtime.
History :
mikemon 02-02-91 Created.
-------------------------------------------------------------------- */
#include <precomp.hxx>
void RPC_ENTRY
I_RpcRequestMutex (
IN OUT I_RPC_MUTEX * Mutex
)
{
if (*Mutex == 0)
{
RPC_STATUS RpcStatus = RPC_S_OK;
MUTEX *mutex = new MUTEX(&RpcStatus);
if ( NULL == mutex )
{
RpcpRaiseException(RPC_S_OUT_OF_MEMORY);
return;
}
if ( RpcStatus != RPC_S_OK )
{
delete mutex;
RpcpRaiseException(RPC_S_OUT_OF_MEMORY);
return;
}
if (InterlockedCompareExchangePointer(Mutex, mutex, NULL) != NULL)
{
delete mutex;
}
}
((MUTEX *) (*Mutex))->Request();
}
void RPC_ENTRY
I_RpcClearMutex (
IN I_RPC_MUTEX Mutex
)
{
((MUTEX *) Mutex)->Clear();
}
void RPC_ENTRY
I_RpcDeleteMutex (
IN I_RPC_MUTEX Mutex
)
{
delete ((MUTEX *) Mutex);
}