summaryrefslogtreecommitdiffstats
path: root/public/sdk/rpc16/mac/inc/rpcmac.h
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /public/sdk/rpc16/mac/inc/rpcmac.h
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'public/sdk/rpc16/mac/inc/rpcmac.h')
-rw-r--r--public/sdk/rpc16/mac/inc/rpcmac.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/public/sdk/rpc16/mac/inc/rpcmac.h b/public/sdk/rpc16/mac/inc/rpcmac.h
new file mode 100644
index 000000000..b5d59d39b
--- /dev/null
+++ b/public/sdk/rpc16/mac/inc/rpcmac.h
@@ -0,0 +1,121 @@
+/*++
+
+Copyright (c) 1994 Microsoft Corporation
+
+Module Name:
+
+ RpcMac.h
+
+Abstract:
+
+ Macintosh RPC specific exception handler macros.
+
+Author:
+
+ Mario Goertzel [mariogo] 02-Nov-1994
+
+--*/
+
+#ifndef __RPCMAC_H__
+#define __RPCMAC_H__
+
+typedef struct _ExceptionBuff {
+#if _MSC_VER >= 1000
+ jmp_buf registers;
+#else
+ int registers[RPCXCWORD];
+#endif
+ struct _ExceptionBuff __RPC_FAR *pExceptNext;
+} ExceptionBuff, __RPC_FAR *pExceptionBuff;
+
+void RPC_ENTRY RpcSetException(pExceptionBuff);
+void RPC_ENTRY RpcLeaveException(void);
+
+#ifdef _MPPC_
+int __cdecl RpcSetJmp(jmp_buf);
+#else
+#define BLD_RT
+#endif
+
+#ifdef BLD_RT
+#define RpcTryExcept \
+ { \
+ int _exception_code; \
+ ExceptionBuff exception; \
+ RpcSetException(&exception); \
+ \
+ _exception_code = (setjmp(exception.registers)); \
+ \
+ if (!_exception_code) \
+ {
+#else
+#define RpcTryExcept \
+ { \
+ int _exception_code; \
+ ExceptionBuff exception; \
+ RpcSetException(&exception); \
+ \
+ _exception_code = (RpcSetJmp(exception.registers)); \
+ \
+ if (!_exception_code) \
+ {
+#endif
+
+// trystmts
+
+#define RpcExcept(expr) \
+ RpcLeaveException(); \
+ } \
+ else \
+ { \
+ if (!(expr)) \
+ RpcRaiseException(_exception_code);
+
+// exceptstmts
+
+#define RpcEndExcept \
+ } \
+ }
+
+#ifdef BLD_RT
+#define RpcTryFinally \
+ { \
+ int _abnormal_termination; \
+ ExceptionBuff exception; \
+ RpcSetException(&exception); \
+ \
+ _abnormal_termination = (setjmp(exception.registers)); \
+ \
+ if (!_abnormal_termination) \
+ {
+#else
+#define RpcTryFinally \
+ { \
+ int _abnormal_termination; \
+ ExceptionBuff exception; \
+ RpcSetException(&exception); \
+ \
+ _abnormal_termination = (RpcSetJmp(exception.registers)); \
+ \
+ if (!_abnormal_termination) \
+ {
+#endif
+
+// trystmts
+
+#define RpcFinally \
+ RpcLeaveException(); \
+ }
+
+// finallystmts
+
+#define RpcEndFinally \
+ if (_abnormal_termination) \
+ RpcRaiseException(_abnormal_termination); \
+ }
+
+#define RpcExceptionCode() _exception_code
+#define RpcAbnormalTermination() _abnormal_termination
+
+#endif // __RPCMAC_H__
+ \ No newline at end of file