windows-nt/Source/XPSP1/NT/com/rpc/runtime/mtrt/async.cxx
2020-09-26 16:20:57 +08:00

142 lines
2.4 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//+-------------------------------------------------------------------------
//
// Microsoft Windows
//
// Copyright (C) Microsoft Corporation, 1997 - 1999
//
// File: async.cxx
//
//--------------------------------------------------------------------------
#include <precomp.hxx>
RPC_STATUS RPC_ENTRY
RpcAsyncRegisterInfo (
IN PRPC_ASYNC_STATE pAsync
)
/*++
Routine Description:
Obsolete function - just an entry point.
Return Value:
--*/
{
#if !defined(_M_IA64)
return RPC_S_OK ;
#else
return RPC_S_CANNOT_SUPPORT;
#endif
}
RPC_STATUS RPC_ENTRY
RpcAsyncCancelCall (
IN PRPC_ASYNC_STATE pAsync,
IN BOOL fAbort
)
/*++
Function Name:RpcAsyncCancelCall
Parameters:
Description:
Returns:
--*/
{
MESSAGE_OBJECT *MObject = (MESSAGE_OBJECT *) pAsync->RuntimeInfo;
if (!ThreadSelf())
{
return RPC_S_OUT_OF_MEMORY;
}
if (MObject)
{
if (MObject->InvalidHandle(CALL_TYPE))
{
return (RPC_S_INVALID_BINDING);
}
return ((CALL *) MObject)->CancelAsyncCall(fAbort);
}
return (RPC_S_INVALID_BINDING);
}
RPC_STATUS RPC_ENTRY
RpcAsyncGetCallStatus (
IN PRPC_ASYNC_STATE pAsync
)
/*++
Routine Description:
description
Arguments:
pAsync -
Return Value:
RPC_S_OK - Function succeeded
RPC_S_OUT_OF_MEMORY - we ran out of memory
--*/
{
MESSAGE_OBJECT *MObject = (MESSAGE_OBJECT *) pAsync->RuntimeInfo;
if (MObject)
{
if (MObject->InvalidHandle(CALL_TYPE))
{
return (RPC_S_INVALID_BINDING);
}
return ((CALL *) MObject)->GetCallStatus() ;
}
return RPC_S_INVALID_BINDING;
}
VOID APIENTRY
I_RpcAPCRoutine (
IN RPC_APC_INFO *pAPCInfo
)
{
PRPC_ASYNC_STATE pAsync = pAPCInfo->pAsync;
void *Context = pAPCInfo->Context;
RPC_ASYNC_EVENT Event = pAPCInfo->Event;
PFN_RPCNOTIFICATION_ROUTINE pRoutine =
pAPCInfo->pAsync->u.APC.NotificationRoutine;
((CALL *) pAPCInfo->hCall)->FreeAPCInfo(pAPCInfo) ;
(*pRoutine) (pAsync, Context, Event) ;
//
// We cannot do anything after the call to the user's API routine. The
// may be gone
//
}
///////////////////////////////////////////////////////
// Routines owned by NDR //
///////////////////////////////////////////////////////
//
//
// RpcAsyncAbortCall
// RpcAsyncCompleteCall
//