[DDK]
[reactos.git] / 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 #ifndef __ROS_LONG64__
58 typedef long RPC_STATUS;
59 #else
60 typedef int RPC_STATUS;
61 #endif
62 #define __RPC_FAR
63
64 #if defined(__RPC_WIN32__) || defined(__RPC_WIN64__)
65 #define RPC_UNICODE_SUPPORTED
66 #endif
67
68
69 #if !defined(__RPC_MAC__)
70 #define __RPC_API __stdcall
71 #define __RPC_USER __stdcall
72 #define __RPC_STUB __stdcall
73 #define RPC_ENTRY __stdcall
74 #else
75 #define __RPC_API
76 #define __RPC_USER
77 #define __RPC_STUB
78 #define RPC_ENTRY
79 #endif
80
81
82 #ifndef __GNUC__
83 #if !defined(DECLSPEC_IMPORT)
84 #define DECLSPEC_IMPORT
85 #endif
86
87 #if !defined(_RPCRT4_)
88 #define RPCRTAPI DECLSPEC_IMPORT
89 #else
90 #define RPCRTAPI
91 #endif
92
93 #if !defined(_RPCNS4_)
94 #define RPCNSAPI DECLSPEC_IMPORT
95 #else
96 #define RPCNSAPI
97 #endif
98 #else
99 #define RPCRTAPI
100 #define RPCNSAPI
101 #endif
102
103 #ifdef __RPC_MAC__
104 #include <setjmp.h>
105 #define RPCXCWORD (sizeof(jmp_buf)/sizeof(int))
106
107 #pragma warning(push)
108 #pragma warning( disable: 4005 )
109 #include <rpcdce.h>
110 #include <rpcnsi.h>
111 #include <rpcerr.h>
112 #include <rpcmac.h>
113 #pragma warning(pop)
114
115 typedef void (RPC_ENTRY *MACYIELDCALLBACK)(short *) ;
116 RPC_STATUS RPC_ENTRY
117 RpcMacSetYieldInfo(MACYIELDCALLBACK pfnCallback) ;
118
119 #if !defined(UNALIGNED)
120 #define UNALIGNED
121 #endif
122
123 #include <poppack.h>
124 #else
125 #include <rpcdce.h>
126 /* #include <rpcnsi.h> */
127 #include <rpcnterr.h>
128 #include <excpt.h>
129 #include <winerror.h>
130
131 #ifndef __GNUC__
132 #define RpcTryExcept __try {
133 #define RpcExcept(expr) } __except (expr) {
134 #define RpcEndExcept }
135 #define RpcTryFinally __try {
136 #define RpcFinally } __finally {
137 #define RpcEndFinally }
138 #define RpcExceptionCode() GetExceptionCode()
139 #define RpcAbnormalTermination() AbnormalTermination()
140 #else
141 #define RpcTryExcept _SEH2_TRY
142 #define RpcExcept(expr) _SEH2_EXCEPT((expr))
143 #define RpcEndExcept _SEH2_END;
144 #define RpcTryFinally _SEH2_TRY
145 #define RpcFinally _SEH2_FINALLY
146 #define RpcEndFinally _SEH2_END;
147 #define RpcExceptionCode() _SEH2_GetExceptionCode()
148 #define RpcAbnormalTermination() (_SEH2_GetExceptionCode() != 0)
149 #endif
150 #endif
151
152 #if defined(__RPC_WIN64__)
153 #include <poppack.h>
154 #endif
155
156 #ifndef RPC_NO_WINDOWS_H
157 #include <rpcasync.h>
158 #endif
159
160 #ifdef __cplusplus
161 }
162 #endif
163
164 #endif
165
166