home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / RPC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  3.8 KB  |  217 lines

  1. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  2. /*++
  3.  
  4. Copyright 1991-1998 Microsoft Corporation
  5.  
  6. Module Name:
  7.  
  8.     rpc.h
  9.  
  10. Abstract:
  11.  
  12.     Master include file for RPC applications.
  13.  
  14. --*/
  15.  
  16. #if !defined( RPC_NO_WINDOWS_H ) && !defined( MAC ) && !defined( _MAC )
  17. #include <windows.h>
  18. #endif // RPC_NO_WINDOWS_H
  19.  
  20. #ifndef __RPC_H__
  21. #define __RPC_H__
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. //-------------------------------------------------------------
  28. // platform specific defines
  29. //-------------------------------------------------------------
  30.  
  31. //-------------------  MAC ---------------------------
  32. #if defined( MAC ) || defined( _MAC )
  33.  
  34. #define __RPC_MAC__
  35. // Set the packing level for RPC structures.
  36.  
  37. #include <pshpack2.h>
  38.  
  39. //-------------------  WIN32 ---------------------------
  40. #else // win32 platforms
  41.  
  42. #define __RPC_WIN32__
  43.  
  44. #endif
  45.  
  46.  
  47. #ifndef __MIDL_USER_DEFINED
  48. #define midl_user_allocate MIDL_user_allocate
  49. #define midl_user_free     MIDL_user_free
  50. #define __MIDL_USER_DEFINED
  51. #endif
  52.  
  53. typedef void * I_RPC_HANDLE;
  54. typedef long RPC_STATUS;
  55.  
  56. #ifndef _MAC
  57. #define RPC_UNICODE_SUPPORTED
  58. #endif //_MAC
  59.  
  60.  
  61. #ifdef __RPC_MAC__
  62. #    define __RPC_FAR
  63. #    define __RPC_API
  64. #    define __RPC_USER
  65. #    define __RPC_STUB
  66. #    define RPC_ENTRY
  67. #elif   (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  68. #    define __RPC_FAR
  69. #    define __RPC_API  __stdcall
  70. #    define __RPC_USER __stdcall
  71. #    define __RPC_STUB __stdcall
  72. #    define  RPC_ENTRY __stdcall
  73. #else
  74. #    define __RPC_FAR
  75. #    define __RPC_API
  76. #    define __RPC_USER
  77. #    define __RPC_STUB
  78. #endif
  79.  
  80. // Some RPC platforms don't define DECLSPEC_IMPORT
  81. #if !defined(DECLSPEC_IMPORT)
  82. #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
  83. #define DECLSPEC_IMPORT __declspec(dllimport)
  84. #else
  85. #define DECLSPEC_IMPORT
  86. #endif
  87. #endif
  88.  
  89. #if !defined(_RPCRT4_)
  90. #define RPCRTAPI DECLSPEC_IMPORT
  91. #else
  92. #define RPCRTAPI
  93. #endif
  94.  
  95. #if !defined(_RPCNS4_)
  96. #define RPCNSAPI DECLSPEC_IMPORT
  97. #else
  98. #define RPCNSAPI
  99. #endif
  100.  
  101. #ifdef IN
  102. #undef IN
  103. #undef OUT
  104. #undef OPTIONAL
  105. #endif /* IN */
  106.  
  107. #ifdef __RPC_MAC__
  108.  
  109. #include <setjmp.h>
  110.  
  111. #define RPCXCWORD (sizeof(jmp_buf)/sizeof(int))
  112.  
  113. #pragma warning( disable: 4005 ) 
  114. #include <rpcdce.h>
  115. #include <rpcnsi.h>
  116. #include <rpcerr.h>
  117. #include <rpcmac.h>
  118. #pragma warning( default :  4005 )
  119.  
  120. typedef void  (RPC_ENTRY *MACYIELDCALLBACK)(/*OSErr*/ short *) ; 
  121. RPC_STATUS RPC_ENTRY
  122. RpcMacSetYieldInfo(
  123.     MACYIELDCALLBACK pfnCallback) ;
  124.  
  125. #if !defined(UNALIGNED)
  126. #define UNALIGNED
  127. #endif
  128.  
  129. #include <poppack.h>
  130.  
  131. #else // __RPC_MAC__
  132.  
  133. #include <rpcdce.h>
  134. #include <rpcnsi.h>
  135. #include <rpcnterr.h>
  136. #include <excpt.h>
  137. #include <winerror.h>
  138.  
  139. #define RpcTryExcept \
  140.     __try \
  141.         {
  142.  
  143. // trystmts
  144.  
  145. #define RpcExcept(expr) \
  146.         } \
  147.     __except (expr) \
  148.         {
  149.  
  150. // exceptstmts
  151.  
  152. #define RpcEndExcept \
  153.         }
  154.  
  155. #define RpcTryFinally \
  156.     __try \
  157.         {
  158.  
  159. // trystmts
  160.  
  161. #define RpcFinally \
  162.         } \
  163.     __finally \
  164.         {
  165.  
  166. // finallystmts
  167.  
  168. #define RpcEndFinally \
  169.         }
  170.  
  171. #define RpcExceptionCode() GetExceptionCode()
  172. #define RpcAbnormalTermination() AbnormalTermination()
  173.  
  174. RPCRTAPI
  175. RPC_STATUS
  176. RPC_ENTRY
  177. RpcImpersonateClient (
  178.     IN RPC_BINDING_HANDLE BindingHandle OPTIONAL
  179.     );
  180.  
  181. RPCRTAPI
  182. RPC_STATUS
  183. RPC_ENTRY
  184. RpcRevertToSelfEx (
  185.     IN RPC_BINDING_HANDLE BindingHandle OPTIONAL
  186.     );
  187.  
  188. RPCRTAPI
  189. RPC_STATUS
  190. RPC_ENTRY
  191. RpcRevertToSelf (
  192.     );
  193.  
  194. RPCRTAPI
  195. long
  196. RPC_ENTRY
  197. I_RpcMapWin32Status (
  198.     IN RPC_STATUS Status
  199.     );
  200.  
  201. #endif // __RPC_MAC__
  202.  
  203. // Definitions which depend on windows.h
  204. #if !defined( RPC_NO_WINDOWS_H ) && !defined( MAC ) && !defined( _MAC )
  205.  
  206. #include <rpcasync.h>
  207.  
  208. #endif // RPC_NO_WINDOWS_H
  209.  
  210. #ifdef __cplusplus
  211. }
  212. #endif
  213.  
  214. #endif // __RPC_H__
  215.  
  216. #pragma option pop /*P_O_Pop*/
  217.