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

84 lines
2.2 KiB
C
Raw Permalink 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, 1991 - 1999
//
// File: rpcx86.h
//
//--------------------------------------------------------------------------
/*********************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1991 **/
/** **/
/** Exceptions package for C for DOS/WIN/OS2 **/
/** **/
/*********************************************************/
#ifndef __RPCx86_H__
#define __RPCx86_H__
typedef struct _ExceptionBuff {
int registers[RPCXCWORD];
struct _ExceptionBuff __RPC_FAR *pExceptNext;
} ExceptionBuff, __RPC_FAR *pExceptionBuff;
int RPC_ENTRY RpcSetException(pExceptionBuff);
void RPC_ENTRY RpcLeaveException(void);
#define RpcTryExcept \
{ \
int _exception_code; \
ExceptionBuff exception; \
\
_exception_code = RpcSetException(&exception); \
\
if (!_exception_code) \
{
// trystmts
#define RpcExcept(expr) \
RpcLeaveException(); \
} \
else \
{ \
if (!(expr)) \
RpcRaiseException(_exception_code);
// exceptstmts
#define RpcEndExcept \
} \
}
#define RpcTryFinally \
{ \
int _abnormal_termination; \
ExceptionBuff exception; \
\
_abnormal_termination = RpcSetException(&exception); \
\
if (!_abnormal_termination) \
{
// trystmts
#define RpcFinally \
RpcLeaveException(); \
}
// finallystmts
#define RpcEndFinally \
if (_abnormal_termination) \
RpcRaiseException(_abnormal_termination); \
}
#define RpcExceptionCode() _exception_code
#define RpcAbnormalTermination() _abnormal_termination
#endif // __RPCx86_H__