f3a64afbec4f6c598abc55dd80d334536866329e
[reactos.git] / reactos / include / psdk / rpc.h
1
2 #if !defined( RPC_NO_WINDOWS_H ) && !defined( MAC ) && !defined( _MAC )
3 #if defined (_OLE32_)
4 #ifndef RC_INVOKED
5 #include <stdarg.h>
6 #endif
7 #include <windef.h>
8 #include <winbase.h>
9 #else
10 #include <windows.h>
11 #endif
12 #endif
13
14 #ifdef __GNUC__
15 #include <pseh/pseh2.h>
16 #endif
17
18 #ifndef __RPC_H__
19 #define __RPC_H__
20
21 #if _MSC_VER > 1000
22 #pragma once
23 #endif
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #if defined( MAC ) || defined( _MAC ) || defined(__powerpc__) && !defined(__REACTOS__)
31 #define __RPC_MAC__
32 #define __RPC_WIN32__
33 #include <pshpack2.h>
34
35 #else
36 #if defined(_M_IA64) || defined(_M_AMD64) || defined(_WIN64)
37 #define __RPC_WIN64__
38 #else
39 #define __RPC_WIN32__
40 #endif
41 #endif
42
43 #include <basetsd.h>
44
45 #if defined(__RPC_WIN64__)
46 #include <pshpack8.h>
47 #endif
48
49 #ifndef __MIDL_USER_DEFINED
50 #define midl_user_allocate MIDL_user_allocate
51 #define midl_user_free MIDL_user_free
52 #define __MIDL_USER_DEFINED
53 #endif
54
55
56 typedef void * I_RPC_HANDLE;
57 typedef long RPC_STATUS;
58 #define __RPC_FAR
59
60 #if defined(__RPC_WIN32__) || defined(__RPC_WIN64__)
61 #define RPC_UNICODE_SUPPORTED
62 #endif
63
64
65 #if !defined(__RPC_MAC__)
66 #define __RPC_API __stdcall
67 #define __RPC_USER __stdcall
68 #define __RPC_STUB __stdcall
69 #define RPC_ENTRY __stdcall
70 #else
71 #define __RPC_API
72 #define __RPC_USER
73 #define __RPC_STUB
74 #define RPC_ENTRY
75 #endif
76
77
78 #ifndef __GNUC__
79 #if !defined(DECLSPEC_IMPORT)
80 #define DECLSPEC_IMPORT
81 #endif
82
83 #if !defined(_RPCRT4_)
84 #define RPCRTAPI DECLSPEC_IMPORT
85 #else
86 #define RPCRTAPI
87 #endif
88
89 #if !defined(_RPCNS4_)
90 #define RPCNSAPI DECLSPEC_IMPORT
91 #else
92 #define RPCNSAPI
93 #endif
94 #else
95 #define RPCRTAPI
96 #define RPCNSAPI
97 #endif
98
99 #ifdef __RPC_MAC__
100 #include <setjmp.h>
101 #define RPCXCWORD (sizeof(jmp_buf)/sizeof(int))
102
103 #pragma warning(push)
104 #pragma warning( disable: 4005 )
105 #include <rpcdce.h>
106 #include <rpcnsi.h>
107 #include <rpcerr.h>
108 #include <rpcmac.h>
109 #pragma warning(pop)
110
111 typedef void (RPC_ENTRY *MACYIELDCALLBACK)(short *) ;
112 RPC_STATUS RPC_ENTRY
113 RpcMacSetYieldInfo(MACYIELDCALLBACK pfnCallback) ;
114
115 #if !defined(UNALIGNED)
116 #define UNALIGNED
117 #endif
118
119 #include <poppack.h>
120 #else
121 #include <rpcdce.h>
122 /* #include <rpcnsi.h> */
123 #include <rpcnterr.h>
124 #include <excpt.h>
125 #include <winerror.h>
126
127 #ifndef __GNUC__
128 #define RpcTryExcept __try {
129 #define RpcExcept(expr) } __except (expr) {
130 #define RpcEndExcept }
131 #define RpcTryFinally __try {
132 #define RpcFinally } __finally {
133 #define RpcEndFinally }
134 #define RpcExceptionCode() GetExceptionCode()
135 #define RpcAbnormalTermination() AbnormalTermination()
136 #else
137 #define RpcTryExcept _SEH2_TRY
138 #define RpcExcept(expr) _SEH2_EXCEPT((expr))
139 #define RpcEndExcept _SEH2_END;
140 #define RpcTryFinally _SEH2_TRY
141 #define RpcFinally _SEH2_FINALLY
142 #define RpcEndFinally _SEH2_END;
143 #define RpcExceptionCode() _SEH2_GetExceptionCode()
144 #define RpcAbnormalTermination() (_SEH2_GetExceptionCode() != 0)
145 #endif
146 #endif
147
148 #if defined(__RPC_WIN64__)
149 #include <poppack.h>
150 #endif
151
152 #ifndef RPC_NO_WINDOWS_H
153 #include <rpcasync.h>
154 #endif
155
156 #ifdef __cplusplus
157 }
158 #endif
159
160 #endif
161
162