Leaked source code of windows server 2003
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.

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