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.

334 lines
14 KiB

  1. /************************************************************************
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name :
  4. interp.h
  5. Abstract :
  6. Definitions for the client and server stub interpreter. Compiled from
  7. previous files srvcall.h, srvoutp.h, and getargs.h.
  8. Author :
  9. DKays October 1994
  10. Revision History :
  11. ***********************************************************************/
  12. #ifndef _INTERP_
  13. #define _INTERP_
  14. //
  15. // Stack and argument defines.
  16. //
  17. #if defined(_IA64_) || defined(_AMD64_)
  18. #define REGISTER_TYPE _int64
  19. #else
  20. #define REGISTER_TYPE int
  21. #endif
  22. #define RETURN_SIZE 8
  23. //
  24. // Define interpreter limitations.
  25. //
  26. #define ARGUMENT_COUNT_THRESHOLD 16
  27. #define MAX_STACK_SIZE ARGUMENT_COUNT_THRESHOLD * sizeof(double)
  28. //
  29. // The maximum number of context handles parameters in a procedure that we
  30. // can handle.
  31. //
  32. #define MAX_CONTEXT_HNDL_NUMBER 8
  33. //
  34. // Argument caching data structures.
  35. //
  36. #define QUEUE_LENGTH ARGUMENT_COUNT_THRESHOLD
  37. typedef struct _ARG_QUEUE_INFO
  38. {
  39. PFORMAT_STRING pFormat;
  40. uchar * pArg;
  41. uchar ** ppArg;
  42. short ParamNum;
  43. short IsReturn : 1;
  44. short IsBasetype : 1;
  45. short IsIn : 1;
  46. short IsOut : 1;
  47. short IsOutOnly : 1;
  48. short IsDeferredFree : 1;
  49. short IsDontCallFreeInst : 1;
  50. } ARG_QUEUE_ELEM, *PARG_QUEUE_ELEM;
  51. typedef struct _ARG_QUEUE
  52. {
  53. long Length;
  54. ARG_QUEUE_ELEM * Queue;
  55. } ARG_QUEUE, *PARG_QUEUE;
  56. //
  57. // Argument retrieval macros.
  58. //
  59. #define INIT_ARG(argptr,arg0) va_start(argptr, arg0)
  60. //
  61. // Both MIPS and x86 are 4 byte aligned stacks, with MIPS supporting 8byte
  62. // alignment on the stack as well. Their va_list is essentially an
  63. // unsigned char *.
  64. //
  65. #if defined(_IA64_)
  66. #define GET_FIRST_IN_ARG(argptr)
  67. #define GET_FIRST_OUT_ARG(argptr)
  68. #elif defined(_AMD64_)
  69. #define GET_FIRST_IN_ARG(argptr)
  70. #define GET_FIRST_OUT_ARG(argptr)
  71. #else
  72. #define GET_FIRST_IN_ARG(argptr) argptr = *(va_list *)argptr
  73. #define GET_FIRST_OUT_ARG(argptr) argptr = *(va_list *)argptr
  74. #endif
  75. #define GET_NEXT_C_ARG(argptr,type) va_arg(argptr,type)
  76. #define SKIP_STRUCT_ON_STACK(ArgPtr, Size) ArgPtr += Size
  77. #define GET_STACK_START(ArgPtr) ArgPtr
  78. #define GET_STACK_POINTER(ArgPtr, mode) ArgPtr
  79. //
  80. // Use the following macro _after_ argptr has been saved or processed
  81. //
  82. #define SKIP_PROCESSED_ARG(argptr, type) \
  83. GET_NEXT_C_ARG(argptr, type); \
  84. GET_STACK_POINTER(argptr,type)
  85. #define GET_NEXT_S_ARG(argptr,type) argptr += sizeof(type)
  86. //
  87. // Some typedefs so that the C compiler front end won't complain about calling
  88. // the server manager function with a specific number of arguments. This may
  89. // help the C compiler code generator too.
  90. //
  91. typedef _int64 (__RPC_API * MANAGER_FUNCTION)(void);
  92. typedef _int64 (__RPC_API * MANAGER_FUNCTION1)(
  93. REGISTER_TYPE);
  94. typedef _int64 (__RPC_API * MANAGER_FUNCTION2)(
  95. REGISTER_TYPE, REGISTER_TYPE);
  96. typedef _int64 (__RPC_API * MANAGER_FUNCTION3)(
  97. REGISTER_TYPE, REGISTER_TYPE, REGISTER_TYPE);
  98. typedef _int64 (__RPC_API * MANAGER_FUNCTION4)(
  99. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  100. typedef _int64 (__RPC_API * MANAGER_FUNCTION5)(
  101. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  102. REGISTER_TYPE);
  103. typedef _int64 (__RPC_API * MANAGER_FUNCTION6)(
  104. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  105. REGISTER_TYPE,REGISTER_TYPE);
  106. typedef _int64 (__RPC_API * MANAGER_FUNCTION7)(
  107. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  108. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  109. typedef _int64 (__RPC_API * MANAGER_FUNCTION8)(
  110. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  111. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  112. typedef _int64 (__RPC_API * MANAGER_FUNCTION9)(
  113. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  114. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  115. REGISTER_TYPE);
  116. typedef _int64 (__RPC_API * MANAGER_FUNCTION10)(
  117. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  118. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  119. REGISTER_TYPE,REGISTER_TYPE);
  120. typedef _int64 (__RPC_API * MANAGER_FUNCTION11)(
  121. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  122. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  123. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  124. typedef _int64 (__RPC_API * MANAGER_FUNCTION12)(
  125. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  126. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  127. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  128. typedef _int64 (__RPC_API * MANAGER_FUNCTION13)(
  129. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  130. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  131. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  132. REGISTER_TYPE);
  133. typedef _int64 (__RPC_API * MANAGER_FUNCTION14)(
  134. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  135. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  136. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  137. REGISTER_TYPE,REGISTER_TYPE);
  138. typedef _int64 (__RPC_API * MANAGER_FUNCTION15)(
  139. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  140. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  141. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  142. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  143. typedef _int64 (__RPC_API * MANAGER_FUNCTION16)(
  144. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  145. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  146. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  147. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  148. typedef _int64 (__RPC_API * MANAGER_FUNCTION17)(
  149. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  150. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  151. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  152. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  153. REGISTER_TYPE);
  154. typedef _int64 (__RPC_API * MANAGER_FUNCTION18)(
  155. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  156. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  157. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  158. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  159. REGISTER_TYPE,REGISTER_TYPE);
  160. typedef _int64 (__RPC_API * MANAGER_FUNCTION19)(
  161. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  162. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  163. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  164. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  165. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  166. typedef _int64 (__RPC_API * MANAGER_FUNCTION20)(
  167. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  168. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  169. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  170. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  171. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  172. typedef _int64 (__RPC_API * MANAGER_FUNCTION21)(
  173. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  174. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  175. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  176. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  177. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  178. REGISTER_TYPE);
  179. typedef _int64 (__RPC_API * MANAGER_FUNCTION22)(
  180. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  181. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  182. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  183. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  184. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  185. REGISTER_TYPE,REGISTER_TYPE);
  186. typedef _int64 (__RPC_API * MANAGER_FUNCTION23)(
  187. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  188. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  189. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  190. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  191. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  192. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  193. typedef _int64 (__RPC_API * MANAGER_FUNCTION24)(
  194. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  195. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  196. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  197. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  198. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  199. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  200. typedef _int64 (__RPC_API * MANAGER_FUNCTION25)(
  201. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  202. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  203. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  204. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  205. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  206. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  207. REGISTER_TYPE);
  208. typedef _int64 (__RPC_API * MANAGER_FUNCTION26)(
  209. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  210. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  211. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  212. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  213. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  214. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  215. REGISTER_TYPE,REGISTER_TYPE);
  216. typedef _int64 (__RPC_API * MANAGER_FUNCTION27)(
  217. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  218. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  219. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  220. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  221. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  222. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  223. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  224. typedef _int64 (__RPC_API * MANAGER_FUNCTION28)(
  225. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  226. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  227. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  228. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  229. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  230. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  231. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  232. typedef _int64 (__RPC_API * MANAGER_FUNCTION29)(
  233. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  234. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  235. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  236. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  237. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  238. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  239. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  240. REGISTER_TYPE);
  241. typedef _int64 (__RPC_API * MANAGER_FUNCTION30)(
  242. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  243. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  244. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  245. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  246. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  247. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  248. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  249. REGISTER_TYPE,REGISTER_TYPE);
  250. typedef _int64 (__RPC_API * MANAGER_FUNCTION31)(
  251. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  252. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  253. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  254. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  255. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  256. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  257. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  258. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  259. typedef _int64 (__RPC_API * MANAGER_FUNCTION32)(
  260. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  261. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  262. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  263. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  264. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  265. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  266. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,
  267. REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE,REGISTER_TYPE);
  268. #if !defined(__RPC_WIN64__)
  269. void
  270. NdrServerFree(
  271. PMIDL_STUB_MESSAGE pStubMsg,
  272. PFORMAT_STRING pFormat,
  273. void * pThis
  274. );
  275. void
  276. NdrCallServerManager (
  277. MANAGER_FUNCTION pFtn,
  278. double * pArgs,
  279. ulong NumRegisterArgs,
  280. BOOL fHasReturn
  281. );
  282. #endif // !defined(__RPC_WIN64__)
  283. void
  284. Ndr64OutInit(
  285. PMIDL_STUB_MESSAGE pStubMsg,
  286. PNDR64_FORMAT pFormat,
  287. uchar ** ppArg
  288. );
  289. #endif