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.

199 lines
3.6 KiB

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