Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

214 lines
3.5 KiB

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