RpcNdr.h 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243
  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. rpcndr.h
  5. Abstract:
  6. Definitions for stub data structures and prototypes of helper functions.
  7. --*/
  8. // This version of the rpcndr.h file corresponds to MIDL version 5.0.+
  9. // used with Windows 2000/XP build 1700+
  10. #ifndef __RPCNDR_H_VERSION__
  11. #define __RPCNDR_H_VERSION__ ( 475 )
  12. #endif // __RPCNDR_H_VERSION__
  13. #ifndef __RPCNDR_H__
  14. #define __RPCNDR_H__
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #ifdef __REQUIRED_RPCNDR_H_VERSION__
  19. #if ( __RPCNDR_H_VERSION__ < __REQUIRED_RPCNDR_H_VERSION__ )
  20. #error incorrect <rpcndr.h> version. Use the header that matches with the MIDL compiler.
  21. #endif
  22. #endif
  23. #include <pshpack8.h>
  24. #include <basetsd.h>
  25. #include <rpcnsip.h>
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /****************************************************************************
  30. Network Computing Architecture (NCA) definition:
  31. Network Data Representation: (NDR) Label format:
  32. An unsigned long (32 bits) with the following layout:
  33. 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  34. 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  35. +---------------+---------------+---------------+-------+-------+
  36. | Reserved | Reserved |Floating point | Int | Char |
  37. | | |Representation | Rep. | Rep. |
  38. +---------------+---------------+---------------+-------+-------+
  39. Where
  40. Reserved:
  41. Must be zero (0) for NCA 1.5 and NCA 2.0.
  42. Floating point Representation is:
  43. 0 - IEEE
  44. 1 - VAX
  45. 2 - Cray
  46. 3 - IBM
  47. Int Rep. is Integer Representation:
  48. 0 - Big Endian
  49. 1 - Little Endian
  50. Char Rep. is Character Representation:
  51. 0 - ASCII
  52. 1 - EBCDIC
  53. The Microsoft Local Data Representation (for all platforms which are
  54. of interest currently is edefined below:
  55. ****************************************************************************/
  56. #define NDR_CHAR_REP_MASK (unsigned long)0X0000000FL
  57. #define NDR_INT_REP_MASK (unsigned long)0X000000F0L
  58. #define NDR_FLOAT_REP_MASK (unsigned long)0X0000FF00L
  59. #define NDR_LITTLE_ENDIAN (unsigned long)0X00000010L
  60. #define NDR_BIG_ENDIAN (unsigned long)0X00000000L
  61. #define NDR_IEEE_FLOAT (unsigned long)0X00000000L
  62. #define NDR_VAX_FLOAT (unsigned long)0X00000100L
  63. #define NDR_IBM_FLOAT (unsigned long)0X00000300L
  64. #define NDR_ASCII_CHAR (unsigned long)0X00000000L
  65. #define NDR_EBCDIC_CHAR (unsigned long)0X00000001L
  66. #if defined(__RPC_MAC__)
  67. #define NDR_LOCAL_DATA_REPRESENTATION (unsigned long)0X00000000L
  68. #define NDR_LOCAL_ENDIAN NDR_BIG_ENDIAN
  69. #else
  70. #define NDR_LOCAL_DATA_REPRESENTATION (unsigned long)0X00000010L
  71. #define NDR_LOCAL_ENDIAN NDR_LITTLE_ENDIAN
  72. #endif
  73. /****************************************************************************
  74. * Macros for targeted platforms
  75. ****************************************************************************/
  76. #if (0x501 <= _WIN32_WINNT)
  77. #define TARGET_IS_NT51_OR_LATER 1
  78. #else
  79. #define TARGET_IS_NT51_OR_LATER 0
  80. #endif
  81. #if (0x500 <= _WIN32_WINNT)
  82. #define TARGET_IS_NT50_OR_LATER 1
  83. #else
  84. #define TARGET_IS_NT50_OR_LATER 0
  85. #endif
  86. #if (defined(_WIN32_DCOM) || 0x400 <= _WIN32_WINNT)
  87. #define TARGET_IS_NT40_OR_LATER 1
  88. #else
  89. #define TARGET_IS_NT40_OR_LATER 0
  90. #endif
  91. #if (0x400 <= WINVER)
  92. #define TARGET_IS_NT351_OR_WIN95_OR_LATER 1
  93. #else
  94. #define TARGET_IS_NT351_OR_WIN95_OR_LATER 0
  95. #endif
  96. /****************************************************************************
  97. * Other MIDL base types / predefined types:
  98. ****************************************************************************/
  99. #define small char
  100. typedef unsigned char byte;
  101. typedef byte cs_byte;
  102. typedef unsigned char boolean;
  103. #ifndef _HYPER_DEFINED
  104. #define _HYPER_DEFINED
  105. #if (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64))
  106. #define hyper __int64
  107. #define MIDL_uhyper unsigned __int64
  108. #else
  109. typedef double hyper;
  110. typedef double MIDL_uhyper;
  111. #endif
  112. #endif // _HYPER_DEFINED
  113. #ifndef _WCHAR_T_DEFINED
  114. typedef unsigned short wchar_t;
  115. #define _WCHAR_T_DEFINED
  116. #endif
  117. #ifndef _SIZE_T_DEFINED
  118. #ifdef __RPC_WIN64__
  119. typedef unsigned __int64 size_t;
  120. #else
  121. typedef unsigned int size_t;
  122. #endif
  123. #define _SIZE_T_DEFINED
  124. #endif
  125. #ifdef __RPC_WIN32__
  126. #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  127. #define __RPC_CALLEE __stdcall
  128. #else
  129. #define __RPC_CALLEE
  130. #endif
  131. #endif
  132. #ifndef __MIDL_USER_DEFINED
  133. #define midl_user_allocate MIDL_user_allocate
  134. #define midl_user_free MIDL_user_free
  135. #define __MIDL_USER_DEFINED
  136. #endif
  137. void * __RPC_USER MIDL_user_allocate(size_t);
  138. void __RPC_USER MIDL_user_free( void * );
  139. #define RPC_VAR_ENTRY __cdecl
  140. /* winnt only */
  141. #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
  142. #define __MIDL_DECLSPEC_DLLIMPORT __declspec(dllimport)
  143. #define __MIDL_DECLSPEC_DLLEXPORT __declspec(dllexport)
  144. #else
  145. #define __MIDL_DECLSPEC_DLLIMPORT
  146. #define __MIDL_DECLSPEC_DLLEXPORT
  147. #endif
  148. /****************************************************************************
  149. * Context handle management related definitions:
  150. *
  151. * Client and Server Contexts.
  152. *
  153. ****************************************************************************/
  154. typedef void * NDR_CCONTEXT;
  155. typedef struct
  156. {
  157. void * pad[2];
  158. void * userContext;
  159. } * NDR_SCONTEXT;
  160. #define NDRSContextValue(hContext) (&(hContext)->userContext)
  161. #define cbNDRContext 20 /* size of context on WIRE */
  162. typedef void (__RPC_USER * NDR_RUNDOWN)(void * context);
  163. typedef void (__RPC_USER * NDR_NOTIFY_ROUTINE)(void);
  164. typedef void (__RPC_USER * NDR_NOTIFY2_ROUTINE)(boolean flag);
  165. typedef struct _SCONTEXT_QUEUE {
  166. unsigned long NumberOfObjects;
  167. NDR_SCONTEXT * ArrayOfObjects;
  168. } SCONTEXT_QUEUE, * PSCONTEXT_QUEUE;
  169. RPCRTAPI
  170. RPC_BINDING_HANDLE
  171. RPC_ENTRY
  172. NDRCContextBinding (
  173. IN NDR_CCONTEXT CContext
  174. );
  175. RPCRTAPI
  176. void
  177. RPC_ENTRY
  178. NDRCContextMarshall (
  179. IN NDR_CCONTEXT CContext,
  180. OUT void *pBuff
  181. );
  182. RPCRTAPI
  183. void
  184. RPC_ENTRY
  185. NDRCContextUnmarshall (
  186. OUT NDR_CCONTEXT * pCContext,
  187. IN RPC_BINDING_HANDLE hBinding,
  188. IN void * pBuff,
  189. IN unsigned long DataRepresentation
  190. );
  191. RPCRTAPI
  192. void
  193. RPC_ENTRY
  194. NDRSContextMarshall (
  195. IN NDR_SCONTEXT CContext,
  196. OUT void * pBuff,
  197. IN NDR_RUNDOWN userRunDownIn
  198. );
  199. RPCRTAPI
  200. NDR_SCONTEXT
  201. RPC_ENTRY
  202. NDRSContextUnmarshall (
  203. IN void * pBuff,
  204. IN unsigned long DataRepresentation
  205. );
  206. RPCRTAPI
  207. void
  208. RPC_ENTRY
  209. NDRSContextMarshallEx (
  210. IN RPC_BINDING_HANDLE BindingHandle,
  211. IN NDR_SCONTEXT CContext,
  212. OUT void * pBuff,
  213. IN NDR_RUNDOWN userRunDownIn
  214. );
  215. RPCRTAPI
  216. void
  217. RPC_ENTRY
  218. NDRSContextMarshall2 (
  219. IN RPC_BINDING_HANDLE BindingHandle,
  220. IN NDR_SCONTEXT CContext,
  221. OUT void * pBuff,
  222. IN NDR_RUNDOWN userRunDownIn,
  223. IN void * CtxGuard,
  224. IN unsigned long Flags
  225. );
  226. RPCRTAPI
  227. NDR_SCONTEXT
  228. RPC_ENTRY
  229. NDRSContextUnmarshallEx (
  230. IN RPC_BINDING_HANDLE BindingHandle,
  231. IN void * pBuff,
  232. IN unsigned long DataRepresentation
  233. );
  234. RPCRTAPI
  235. NDR_SCONTEXT
  236. RPC_ENTRY
  237. NDRSContextUnmarshall2(
  238. IN RPC_BINDING_HANDLE BindingHandle,
  239. IN void * pBuff,
  240. IN unsigned long DataRepresentation,
  241. IN void * CtxGuard,
  242. IN unsigned long Flags
  243. );
  244. RPCRTAPI
  245. void
  246. RPC_ENTRY
  247. RpcSsDestroyClientContext (
  248. IN void * * ContextHandle
  249. );
  250. /****************************************************************************
  251. NDR conversion related definitions.
  252. ****************************************************************************/
  253. #define byte_from_ndr(source, target) \
  254. { \
  255. *(target) = *(*(char * *)&(source)->Buffer)++; \
  256. }
  257. #define byte_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  258. { \
  259. NDRcopy ( \
  260. (((char *)(Target))+(LowerIndex)), \
  261. (Source)->Buffer, \
  262. (unsigned int)((UpperIndex)-(LowerIndex))); \
  263. *(unsigned long *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  264. }
  265. #define boolean_from_ndr(source, target) \
  266. { \
  267. *(target) = *(*(char * *)&(source)->Buffer)++; \
  268. }
  269. #define boolean_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  270. { \
  271. NDRcopy ( \
  272. (((char *)(Target))+(LowerIndex)), \
  273. (Source)->Buffer, \
  274. (unsigned int)((UpperIndex)-(LowerIndex))); \
  275. *(unsigned long *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  276. }
  277. #define small_from_ndr(source, target) \
  278. { \
  279. *(target) = *(*(char * *)&(source)->Buffer)++; \
  280. }
  281. #define small_from_ndr_temp(source, target, format) \
  282. { \
  283. *(target) = *(*(char * *)(source))++; \
  284. }
  285. #define small_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  286. { \
  287. NDRcopy ( \
  288. (((char *)(Target))+(LowerIndex)), \
  289. (Source)->Buffer, \
  290. (unsigned int)((UpperIndex)-(LowerIndex))); \
  291. *(unsigned long *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  292. }
  293. /****************************************************************************
  294. Platform specific mapping of c-runtime functions.
  295. ****************************************************************************/
  296. #if defined(__RPC_WIN32__) || defined(__RPC_WIN64__)
  297. #define MIDL_ascii_strlen(string) \
  298. strlen(string)
  299. #define MIDL_ascii_strcpy(target,source) \
  300. strcpy(target,source)
  301. #define MIDL_memset(s,c,n) \
  302. memset(s,c,n)
  303. #endif
  304. /****************************************************************************
  305. MIDL 2.0 ndr definitions.
  306. ****************************************************************************/
  307. typedef unsigned long error_status_t;
  308. #define _midl_ma1( p, cast ) *(*( cast **)&p)++
  309. #define _midl_ma2( p, cast ) *(*( cast **)&p)++
  310. #define _midl_ma4( p, cast ) *(*( cast **)&p)++
  311. #define _midl_ma8( p, cast ) *(*( cast **)&p)++
  312. #define _midl_unma1( p, cast ) *(( cast *)p)++
  313. #define _midl_unma2( p, cast ) *(( cast *)p)++
  314. #define _midl_unma3( p, cast ) *(( cast *)p)++
  315. #define _midl_unma4( p, cast ) *(( cast *)p)++
  316. // Some alignment specific macros.
  317. // RKK64
  318. // these appear to be used in fossils inside MIDL
  319. #define _midl_fa2( p ) (p = (RPC_BUFPTR )((ULONG_PTR)(p+1) & ~0x1))
  320. #define _midl_fa4( p ) (p = (RPC_BUFPTR )((ULONG_PTR)(p+3) & ~0x3))
  321. #define _midl_fa8( p ) (p = (RPC_BUFPTR )((ULONG_PTR)(p+7) & ~0x7))
  322. #define _midl_addp( p, n ) (p += n)
  323. // Marshalling macros
  324. #define _midl_marsh_lhs( p, cast ) *(*( cast **)&p)++
  325. #define _midl_marsh_up( mp, p ) *(*(unsigned long **)&mp)++ = (unsigned long)p
  326. #define _midl_advmp( mp ) *(*(unsigned long **)&mp)++
  327. #define _midl_unmarsh_up( p ) (*(*(unsigned long **)&p)++)
  328. ////////////////////////////////////////////////////////////////////////////
  329. // Ndr macros.
  330. ////////////////////////////////////////////////////////////////////////////
  331. // RKK64
  332. // these appear to be used in fossils inside MIDL
  333. #define NdrMarshConfStringHdr( p, s, l ) (_midl_ma4( p, unsigned long) = s, \
  334. _midl_ma4( p, unsigned long) = 0, \
  335. _midl_ma4( p, unsigned long) = l)
  336. #define NdrUnMarshConfStringHdr(p, s, l) ((s=_midl_unma4(p,unsigned long),\
  337. (_midl_addp(p,4)), \
  338. (l=_midl_unma4(p,unsigned long))
  339. #define NdrMarshCCtxtHdl(pc,p) (NDRCContextMarshall( (NDR_CCONTEXT)pc, p ),p+20)
  340. #define NdrUnMarshCCtxtHdl(pc,p,h,drep) \
  341. (NDRCContextUnmarshall((NDR_CONTEXT)pc,h,p,drep), p+20)
  342. #define NdrUnMarshSCtxtHdl(pc, p,drep) (pc = NdrSContextUnMarshall(p,drep ))
  343. #define NdrMarshSCtxtHdl(pc,p,rd) (NdrSContextMarshall((NDR_SCONTEXT)pc,p, (NDR_RUNDOWN)rd)
  344. // end of unused
  345. #define NdrFieldOffset(s,f) (LONG_PTR)(& (((s *)0)->f))
  346. #define NdrFieldPad(s,f,p,t) ((unsigned long)(NdrFieldOffset(s,f) - NdrFieldOffset(s,p)) - sizeof(t))
  347. #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
  348. #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
  349. (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
  350. //
  351. // On the server side, the following exceptions are mapped to
  352. // the bad stub data exception if -error stub_data is used.
  353. //
  354. #define RPC_BAD_STUB_DATA_EXCEPTION_FILTER \
  355. ( (RpcExceptionCode() == STATUS_ACCESS_VIOLATION) || \
  356. (RpcExceptionCode() == STATUS_DATATYPE_MISALIGNMENT) || \
  357. (RpcExceptionCode() == RPC_X_BAD_STUB_DATA) || \
  358. (RpcExceptionCode() == RPC_S_INVALID_BOUND) )
  359. /////////////////////////////////////////////////////////////////////////////
  360. // Some stub helper functions.
  361. /////////////////////////////////////////////////////////////////////////////
  362. ////////////////////////////////////////////////////////////////////////////
  363. // Stub helper structures.
  364. ////////////////////////////////////////////////////////////////////////////
  365. struct _MIDL_STUB_MESSAGE;
  366. struct _MIDL_STUB_DESC;
  367. struct _FULL_PTR_XLAT_TABLES;
  368. typedef unsigned char * RPC_BUFPTR;
  369. typedef unsigned long RPC_LENGTH;
  370. // Expression evaluation callback routine prototype.
  371. typedef void (__RPC_USER * EXPR_EVAL)( struct _MIDL_STUB_MESSAGE * );
  372. typedef const unsigned char * PFORMAT_STRING;
  373. /*
  374. * Multidimensional conformant/varying array struct.
  375. */
  376. typedef struct
  377. {
  378. long Dimension;
  379. /* These fields MUST be (unsigned long *) */
  380. unsigned long * BufferConformanceMark;
  381. unsigned long * BufferVarianceMark;
  382. /* Count arrays, used for top level arrays in -Os stubs */
  383. unsigned long * MaxCountArray;
  384. unsigned long * OffsetArray;
  385. unsigned long * ActualCountArray;
  386. } ARRAY_INFO, *PARRAY_INFO;
  387. typedef struct _NDR_ASYNC_MESSAGE * PNDR_ASYNC_MESSAGE;
  388. typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO;
  389. /*
  390. * cs_char info in the stub message
  391. */
  392. typedef struct
  393. {
  394. unsigned long WireCodeset;
  395. unsigned long DesiredReceivingCodeset;
  396. void *CSArrayInfo;
  397. } CS_STUB_INFO;
  398. /*
  399. * MIDL Stub Message
  400. */
  401. typedef const unsigned char * PFORMAT_STRING;
  402. typedef struct _MIDL_SYNTAX_INFO MIDL_SYNTAX_INFO, *PMIDL_SYNTAX_INFO;
  403. struct NDR_ALLOC_ALL_NODES_CONTEXT;
  404. struct NDR_POINTER_QUEUE_STATE;
  405. struct _NDR_PROC_CONTEXT;
  406. typedef struct _MIDL_STUB_MESSAGE
  407. {
  408. /* RPC message structure. */
  409. PRPC_MESSAGE RpcMsg;
  410. /* Pointer into RPC message buffer. */
  411. unsigned char * Buffer;
  412. /*
  413. * These are used internally by the Ndr routines to mark the beginning
  414. * and end of an incoming RPC buffer.
  415. */
  416. unsigned char * BufferStart;
  417. unsigned char * BufferEnd;
  418. /*
  419. * Used internally by the Ndr routines as a place holder in the buffer.
  420. * On the marshalling side it's used to mark the location where conformance
  421. * size should be marshalled.
  422. * On the unmarshalling side it's used to mark the location in the buffer
  423. * used during pointer unmarshalling to base pointer offsets off of.
  424. */
  425. unsigned char * BufferMark;
  426. /* Set by the buffer sizing routines. */
  427. unsigned long BufferLength;
  428. /* Set by the memory sizing routines. */
  429. unsigned long MemorySize;
  430. /* Pointer to user memory. */
  431. unsigned char * Memory;
  432. /* Is the Ndr routine begin called from a client side stub. */
  433. int IsClient;
  434. /* Can the buffer be re-used for memory on unmarshalling. */
  435. int ReuseBuffer;
  436. /* Hold the context for allocate all nodes */
  437. struct NDR_ALLOC_ALL_NODES_CONTEXT *pAllocAllNodesContext;
  438. struct NDR_POINTER_QUEUE_STATE *pPointerQueueState;
  439. /*
  440. * Stuff needed while handling complex structures
  441. */
  442. /* Ignore imbeded pointers while computing buffer or memory sizes. */
  443. int IgnoreEmbeddedPointers;
  444. /*
  445. * This marks the location in the buffer where pointees of a complex
  446. * struct reside.
  447. */
  448. unsigned char * PointerBufferMark;
  449. /*
  450. * Used to catch errors in SendReceive.
  451. */
  452. unsigned char fBufferValid;
  453. unsigned char uFlags;
  454. unsigned short Unused2;
  455. /*
  456. * Used internally by the Ndr routines. Holds the max counts for
  457. * a conformant array.
  458. */
  459. ULONG_PTR MaxCount;
  460. /*
  461. * Used internally by the Ndr routines. Holds the offsets for a varying
  462. * array.
  463. */
  464. unsigned long Offset;
  465. /*
  466. * Used internally by the Ndr routines. Holds the actual counts for
  467. * a varying array.
  468. */
  469. unsigned long ActualCount;
  470. /* Allocation and Free routine to be used by the Ndr routines. */
  471. void * ( __RPC_API * pfnAllocate)(size_t);
  472. void ( __RPC_API * pfnFree)(void *);
  473. /*
  474. * Top of parameter stack. Used for "single call" stubs during marshalling
  475. * to hold the beginning of the parameter list on the stack. Needed to
  476. * extract parameters which hold attribute values for top level arrays and
  477. * pointers.
  478. */
  479. unsigned char * StackTop;
  480. /*
  481. * Fields used for the transmit_as and represent_as objects.
  482. * For represent_as the mapping is: presented=local, transmit=named.
  483. */
  484. unsigned char * pPresentedType;
  485. unsigned char * pTransmitType;
  486. /*
  487. * When we first construct a binding on the client side, stick it
  488. * in the rpcmessage and later call RpcGetBuffer, the handle field
  489. * in the rpcmessage is changed. That's fine except that we need to
  490. * have that original handle for use in unmarshalling context handles
  491. * (the second argument in NDRCContextUnmarshall to be exact). So
  492. * stash the contructed handle here and extract it when needed.
  493. */
  494. handle_t SavedHandle;
  495. /*
  496. * Pointer back to the stub descriptor. Use this to get all handle info.
  497. */
  498. const struct _MIDL_STUB_DESC * StubDesc;
  499. /*
  500. * Full pointer stuff.
  501. */
  502. struct _FULL_PTR_XLAT_TABLES * FullPtrXlatTables;
  503. unsigned long FullPtrRefId;
  504. unsigned long PointerLength;
  505. int fInDontFree :1;
  506. int fDontCallFreeInst :1;
  507. int fInOnlyParam :1;
  508. int fHasReturn :1;
  509. int fHasExtensions :1;
  510. int fHasNewCorrDesc :1;
  511. int fIsOicfServer :1;
  512. int fUnused :9;
  513. int fUnused2 :16;
  514. unsigned long dwDestContext;
  515. void * pvDestContext;
  516. NDR_SCONTEXT * SavedContextHandles;
  517. long ParamNumber;
  518. struct IRpcChannelBuffer * pRpcChannelBuffer;
  519. PARRAY_INFO pArrayInfo;
  520. unsigned long * SizePtrCountArray;
  521. unsigned long * SizePtrOffsetArray;
  522. unsigned long * SizePtrLengthArray;
  523. /*
  524. * Interpreter argument queue. Used on server side only.
  525. */
  526. void * pArgQueue;
  527. unsigned long dwStubPhase;
  528. void * LowStackMark;
  529. /*
  530. * Async message pointer, correlation data - NT 5.0 features.
  531. */
  532. PNDR_ASYNC_MESSAGE pAsyncMsg;
  533. PNDR_CORRELATION_INFO pCorrInfo;
  534. unsigned char * pCorrMemory;
  535. void * pMemoryList;
  536. /*
  537. * Reserved fields up to this point present since the 3.50 release.
  538. * Reserved fields below were introduced for Windows 2000 release.
  539. * (but not used).
  540. */
  541. /*
  542. * International character support information - NT 5.1 feature.
  543. */
  544. CS_STUB_INFO * pCSInfo;
  545. unsigned char * ConformanceMark;
  546. unsigned char * VarianceMark;
  547. #if defined(IA64)
  548. void * BackingStoreLowMark;
  549. #else
  550. INT_PTR Unused;
  551. #endif
  552. struct _NDR_PROC_CONTEXT * pContext;
  553. /*
  554. * Reserved fields up to this point present since Windows 2000 release.
  555. * Fields added for NT5.1
  556. */
  557. void * pUserMarshalList;
  558. INT_PTR Reserved51_2;
  559. INT_PTR Reserved51_3;
  560. INT_PTR Reserved51_4;
  561. INT_PTR Reserved51_5;
  562. /*
  563. * Reserved fields up to this point present since NT5.1 release.
  564. */
  565. } MIDL_STUB_MESSAGE, *PMIDL_STUB_MESSAGE;
  566. typedef struct _MIDL_STUB_MESSAGE MIDL_STUB_MESSAGE, *PMIDL_STUB_MESSAGE;
  567. /*
  568. * Generic handle bind/unbind routine pair.
  569. */
  570. typedef void *
  571. ( __RPC_API * GENERIC_BINDING_ROUTINE)
  572. (void *);
  573. typedef void
  574. ( __RPC_API * GENERIC_UNBIND_ROUTINE)
  575. (void *, unsigned char *);
  576. typedef struct _GENERIC_BINDING_ROUTINE_PAIR
  577. {
  578. GENERIC_BINDING_ROUTINE pfnBind;
  579. GENERIC_UNBIND_ROUTINE pfnUnbind;
  580. } GENERIC_BINDING_ROUTINE_PAIR, *PGENERIC_BINDING_ROUTINE_PAIR;
  581. typedef struct __GENERIC_BINDING_INFO
  582. {
  583. void * pObj;
  584. unsigned int Size;
  585. GENERIC_BINDING_ROUTINE pfnBind;
  586. GENERIC_UNBIND_ROUTINE pfnUnbind;
  587. } GENERIC_BINDING_INFO, *PGENERIC_BINDING_INFO;
  588. // typedef EXPR_EVAL - see above
  589. // typedefs for xmit_as
  590. #if (defined(_MSC_VER)) && !defined(MIDL_PASS)
  591. // a Microsoft C++ compiler
  592. #define NDR_SHAREABLE __inline
  593. #else
  594. #define NDR_SHAREABLE static
  595. #endif
  596. typedef void ( __RPC_USER * XMIT_HELPER_ROUTINE)
  597. ( PMIDL_STUB_MESSAGE );
  598. typedef struct _XMIT_ROUTINE_QUINTUPLE
  599. {
  600. XMIT_HELPER_ROUTINE pfnTranslateToXmit;
  601. XMIT_HELPER_ROUTINE pfnTranslateFromXmit;
  602. XMIT_HELPER_ROUTINE pfnFreeXmit;
  603. XMIT_HELPER_ROUTINE pfnFreeInst;
  604. } XMIT_ROUTINE_QUINTUPLE, *PXMIT_ROUTINE_QUINTUPLE;
  605. typedef unsigned long
  606. ( __RPC_USER * USER_MARSHAL_SIZING_ROUTINE)
  607. (unsigned long *,
  608. unsigned long,
  609. void * );
  610. typedef unsigned char *
  611. ( __RPC_USER * USER_MARSHAL_MARSHALLING_ROUTINE)
  612. (unsigned long *,
  613. unsigned char * ,
  614. void * );
  615. typedef unsigned char *
  616. ( __RPC_USER * USER_MARSHAL_UNMARSHALLING_ROUTINE)
  617. (unsigned long *,
  618. unsigned char *,
  619. void * );
  620. typedef void ( __RPC_USER * USER_MARSHAL_FREEING_ROUTINE)
  621. (unsigned long *,
  622. void * );
  623. typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
  624. {
  625. USER_MARSHAL_SIZING_ROUTINE pfnBufferSize;
  626. USER_MARSHAL_MARSHALLING_ROUTINE pfnMarshall;
  627. USER_MARSHAL_UNMARSHALLING_ROUTINE pfnUnmarshall;
  628. USER_MARSHAL_FREEING_ROUTINE pfnFree;
  629. } USER_MARSHAL_ROUTINE_QUADRUPLE;
  630. #define USER_MARSHAL_CB_SIGNATURE 'USRC'
  631. typedef enum _USER_MARSHAL_CB_TYPE
  632. {
  633. USER_MARSHAL_CB_BUFFER_SIZE,
  634. USER_MARSHAL_CB_MARSHALL,
  635. USER_MARSHAL_CB_UNMARSHALL,
  636. USER_MARSHAL_CB_FREE
  637. } USER_MARSHAL_CB_TYPE;
  638. typedef struct _USER_MARSHAL_CB
  639. {
  640. unsigned long Flags;
  641. PMIDL_STUB_MESSAGE pStubMsg;
  642. PFORMAT_STRING pReserve;
  643. unsigned long Signature;
  644. USER_MARSHAL_CB_TYPE CBType;
  645. PFORMAT_STRING pFormat;
  646. PFORMAT_STRING pTypeFormat;
  647. } USER_MARSHAL_CB;
  648. #define USER_CALL_CTXT_MASK(f) ((f) & 0x00ff)
  649. #define USER_CALL_AUX_MASK(f) ((f) & 0xff00)
  650. #define GET_USER_DATA_REP(f) ((f) >> 16)
  651. #define USER_CALL_IS_ASYNC 0x0100 /* aux flag: in an [async] call */
  652. #define USER_CALL_NEW_CORRELATION_DESC 0x0200
  653. typedef struct _MALLOC_FREE_STRUCT
  654. {
  655. void * ( __RPC_USER * pfnAllocate)(size_t);
  656. void ( __RPC_USER * pfnFree)(void *);
  657. } MALLOC_FREE_STRUCT;
  658. typedef struct _COMM_FAULT_OFFSETS
  659. {
  660. short CommOffset;
  661. short FaultOffset;
  662. } COMM_FAULT_OFFSETS;
  663. /*
  664. * International character support definitions
  665. */
  666. typedef enum _IDL_CS_CONVERT
  667. {
  668. IDL_CS_NO_CONVERT,
  669. IDL_CS_IN_PLACE_CONVERT,
  670. IDL_CS_NEW_BUFFER_CONVERT
  671. } IDL_CS_CONVERT;
  672. typedef void
  673. ( __RPC_USER * CS_TYPE_NET_SIZE_ROUTINE)
  674. (RPC_BINDING_HANDLE hBinding,
  675. unsigned long ulNetworkCodeSet,
  676. unsigned long ulLocalBufferSize,
  677. IDL_CS_CONVERT * conversionType,
  678. unsigned long * pulNetworkBufferSize,
  679. error_status_t * pStatus);
  680. typedef void
  681. ( __RPC_USER * CS_TYPE_LOCAL_SIZE_ROUTINE)
  682. (RPC_BINDING_HANDLE hBinding,
  683. unsigned long ulNetworkCodeSet,
  684. unsigned long ulNetworkBufferSize,
  685. IDL_CS_CONVERT * conversionType,
  686. unsigned long * pulLocalBufferSize,
  687. error_status_t * pStatus);
  688. typedef void
  689. ( __RPC_USER * CS_TYPE_TO_NETCS_ROUTINE)
  690. (RPC_BINDING_HANDLE hBinding,
  691. unsigned long ulNetworkCodeSet,
  692. void * pLocalData,
  693. unsigned long ulLocalDataLength,
  694. byte * pNetworkData,
  695. unsigned long * pulNetworkDataLength,
  696. error_status_t * pStatus);
  697. typedef void
  698. ( __RPC_USER * CS_TYPE_FROM_NETCS_ROUTINE)
  699. (RPC_BINDING_HANDLE hBinding,
  700. unsigned long ulNetworkCodeSet,
  701. byte * pNetworkData,
  702. unsigned long ulNetworkDataLength,
  703. unsigned long ulLocalBufferSize,
  704. void * pLocalData,
  705. unsigned long * pulLocalDataLength,
  706. error_status_t * pStatus);
  707. typedef void
  708. ( __RPC_USER * CS_TAG_GETTING_ROUTINE)
  709. (RPC_BINDING_HANDLE hBinding,
  710. int fServerSide,
  711. unsigned long * pulSendingTag,
  712. unsigned long * pulDesiredReceivingTag,
  713. unsigned long * pulReceivingTag,
  714. error_status_t * pStatus);
  715. void __RPC_USER
  716. RpcCsGetTags(
  717. RPC_BINDING_HANDLE hBinding,
  718. int fServerSide,
  719. unsigned long * pulSendingTag,
  720. unsigned long * pulDesiredReceivingTag,
  721. unsigned long * pulReceivingTag,
  722. error_status_t * pStatus);
  723. typedef struct _NDR_CS_SIZE_CONVERT_ROUTINES
  724. {
  725. CS_TYPE_NET_SIZE_ROUTINE pfnNetSize;
  726. CS_TYPE_TO_NETCS_ROUTINE pfnToNetCs;
  727. CS_TYPE_LOCAL_SIZE_ROUTINE pfnLocalSize;
  728. CS_TYPE_FROM_NETCS_ROUTINE pfnFromNetCs;
  729. } NDR_CS_SIZE_CONVERT_ROUTINES;
  730. typedef struct _NDR_CS_ROUTINES
  731. {
  732. NDR_CS_SIZE_CONVERT_ROUTINES *pSizeConvertRoutines;
  733. CS_TAG_GETTING_ROUTINE *pTagGettingRoutines;
  734. } NDR_CS_ROUTINES;
  735. /*
  736. * MIDL Stub Descriptor
  737. */
  738. typedef struct _MIDL_STUB_DESC
  739. {
  740. void * RpcInterfaceInformation;
  741. void * ( __RPC_API * pfnAllocate)(size_t);
  742. void ( __RPC_API * pfnFree)(void *);
  743. union
  744. {
  745. handle_t * pAutoHandle;
  746. handle_t * pPrimitiveHandle;
  747. PGENERIC_BINDING_INFO pGenericBindingInfo;
  748. } IMPLICIT_HANDLE_INFO;
  749. const NDR_RUNDOWN * apfnNdrRundownRoutines;
  750. const GENERIC_BINDING_ROUTINE_PAIR * aGenericBindingRoutinePairs;
  751. const EXPR_EVAL * apfnExprEval;
  752. const XMIT_ROUTINE_QUINTUPLE * aXmitQuintuple;
  753. const unsigned char * pFormatTypes;
  754. int fCheckBounds;
  755. /* Ndr library version. */
  756. unsigned long Version;
  757. MALLOC_FREE_STRUCT * pMallocFreeStruct;
  758. long MIDLVersion;
  759. const COMM_FAULT_OFFSETS * CommFaultOffsets;
  760. // New fields for version 3.0+
  761. const USER_MARSHAL_ROUTINE_QUADRUPLE * aUserMarshalQuadruple;
  762. // Notify routines - added for NT5, MIDL 5.0
  763. const NDR_NOTIFY_ROUTINE * NotifyRoutineTable;
  764. /*
  765. * Reserved for future use.
  766. */
  767. ULONG_PTR mFlags;
  768. // International support routines - added for 64bit post NT5
  769. const NDR_CS_ROUTINES * CsRoutineTables;
  770. void * Reserved4;
  771. ULONG_PTR Reserved5;
  772. // Fields up to now present in win2000 release.
  773. } MIDL_STUB_DESC;
  774. typedef const MIDL_STUB_DESC * PMIDL_STUB_DESC;
  775. typedef void * PMIDL_XMIT_TYPE;
  776. /*
  777. * MIDL Stub Format String. This is a const in the stub.
  778. */
  779. #if !defined( RC_INVOKED )
  780. #if _MSC_VER >= 1200
  781. #pragma warning(push)
  782. #endif
  783. #pragma warning( disable:4200 )
  784. #endif
  785. typedef struct _MIDL_FORMAT_STRING
  786. {
  787. short Pad;
  788. unsigned char Format[];
  789. } MIDL_FORMAT_STRING;
  790. #if !defined( RC_INVOKED )
  791. #if _MSC_VER >= 1200
  792. #pragma warning(pop)
  793. #else
  794. #pragma warning( default:4200 )
  795. #endif
  796. #endif
  797. /*
  798. * Stub thunk used for some interpreted server stubs.
  799. */
  800. typedef void ( __RPC_API * STUB_THUNK)( PMIDL_STUB_MESSAGE );
  801. typedef long ( __RPC_API * SERVER_ROUTINE)();
  802. /*
  803. * Server Interpreter's information strucuture.
  804. */
  805. typedef struct _MIDL_SERVER_INFO_
  806. {
  807. PMIDL_STUB_DESC pStubDesc;
  808. const SERVER_ROUTINE * DispatchTable;
  809. PFORMAT_STRING ProcString;
  810. const unsigned short * FmtStringOffset;
  811. const STUB_THUNK * ThunkTable;
  812. PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
  813. ULONG_PTR nCount;
  814. PMIDL_SYNTAX_INFO pSyntaxInfo;
  815. } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO;
  816. #undef _MIDL_STUBLESS_PROXY_INFO
  817. /*
  818. * Stubless object proxy information structure.
  819. */
  820. typedef struct _MIDL_STUBLESS_PROXY_INFO
  821. {
  822. PMIDL_STUB_DESC pStubDesc;
  823. PFORMAT_STRING ProcFormatString;
  824. const unsigned short * FormatStringOffset;
  825. PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
  826. ULONG_PTR nCount;
  827. PMIDL_SYNTAX_INFO pSyntaxInfo;
  828. } MIDL_STUBLESS_PROXY_INFO;
  829. typedef MIDL_STUBLESS_PROXY_INFO * PMIDL_STUBLESS_PROXY_INFO;
  830. /*
  831. * Multiple transfer syntax information.
  832. */
  833. typedef struct _MIDL_SYNTAX_INFO
  834. {
  835. RPC_SYNTAX_IDENTIFIER TransferSyntax;
  836. RPC_DISPATCH_TABLE * DispatchTable;
  837. PFORMAT_STRING ProcString;
  838. const unsigned short * FmtStringOffset;
  839. PFORMAT_STRING TypeString;
  840. const void * aUserMarshalQuadruple;
  841. ULONG_PTR pReserved1;
  842. ULONG_PTR pReserved2;
  843. } MIDL_SYNTAX_INFO, *PMIDL_SYNTAX_INFO;
  844. typedef unsigned short * PARAM_OFFSETTABLE, *PPARAM_OFFSETTABLE;
  845. /*
  846. * This is the return value from NdrClientCall.
  847. */
  848. typedef union _CLIENT_CALL_RETURN
  849. {
  850. void * Pointer;
  851. LONG_PTR Simple;
  852. } CLIENT_CALL_RETURN;
  853. /*
  854. * Full pointer data structures.
  855. */
  856. typedef enum
  857. {
  858. XLAT_SERVER = 1,
  859. XLAT_CLIENT
  860. } XLAT_SIDE;
  861. /*
  862. * Stores the translation for the conversion from a full pointer into it's
  863. * corresponding ref id.
  864. */
  865. typedef struct _FULL_PTR_TO_REFID_ELEMENT
  866. {
  867. struct _FULL_PTR_TO_REFID_ELEMENT * Next;
  868. void * Pointer;
  869. unsigned long RefId;
  870. unsigned char State;
  871. } FULL_PTR_TO_REFID_ELEMENT, *PFULL_PTR_TO_REFID_ELEMENT;
  872. /*
  873. * Full pointer translation tables.
  874. */
  875. typedef struct _FULL_PTR_XLAT_TABLES
  876. {
  877. /*
  878. * Ref id to pointer translation information.
  879. */
  880. struct
  881. {
  882. void * * XlatTable;
  883. unsigned char * StateTable;
  884. unsigned long NumberOfEntries;
  885. } RefIdToPointer;
  886. /*
  887. * Pointer to ref id translation information.
  888. */
  889. struct
  890. {
  891. PFULL_PTR_TO_REFID_ELEMENT * XlatTable;
  892. unsigned long NumberOfBuckets;
  893. unsigned long HashMask;
  894. } PointerToRefId;
  895. /*
  896. * Next ref id to use.
  897. */
  898. unsigned long NextRefId;
  899. /*
  900. * Keep track of the translation size we're handling : server or client.
  901. * This tells us when we have to do reverse translations when we insert
  902. * new translations. On the server we must insert a pointer-to-refid
  903. * translation whenever we insert a refid-to-pointer translation, and
  904. * vica versa for the client.
  905. */
  906. XLAT_SIDE XlatSide;
  907. } FULL_PTR_XLAT_TABLES, *PFULL_PTR_XLAT_TABLES;
  908. /***************************************************************************
  909. ** New MIDL 2.0 Ndr routine templates
  910. ***************************************************************************/
  911. RPC_STATUS RPC_ENTRY
  912. NdrClientGetSupportedSyntaxes(
  913. IN RPC_CLIENT_INTERFACE * pInf,
  914. OUT unsigned long * pCount,
  915. OUT MIDL_SYNTAX_INFO ** pArr );
  916. RPC_STATUS RPC_ENTRY
  917. NdrServerGetSupportedSyntaxes(
  918. IN RPC_SERVER_INTERFACE * pInf,
  919. OUT unsigned long * pCount,
  920. OUT MIDL_SYNTAX_INFO ** pArr,
  921. OUT unsigned long * pPreferSyntaxIndex);
  922. /*
  923. * Marshall routines
  924. */
  925. RPCRTAPI
  926. void
  927. RPC_ENTRY
  928. NdrSimpleTypeMarshall(
  929. PMIDL_STUB_MESSAGE pStubMsg,
  930. unsigned char * pMemory,
  931. unsigned char FormatChar
  932. );
  933. RPCRTAPI
  934. unsigned char *
  935. RPC_ENTRY
  936. NdrPointerMarshall(
  937. PMIDL_STUB_MESSAGE pStubMsg,
  938. unsigned char * pMemory,
  939. PFORMAT_STRING pFormat
  940. );
  941. RPCRTAPI
  942. unsigned char *
  943. RPC_ENTRY
  944. NdrCsArrayMarshall(
  945. PMIDL_STUB_MESSAGE pStubMsg,
  946. unsigned char * pMemory,
  947. PFORMAT_STRING pFormat
  948. );
  949. RPCRTAPI
  950. unsigned char *
  951. RPC_ENTRY
  952. NdrCsTagMarshall(
  953. PMIDL_STUB_MESSAGE pStubMsg,
  954. unsigned char * pMemory,
  955. PFORMAT_STRING pFormat
  956. );
  957. /* Structures */
  958. RPCRTAPI
  959. unsigned char *
  960. RPC_ENTRY
  961. NdrSimpleStructMarshall(
  962. PMIDL_STUB_MESSAGE pStubMsg,
  963. unsigned char * pMemory,
  964. PFORMAT_STRING pFormat
  965. );
  966. RPCRTAPI
  967. unsigned char *
  968. RPC_ENTRY
  969. NdrConformantStructMarshall(
  970. PMIDL_STUB_MESSAGE pStubMsg,
  971. unsigned char * pMemory,
  972. PFORMAT_STRING pFormat
  973. );
  974. RPCRTAPI
  975. unsigned char *
  976. RPC_ENTRY
  977. NdrConformantVaryingStructMarshall(
  978. PMIDL_STUB_MESSAGE pStubMsg,
  979. unsigned char * pMemory,
  980. PFORMAT_STRING pFormat
  981. );
  982. RPCRTAPI
  983. unsigned char *
  984. RPC_ENTRY
  985. NdrComplexStructMarshall(
  986. PMIDL_STUB_MESSAGE pStubMsg,
  987. unsigned char * pMemory,
  988. PFORMAT_STRING pFormat
  989. );
  990. /* Arrays */
  991. RPCRTAPI
  992. unsigned char *
  993. RPC_ENTRY
  994. NdrFixedArrayMarshall(
  995. PMIDL_STUB_MESSAGE pStubMsg,
  996. unsigned char * pMemory,
  997. PFORMAT_STRING pFormat
  998. );
  999. RPCRTAPI
  1000. unsigned char *
  1001. RPC_ENTRY
  1002. NdrConformantArrayMarshall(
  1003. PMIDL_STUB_MESSAGE pStubMsg,
  1004. unsigned char * pMemory,
  1005. PFORMAT_STRING pFormat
  1006. );
  1007. RPCRTAPI
  1008. unsigned char *
  1009. RPC_ENTRY
  1010. NdrConformantVaryingArrayMarshall(
  1011. PMIDL_STUB_MESSAGE pStubMsg,
  1012. unsigned char * pMemory,
  1013. PFORMAT_STRING pFormat
  1014. );
  1015. RPCRTAPI
  1016. unsigned char *
  1017. RPC_ENTRY
  1018. NdrVaryingArrayMarshall(
  1019. PMIDL_STUB_MESSAGE pStubMsg,
  1020. unsigned char * pMemory,
  1021. PFORMAT_STRING pFormat
  1022. );
  1023. RPCRTAPI
  1024. unsigned char *
  1025. RPC_ENTRY
  1026. NdrComplexArrayMarshall(
  1027. PMIDL_STUB_MESSAGE pStubMsg,
  1028. unsigned char * pMemory,
  1029. PFORMAT_STRING pFormat
  1030. );
  1031. /* Strings */
  1032. RPCRTAPI
  1033. unsigned char *
  1034. RPC_ENTRY
  1035. NdrNonConformantStringMarshall(
  1036. PMIDL_STUB_MESSAGE pStubMsg,
  1037. unsigned char * pMemory,
  1038. PFORMAT_STRING pFormat
  1039. );
  1040. RPCRTAPI
  1041. unsigned char *
  1042. RPC_ENTRY
  1043. NdrConformantStringMarshall(
  1044. PMIDL_STUB_MESSAGE pStubMsg,
  1045. unsigned char * pMemory,
  1046. PFORMAT_STRING pFormat
  1047. );
  1048. /* Unions */
  1049. RPCRTAPI
  1050. unsigned char *
  1051. RPC_ENTRY
  1052. NdrEncapsulatedUnionMarshall(
  1053. PMIDL_STUB_MESSAGE pStubMsg,
  1054. unsigned char * pMemory,
  1055. PFORMAT_STRING pFormat
  1056. );
  1057. RPCRTAPI
  1058. unsigned char *
  1059. RPC_ENTRY
  1060. NdrNonEncapsulatedUnionMarshall(
  1061. PMIDL_STUB_MESSAGE pStubMsg,
  1062. unsigned char * pMemory,
  1063. PFORMAT_STRING pFormat
  1064. );
  1065. /* Byte count pointer */
  1066. RPCRTAPI
  1067. unsigned char *
  1068. RPC_ENTRY
  1069. NdrByteCountPointerMarshall(
  1070. PMIDL_STUB_MESSAGE pStubMsg,
  1071. unsigned char * pMemory,
  1072. PFORMAT_STRING pFormat
  1073. );
  1074. /* Transmit as and represent as*/
  1075. RPCRTAPI
  1076. unsigned char *
  1077. RPC_ENTRY
  1078. NdrXmitOrRepAsMarshall(
  1079. PMIDL_STUB_MESSAGE pStubMsg,
  1080. unsigned char * pMemory,
  1081. PFORMAT_STRING pFormat
  1082. );
  1083. /* User_marshal */
  1084. RPCRTAPI
  1085. unsigned char *
  1086. RPC_ENTRY
  1087. NdrUserMarshalMarshall(
  1088. PMIDL_STUB_MESSAGE pStubMsg,
  1089. unsigned char * pMemory,
  1090. PFORMAT_STRING pFormat
  1091. );
  1092. /* Interface pointer */
  1093. RPCRTAPI
  1094. unsigned char *
  1095. RPC_ENTRY
  1096. NdrInterfacePointerMarshall(
  1097. PMIDL_STUB_MESSAGE pStubMsg,
  1098. unsigned char * pMemory,
  1099. PFORMAT_STRING pFormat
  1100. );
  1101. /* Context handles */
  1102. RPCRTAPI
  1103. void
  1104. RPC_ENTRY
  1105. NdrClientContextMarshall(
  1106. PMIDL_STUB_MESSAGE pStubMsg,
  1107. NDR_CCONTEXT ContextHandle,
  1108. int fCheck
  1109. );
  1110. RPCRTAPI
  1111. void
  1112. RPC_ENTRY
  1113. NdrServerContextMarshall(
  1114. PMIDL_STUB_MESSAGE pStubMsg,
  1115. NDR_SCONTEXT ContextHandle,
  1116. NDR_RUNDOWN RundownRoutine
  1117. );
  1118. RPCRTAPI
  1119. void
  1120. RPC_ENTRY
  1121. NdrServerContextNewMarshall(
  1122. PMIDL_STUB_MESSAGE pStubMsg,
  1123. NDR_SCONTEXT ContextHandle,
  1124. NDR_RUNDOWN RundownRoutine,
  1125. PFORMAT_STRING pFormat
  1126. );
  1127. /*
  1128. * Unmarshall routines
  1129. */
  1130. RPCRTAPI
  1131. void
  1132. RPC_ENTRY
  1133. NdrSimpleTypeUnmarshall(
  1134. PMIDL_STUB_MESSAGE pStubMsg,
  1135. unsigned char * pMemory,
  1136. unsigned char FormatChar
  1137. );
  1138. RPCRTAPI
  1139. unsigned char * RPC_ENTRY
  1140. RPC_ENTRY
  1141. NdrCsArrayUnmarshall(
  1142. PMIDL_STUB_MESSAGE pStubMsg,
  1143. unsigned char ** ppMemory,
  1144. PFORMAT_STRING pFormat,
  1145. unsigned char fMustAlloc
  1146. );
  1147. RPCRTAPI
  1148. unsigned char * RPC_ENTRY
  1149. RPC_ENTRY
  1150. NdrCsTagUnmarshall(
  1151. PMIDL_STUB_MESSAGE pStubMsg,
  1152. unsigned char ** ppMemory,
  1153. PFORMAT_STRING pFormat,
  1154. unsigned char fMustAlloc
  1155. );
  1156. RPCRTAPI
  1157. unsigned char * RPC_ENTRY
  1158. NdrRangeUnmarshall(
  1159. PMIDL_STUB_MESSAGE pStubMsg,
  1160. unsigned char ** ppMemory,
  1161. PFORMAT_STRING pFormat,
  1162. unsigned char fMustAlloc
  1163. );
  1164. RPCRTAPI
  1165. void
  1166. RPC_ENTRY
  1167. NdrCorrelationInitialize(
  1168. PMIDL_STUB_MESSAGE pStubMsg,
  1169. void * pMemory,
  1170. unsigned long CacheSize,
  1171. unsigned long flags
  1172. );
  1173. RPCRTAPI
  1174. void
  1175. RPC_ENTRY
  1176. NdrCorrelationPass(
  1177. PMIDL_STUB_MESSAGE pStubMsg
  1178. );
  1179. RPCRTAPI
  1180. void
  1181. RPC_ENTRY
  1182. NdrCorrelationFree(
  1183. PMIDL_STUB_MESSAGE pStubMsg
  1184. );
  1185. RPCRTAPI
  1186. unsigned char *
  1187. RPC_ENTRY
  1188. NdrPointerUnmarshall(
  1189. PMIDL_STUB_MESSAGE pStubMsg,
  1190. unsigned char * * ppMemory,
  1191. PFORMAT_STRING pFormat,
  1192. unsigned char fMustAlloc
  1193. );
  1194. /* Structures */
  1195. RPCRTAPI
  1196. unsigned char *
  1197. RPC_ENTRY
  1198. NdrSimpleStructUnmarshall(
  1199. PMIDL_STUB_MESSAGE pStubMsg,
  1200. unsigned char * * ppMemory,
  1201. PFORMAT_STRING pFormat,
  1202. unsigned char fMustAlloc
  1203. );
  1204. RPCRTAPI
  1205. unsigned char *
  1206. RPC_ENTRY
  1207. NdrConformantStructUnmarshall(
  1208. PMIDL_STUB_MESSAGE pStubMsg,
  1209. unsigned char * * ppMemory,
  1210. PFORMAT_STRING pFormat,
  1211. unsigned char fMustAlloc
  1212. );
  1213. RPCRTAPI
  1214. unsigned char *
  1215. RPC_ENTRY
  1216. NdrConformantVaryingStructUnmarshall(
  1217. PMIDL_STUB_MESSAGE pStubMsg,
  1218. unsigned char * * ppMemory,
  1219. PFORMAT_STRING pFormat,
  1220. unsigned char fMustAlloc
  1221. );
  1222. RPCRTAPI
  1223. unsigned char *
  1224. RPC_ENTRY
  1225. NdrComplexStructUnmarshall(
  1226. PMIDL_STUB_MESSAGE pStubMsg,
  1227. unsigned char * * ppMemory,
  1228. PFORMAT_STRING pFormat,
  1229. unsigned char fMustAlloc
  1230. );
  1231. /* Arrays */
  1232. RPCRTAPI
  1233. unsigned char *
  1234. RPC_ENTRY
  1235. NdrFixedArrayUnmarshall(
  1236. PMIDL_STUB_MESSAGE pStubMsg,
  1237. unsigned char * * ppMemory,
  1238. PFORMAT_STRING pFormat,
  1239. unsigned char fMustAlloc
  1240. );
  1241. RPCRTAPI
  1242. unsigned char *
  1243. RPC_ENTRY
  1244. NdrConformantArrayUnmarshall(
  1245. PMIDL_STUB_MESSAGE pStubMsg,
  1246. unsigned char * * ppMemory,
  1247. PFORMAT_STRING pFormat,
  1248. unsigned char fMustAlloc
  1249. );
  1250. RPCRTAPI
  1251. unsigned char *
  1252. RPC_ENTRY
  1253. NdrConformantVaryingArrayUnmarshall(
  1254. PMIDL_STUB_MESSAGE pStubMsg,
  1255. unsigned char * * ppMemory,
  1256. PFORMAT_STRING pFormat,
  1257. unsigned char fMustAlloc
  1258. );
  1259. RPCRTAPI
  1260. unsigned char *
  1261. RPC_ENTRY
  1262. NdrVaryingArrayUnmarshall(
  1263. PMIDL_STUB_MESSAGE pStubMsg,
  1264. unsigned char * * ppMemory,
  1265. PFORMAT_STRING pFormat,
  1266. unsigned char fMustAlloc
  1267. );
  1268. RPCRTAPI
  1269. unsigned char *
  1270. RPC_ENTRY
  1271. NdrComplexArrayUnmarshall(
  1272. PMIDL_STUB_MESSAGE pStubMsg,
  1273. unsigned char * * ppMemory,
  1274. PFORMAT_STRING pFormat,
  1275. unsigned char fMustAlloc
  1276. );
  1277. /* Strings */
  1278. RPCRTAPI
  1279. unsigned char *
  1280. RPC_ENTRY
  1281. NdrNonConformantStringUnmarshall(
  1282. PMIDL_STUB_MESSAGE pStubMsg,
  1283. unsigned char * * ppMemory,
  1284. PFORMAT_STRING pFormat,
  1285. unsigned char fMustAlloc
  1286. );
  1287. RPCRTAPI
  1288. unsigned char *
  1289. RPC_ENTRY
  1290. NdrConformantStringUnmarshall(
  1291. PMIDL_STUB_MESSAGE pStubMsg,
  1292. unsigned char * * ppMemory,
  1293. PFORMAT_STRING pFormat,
  1294. unsigned char fMustAlloc
  1295. );
  1296. /* Unions */
  1297. RPCRTAPI
  1298. unsigned char *
  1299. RPC_ENTRY
  1300. NdrEncapsulatedUnionUnmarshall(
  1301. PMIDL_STUB_MESSAGE pStubMsg,
  1302. unsigned char * * ppMemory,
  1303. PFORMAT_STRING pFormat,
  1304. unsigned char fMustAlloc
  1305. );
  1306. RPCRTAPI
  1307. unsigned char *
  1308. RPC_ENTRY
  1309. NdrNonEncapsulatedUnionUnmarshall(
  1310. PMIDL_STUB_MESSAGE pStubMsg,
  1311. unsigned char * * ppMemory,
  1312. PFORMAT_STRING pFormat,
  1313. unsigned char fMustAlloc
  1314. );
  1315. /* Byte count pointer */
  1316. RPCRTAPI
  1317. unsigned char *
  1318. RPC_ENTRY
  1319. NdrByteCountPointerUnmarshall(
  1320. PMIDL_STUB_MESSAGE pStubMsg,
  1321. unsigned char * * ppMemory,
  1322. PFORMAT_STRING pFormat,
  1323. unsigned char fMustAlloc
  1324. );
  1325. /* Transmit as and represent as*/
  1326. RPCRTAPI
  1327. unsigned char *
  1328. RPC_ENTRY
  1329. NdrXmitOrRepAsUnmarshall(
  1330. PMIDL_STUB_MESSAGE pStubMsg,
  1331. unsigned char * * ppMemory,
  1332. PFORMAT_STRING pFormat,
  1333. unsigned char fMustAlloc
  1334. );
  1335. /* User_marshal */
  1336. RPCRTAPI
  1337. unsigned char *
  1338. RPC_ENTRY
  1339. NdrUserMarshalUnmarshall(
  1340. PMIDL_STUB_MESSAGE pStubMsg,
  1341. unsigned char * * ppMemory,
  1342. PFORMAT_STRING pFormat,
  1343. unsigned char fMustAlloc
  1344. );
  1345. /* Interface pointer */
  1346. RPCRTAPI
  1347. unsigned char *
  1348. RPC_ENTRY
  1349. NdrInterfacePointerUnmarshall(
  1350. PMIDL_STUB_MESSAGE pStubMsg,
  1351. unsigned char * * ppMemory,
  1352. PFORMAT_STRING pFormat,
  1353. unsigned char fMustAlloc
  1354. );
  1355. /* Context handles */
  1356. RPCRTAPI
  1357. void
  1358. RPC_ENTRY
  1359. NdrClientContextUnmarshall(
  1360. PMIDL_STUB_MESSAGE pStubMsg,
  1361. NDR_CCONTEXT * pContextHandle,
  1362. RPC_BINDING_HANDLE BindHandle
  1363. );
  1364. RPCRTAPI
  1365. NDR_SCONTEXT
  1366. RPC_ENTRY
  1367. NdrServerContextUnmarshall(
  1368. PMIDL_STUB_MESSAGE pStubMsg
  1369. );
  1370. /* New context handle flavors */
  1371. RPCRTAPI
  1372. NDR_SCONTEXT
  1373. RPC_ENTRY
  1374. NdrContextHandleInitialize(
  1375. IN PMIDL_STUB_MESSAGE pStubMsg,
  1376. IN PFORMAT_STRING pFormat
  1377. );
  1378. RPCRTAPI
  1379. NDR_SCONTEXT
  1380. RPC_ENTRY
  1381. NdrServerContextNewUnmarshall(
  1382. IN PMIDL_STUB_MESSAGE pStubMsg,
  1383. IN PFORMAT_STRING pFormat
  1384. );
  1385. /*
  1386. * Buffer sizing routines
  1387. */
  1388. RPCRTAPI
  1389. void
  1390. RPC_ENTRY
  1391. NdrPointerBufferSize(
  1392. PMIDL_STUB_MESSAGE pStubMsg,
  1393. unsigned char * pMemory,
  1394. PFORMAT_STRING pFormat
  1395. );
  1396. RPCRTAPI
  1397. void
  1398. RPC_ENTRY
  1399. NdrCsArrayBufferSize(
  1400. PMIDL_STUB_MESSAGE pStubMsg,
  1401. unsigned char * pMemory,
  1402. PFORMAT_STRING pFormat
  1403. );
  1404. RPCRTAPI
  1405. void
  1406. RPC_ENTRY
  1407. NdrCsTagBufferSize(
  1408. PMIDL_STUB_MESSAGE pStubMsg,
  1409. unsigned char * pMemory,
  1410. PFORMAT_STRING pFormat
  1411. );
  1412. /* Structures */
  1413. RPCRTAPI
  1414. void
  1415. RPC_ENTRY
  1416. NdrSimpleStructBufferSize(
  1417. PMIDL_STUB_MESSAGE pStubMsg,
  1418. unsigned char * pMemory,
  1419. PFORMAT_STRING pFormat
  1420. );
  1421. RPCRTAPI
  1422. void
  1423. RPC_ENTRY
  1424. NdrConformantStructBufferSize(
  1425. PMIDL_STUB_MESSAGE pStubMsg,
  1426. unsigned char * pMemory,
  1427. PFORMAT_STRING pFormat
  1428. );
  1429. RPCRTAPI
  1430. void
  1431. RPC_ENTRY
  1432. NdrConformantVaryingStructBufferSize(
  1433. PMIDL_STUB_MESSAGE pStubMsg,
  1434. unsigned char * pMemory,
  1435. PFORMAT_STRING pFormat
  1436. );
  1437. RPCRTAPI
  1438. void
  1439. RPC_ENTRY
  1440. NdrComplexStructBufferSize(
  1441. PMIDL_STUB_MESSAGE pStubMsg,
  1442. unsigned char * pMemory,
  1443. PFORMAT_STRING pFormat
  1444. );
  1445. /* Arrays */
  1446. RPCRTAPI
  1447. void
  1448. RPC_ENTRY
  1449. NdrFixedArrayBufferSize(
  1450. PMIDL_STUB_MESSAGE pStubMsg,
  1451. unsigned char * pMemory,
  1452. PFORMAT_STRING pFormat
  1453. );
  1454. RPCRTAPI
  1455. void
  1456. RPC_ENTRY
  1457. NdrConformantArrayBufferSize(
  1458. PMIDL_STUB_MESSAGE pStubMsg,
  1459. unsigned char * pMemory,
  1460. PFORMAT_STRING pFormat
  1461. );
  1462. RPCRTAPI
  1463. void
  1464. RPC_ENTRY
  1465. NdrConformantVaryingArrayBufferSize(
  1466. PMIDL_STUB_MESSAGE pStubMsg,
  1467. unsigned char * pMemory,
  1468. PFORMAT_STRING pFormat
  1469. );
  1470. RPCRTAPI
  1471. void
  1472. RPC_ENTRY
  1473. NdrVaryingArrayBufferSize(
  1474. PMIDL_STUB_MESSAGE pStubMsg,
  1475. unsigned char * pMemory,
  1476. PFORMAT_STRING pFormat
  1477. );
  1478. RPCRTAPI
  1479. void
  1480. RPC_ENTRY
  1481. NdrComplexArrayBufferSize(
  1482. PMIDL_STUB_MESSAGE pStubMsg,
  1483. unsigned char * pMemory,
  1484. PFORMAT_STRING pFormat
  1485. );
  1486. /* Strings */
  1487. RPCRTAPI
  1488. void
  1489. RPC_ENTRY
  1490. NdrConformantStringBufferSize(
  1491. PMIDL_STUB_MESSAGE pStubMsg,
  1492. unsigned char * pMemory,
  1493. PFORMAT_STRING pFormat
  1494. );
  1495. RPCRTAPI
  1496. void
  1497. RPC_ENTRY
  1498. NdrNonConformantStringBufferSize(
  1499. PMIDL_STUB_MESSAGE pStubMsg,
  1500. unsigned char * pMemory,
  1501. PFORMAT_STRING pFormat
  1502. );
  1503. /* Unions */
  1504. RPCRTAPI
  1505. void
  1506. RPC_ENTRY
  1507. NdrEncapsulatedUnionBufferSize(
  1508. PMIDL_STUB_MESSAGE pStubMsg,
  1509. unsigned char * pMemory,
  1510. PFORMAT_STRING pFormat
  1511. );
  1512. RPCRTAPI
  1513. void
  1514. RPC_ENTRY
  1515. NdrNonEncapsulatedUnionBufferSize(
  1516. PMIDL_STUB_MESSAGE pStubMsg,
  1517. unsigned char * pMemory,
  1518. PFORMAT_STRING pFormat
  1519. );
  1520. /* Byte count pointer */
  1521. RPCRTAPI
  1522. void
  1523. RPC_ENTRY
  1524. NdrByteCountPointerBufferSize(
  1525. PMIDL_STUB_MESSAGE pStubMsg,
  1526. unsigned char * pMemory,
  1527. PFORMAT_STRING pFormat
  1528. );
  1529. /* Transmit as and represent as*/
  1530. RPCRTAPI
  1531. void
  1532. RPC_ENTRY
  1533. NdrXmitOrRepAsBufferSize(
  1534. PMIDL_STUB_MESSAGE pStubMsg,
  1535. unsigned char * pMemory,
  1536. PFORMAT_STRING pFormat
  1537. );
  1538. /* User_marshal */
  1539. RPCRTAPI
  1540. void
  1541. RPC_ENTRY
  1542. NdrUserMarshalBufferSize(
  1543. PMIDL_STUB_MESSAGE pStubMsg,
  1544. unsigned char * pMemory,
  1545. PFORMAT_STRING pFormat
  1546. );
  1547. /* Interface pointer */
  1548. RPCRTAPI
  1549. void
  1550. RPC_ENTRY
  1551. NdrInterfacePointerBufferSize(
  1552. PMIDL_STUB_MESSAGE pStubMsg,
  1553. unsigned char * pMemory,
  1554. PFORMAT_STRING pFormat
  1555. );
  1556. // Context Handle size
  1557. //
  1558. RPCRTAPI
  1559. void
  1560. RPC_ENTRY
  1561. NdrContextHandleSize(
  1562. PMIDL_STUB_MESSAGE pStubMsg,
  1563. unsigned char * pMemory,
  1564. PFORMAT_STRING pFormat
  1565. );
  1566. /*
  1567. * Memory sizing routines
  1568. */
  1569. RPCRTAPI
  1570. unsigned long
  1571. RPC_ENTRY
  1572. NdrPointerMemorySize(
  1573. PMIDL_STUB_MESSAGE pStubMsg,
  1574. PFORMAT_STRING pFormat
  1575. );
  1576. /* cs_char things */
  1577. RPCRTAPI
  1578. unsigned long
  1579. RPC_ENTRY
  1580. NdrCsArrayMemorySize(
  1581. PMIDL_STUB_MESSAGE pStubMsg,
  1582. PFORMAT_STRING pFormat
  1583. );
  1584. RPCRTAPI
  1585. unsigned long
  1586. RPC_ENTRY
  1587. NdrCsTagMemorySize(
  1588. PMIDL_STUB_MESSAGE pStubMsg,
  1589. PFORMAT_STRING pFormat
  1590. );
  1591. /* Structures */
  1592. RPCRTAPI
  1593. unsigned long
  1594. RPC_ENTRY
  1595. NdrSimpleStructMemorySize(
  1596. PMIDL_STUB_MESSAGE pStubMsg,
  1597. PFORMAT_STRING pFormat
  1598. );
  1599. RPCRTAPI
  1600. unsigned long
  1601. RPC_ENTRY
  1602. NdrConformantStructMemorySize(
  1603. PMIDL_STUB_MESSAGE pStubMsg,
  1604. PFORMAT_STRING pFormat
  1605. );
  1606. RPCRTAPI
  1607. unsigned long
  1608. RPC_ENTRY
  1609. NdrConformantVaryingStructMemorySize(
  1610. PMIDL_STUB_MESSAGE pStubMsg,
  1611. PFORMAT_STRING pFormat
  1612. );
  1613. RPCRTAPI
  1614. unsigned long
  1615. RPC_ENTRY
  1616. NdrComplexStructMemorySize(
  1617. PMIDL_STUB_MESSAGE pStubMsg,
  1618. PFORMAT_STRING pFormat
  1619. );
  1620. /* Arrays */
  1621. RPCRTAPI
  1622. unsigned long
  1623. RPC_ENTRY
  1624. NdrFixedArrayMemorySize(
  1625. PMIDL_STUB_MESSAGE pStubMsg,
  1626. PFORMAT_STRING pFormat
  1627. );
  1628. RPCRTAPI
  1629. unsigned long
  1630. RPC_ENTRY
  1631. NdrConformantArrayMemorySize(
  1632. PMIDL_STUB_MESSAGE pStubMsg,
  1633. PFORMAT_STRING pFormat
  1634. );
  1635. RPCRTAPI
  1636. unsigned long
  1637. RPC_ENTRY
  1638. NdrConformantVaryingArrayMemorySize(
  1639. PMIDL_STUB_MESSAGE pStubMsg,
  1640. PFORMAT_STRING pFormat
  1641. );
  1642. RPCRTAPI
  1643. unsigned long
  1644. RPC_ENTRY
  1645. NdrVaryingArrayMemorySize(
  1646. PMIDL_STUB_MESSAGE pStubMsg,
  1647. PFORMAT_STRING pFormat
  1648. );
  1649. RPCRTAPI
  1650. unsigned long
  1651. RPC_ENTRY
  1652. NdrComplexArrayMemorySize(
  1653. PMIDL_STUB_MESSAGE pStubMsg,
  1654. PFORMAT_STRING pFormat
  1655. );
  1656. /* Strings */
  1657. RPCRTAPI
  1658. unsigned long
  1659. RPC_ENTRY
  1660. NdrConformantStringMemorySize(
  1661. PMIDL_STUB_MESSAGE pStubMsg,
  1662. PFORMAT_STRING pFormat
  1663. );
  1664. RPCRTAPI
  1665. unsigned long
  1666. RPC_ENTRY
  1667. NdrNonConformantStringMemorySize(
  1668. PMIDL_STUB_MESSAGE pStubMsg,
  1669. PFORMAT_STRING pFormat
  1670. );
  1671. /* Unions */
  1672. RPCRTAPI
  1673. unsigned long
  1674. RPC_ENTRY
  1675. NdrEncapsulatedUnionMemorySize(
  1676. PMIDL_STUB_MESSAGE pStubMsg,
  1677. PFORMAT_STRING pFormat
  1678. );
  1679. RPCRTAPI
  1680. unsigned long
  1681. RPC_ENTRY
  1682. NdrNonEncapsulatedUnionMemorySize(
  1683. PMIDL_STUB_MESSAGE pStubMsg,
  1684. PFORMAT_STRING pFormat
  1685. );
  1686. /* Transmit as and represent as*/
  1687. RPCRTAPI
  1688. unsigned long
  1689. RPC_ENTRY
  1690. NdrXmitOrRepAsMemorySize(
  1691. PMIDL_STUB_MESSAGE pStubMsg,
  1692. PFORMAT_STRING pFormat
  1693. );
  1694. /* User_marshal */
  1695. RPCRTAPI
  1696. unsigned long
  1697. RPC_ENTRY
  1698. NdrUserMarshalMemorySize(
  1699. PMIDL_STUB_MESSAGE pStubMsg,
  1700. PFORMAT_STRING pFormat
  1701. );
  1702. /* Interface pointer */
  1703. RPCRTAPI
  1704. unsigned long
  1705. RPC_ENTRY
  1706. NdrInterfacePointerMemorySize(
  1707. PMIDL_STUB_MESSAGE pStubMsg,
  1708. PFORMAT_STRING pFormat
  1709. );
  1710. /*
  1711. * Freeing routines
  1712. */
  1713. RPCRTAPI
  1714. void
  1715. RPC_ENTRY
  1716. NdrPointerFree(
  1717. PMIDL_STUB_MESSAGE pStubMsg,
  1718. unsigned char * pMemory,
  1719. PFORMAT_STRING pFormat
  1720. );
  1721. RPCRTAPI
  1722. void
  1723. RPC_ENTRY
  1724. NdrCsArrayFree(
  1725. PMIDL_STUB_MESSAGE pStubMsg,
  1726. unsigned char * pMemory,
  1727. PFORMAT_STRING pFormat
  1728. );
  1729. /* Structures */
  1730. RPCRTAPI
  1731. void
  1732. RPC_ENTRY
  1733. NdrSimpleStructFree(
  1734. PMIDL_STUB_MESSAGE pStubMsg,
  1735. unsigned char * pMemory,
  1736. PFORMAT_STRING pFormat
  1737. );
  1738. RPCRTAPI
  1739. void
  1740. RPC_ENTRY
  1741. NdrConformantStructFree(
  1742. PMIDL_STUB_MESSAGE pStubMsg,
  1743. unsigned char * pMemory,
  1744. PFORMAT_STRING pFormat
  1745. );
  1746. RPCRTAPI
  1747. void
  1748. RPC_ENTRY
  1749. NdrConformantVaryingStructFree(
  1750. PMIDL_STUB_MESSAGE pStubMsg,
  1751. unsigned char * pMemory,
  1752. PFORMAT_STRING pFormat
  1753. );
  1754. RPCRTAPI
  1755. void
  1756. RPC_ENTRY
  1757. NdrComplexStructFree(
  1758. PMIDL_STUB_MESSAGE pStubMsg,
  1759. unsigned char * pMemory,
  1760. PFORMAT_STRING pFormat
  1761. );
  1762. /* Arrays */
  1763. RPCRTAPI
  1764. void
  1765. RPC_ENTRY
  1766. NdrFixedArrayFree(
  1767. PMIDL_STUB_MESSAGE pStubMsg,
  1768. unsigned char * pMemory,
  1769. PFORMAT_STRING pFormat
  1770. );
  1771. RPCRTAPI
  1772. void
  1773. RPC_ENTRY
  1774. NdrConformantArrayFree(
  1775. PMIDL_STUB_MESSAGE pStubMsg,
  1776. unsigned char * pMemory,
  1777. PFORMAT_STRING pFormat
  1778. );
  1779. RPCRTAPI
  1780. void
  1781. RPC_ENTRY
  1782. NdrConformantVaryingArrayFree(
  1783. PMIDL_STUB_MESSAGE pStubMsg,
  1784. unsigned char * pMemory,
  1785. PFORMAT_STRING pFormat
  1786. );
  1787. RPCRTAPI
  1788. void
  1789. RPC_ENTRY
  1790. NdrVaryingArrayFree(
  1791. PMIDL_STUB_MESSAGE pStubMsg,
  1792. unsigned char * pMemory,
  1793. PFORMAT_STRING pFormat
  1794. );
  1795. RPCRTAPI
  1796. void
  1797. RPC_ENTRY
  1798. NdrComplexArrayFree(
  1799. PMIDL_STUB_MESSAGE pStubMsg,
  1800. unsigned char * pMemory,
  1801. PFORMAT_STRING pFormat
  1802. );
  1803. /* Unions */
  1804. RPCRTAPI
  1805. void
  1806. RPC_ENTRY
  1807. NdrEncapsulatedUnionFree(
  1808. PMIDL_STUB_MESSAGE pStubMsg,
  1809. unsigned char * pMemory,
  1810. PFORMAT_STRING pFormat
  1811. );
  1812. RPCRTAPI
  1813. void
  1814. RPC_ENTRY
  1815. NdrNonEncapsulatedUnionFree(
  1816. PMIDL_STUB_MESSAGE pStubMsg,
  1817. unsigned char * pMemory,
  1818. PFORMAT_STRING pFormat
  1819. );
  1820. /* Byte count */
  1821. RPCRTAPI
  1822. void
  1823. RPC_ENTRY
  1824. NdrByteCountPointerFree(
  1825. PMIDL_STUB_MESSAGE pStubMsg,
  1826. unsigned char * pMemory,
  1827. PFORMAT_STRING pFormat
  1828. );
  1829. /* Transmit as and represent as*/
  1830. RPCRTAPI
  1831. void
  1832. RPC_ENTRY
  1833. NdrXmitOrRepAsFree(
  1834. PMIDL_STUB_MESSAGE pStubMsg,
  1835. unsigned char * pMemory,
  1836. PFORMAT_STRING pFormat
  1837. );
  1838. /* User_marshal */
  1839. RPCRTAPI
  1840. void
  1841. RPC_ENTRY
  1842. NdrUserMarshalFree(
  1843. PMIDL_STUB_MESSAGE pStubMsg,
  1844. unsigned char * pMemory,
  1845. PFORMAT_STRING pFormat
  1846. );
  1847. /* Interface pointer */
  1848. RPCRTAPI
  1849. void
  1850. RPC_ENTRY
  1851. NdrInterfacePointerFree(
  1852. PMIDL_STUB_MESSAGE pStubMsg,
  1853. unsigned char * pMemory,
  1854. PFORMAT_STRING pFormat
  1855. );
  1856. /*
  1857. * Endian conversion routine.
  1858. */
  1859. RPCRTAPI
  1860. void
  1861. RPC_ENTRY
  1862. NdrConvert2(
  1863. PMIDL_STUB_MESSAGE pStubMsg,
  1864. PFORMAT_STRING pFormat,
  1865. long NumberParams
  1866. );
  1867. RPCRTAPI
  1868. void
  1869. RPC_ENTRY
  1870. NdrConvert(
  1871. PMIDL_STUB_MESSAGE pStubMsg,
  1872. PFORMAT_STRING pFormat
  1873. );
  1874. #define USER_MARSHAL_FC_BYTE 1
  1875. #define USER_MARSHAL_FC_CHAR 2
  1876. #define USER_MARSHAL_FC_SMALL 3
  1877. #define USER_MARSHAL_FC_USMALL 4
  1878. #define USER_MARSHAL_FC_WCHAR 5
  1879. #define USER_MARSHAL_FC_SHORT 6
  1880. #define USER_MARSHAL_FC_USHORT 7
  1881. #define USER_MARSHAL_FC_LONG 8
  1882. #define USER_MARSHAL_FC_ULONG 9
  1883. #define USER_MARSHAL_FC_FLOAT 10
  1884. #define USER_MARSHAL_FC_HYPER 11
  1885. #define USER_MARSHAL_FC_DOUBLE 12
  1886. RPCRTAPI
  1887. unsigned char *
  1888. RPC_ENTRY
  1889. NdrUserMarshalSimpleTypeConvert(
  1890. unsigned long * pFlags,
  1891. unsigned char * pBuffer,
  1892. unsigned char FormatChar
  1893. );
  1894. /*
  1895. * Auxilary routines
  1896. */
  1897. RPCRTAPI
  1898. void
  1899. RPC_ENTRY
  1900. NdrClientInitializeNew(
  1901. PRPC_MESSAGE pRpcMsg,
  1902. PMIDL_STUB_MESSAGE pStubMsg,
  1903. PMIDL_STUB_DESC pStubDescriptor,
  1904. unsigned int ProcNum
  1905. );
  1906. RPCRTAPI
  1907. unsigned char *
  1908. RPC_ENTRY
  1909. NdrServerInitializeNew(
  1910. PRPC_MESSAGE pRpcMsg,
  1911. PMIDL_STUB_MESSAGE pStubMsg,
  1912. PMIDL_STUB_DESC pStubDescriptor
  1913. );
  1914. RPCRTAPI
  1915. void
  1916. RPC_ENTRY
  1917. NdrServerInitializePartial(
  1918. PRPC_MESSAGE pRpcMsg,
  1919. PMIDL_STUB_MESSAGE pStubMsg,
  1920. PMIDL_STUB_DESC pStubDescriptor,
  1921. unsigned long RequestedBufferSize
  1922. );
  1923. RPCRTAPI
  1924. void
  1925. RPC_ENTRY
  1926. NdrClientInitialize(
  1927. PRPC_MESSAGE pRpcMsg,
  1928. PMIDL_STUB_MESSAGE pStubMsg,
  1929. PMIDL_STUB_DESC pStubDescriptor,
  1930. unsigned int ProcNum
  1931. );
  1932. RPCRTAPI
  1933. unsigned char *
  1934. RPC_ENTRY
  1935. NdrServerInitialize(
  1936. PRPC_MESSAGE pRpcMsg,
  1937. PMIDL_STUB_MESSAGE pStubMsg,
  1938. PMIDL_STUB_DESC pStubDescriptor
  1939. );
  1940. RPCRTAPI
  1941. unsigned char *
  1942. RPC_ENTRY
  1943. NdrServerInitializeUnmarshall (
  1944. PMIDL_STUB_MESSAGE pStubMsg,
  1945. PMIDL_STUB_DESC pStubDescriptor,
  1946. PRPC_MESSAGE pRpcMsg
  1947. );
  1948. RPCRTAPI
  1949. void
  1950. RPC_ENTRY
  1951. NdrServerInitializeMarshall (
  1952. PRPC_MESSAGE pRpcMsg,
  1953. PMIDL_STUB_MESSAGE pStubMsg
  1954. );
  1955. RPCRTAPI
  1956. unsigned char *
  1957. RPC_ENTRY
  1958. NdrGetBuffer(
  1959. PMIDL_STUB_MESSAGE pStubMsg,
  1960. unsigned long BufferLength,
  1961. RPC_BINDING_HANDLE Handle
  1962. );
  1963. RPCRTAPI
  1964. unsigned char *
  1965. RPC_ENTRY
  1966. NdrNsGetBuffer(
  1967. PMIDL_STUB_MESSAGE pStubMsg,
  1968. unsigned long BufferLength,
  1969. RPC_BINDING_HANDLE Handle
  1970. );
  1971. RPCRTAPI
  1972. unsigned char *
  1973. RPC_ENTRY
  1974. NdrSendReceive(
  1975. PMIDL_STUB_MESSAGE pStubMsg,
  1976. unsigned char * pBufferEnd
  1977. );
  1978. RPCRTAPI
  1979. unsigned char *
  1980. RPC_ENTRY
  1981. NdrNsSendReceive(
  1982. PMIDL_STUB_MESSAGE pStubMsg,
  1983. unsigned char * pBufferEnd,
  1984. RPC_BINDING_HANDLE * pAutoHandle
  1985. );
  1986. RPCRTAPI
  1987. void
  1988. RPC_ENTRY
  1989. NdrFreeBuffer(
  1990. PMIDL_STUB_MESSAGE pStubMsg
  1991. );
  1992. RPCRTAPI
  1993. RPC_STATUS
  1994. RPC_ENTRY
  1995. NdrGetDcomProtocolVersion(
  1996. PMIDL_STUB_MESSAGE pStubMsg,
  1997. RPC_VERSION * pVersion );
  1998. /*
  1999. * Interpreter calls.
  2000. */
  2001. /* client */
  2002. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2003. NdrClientCall2(
  2004. PMIDL_STUB_DESC pStubDescriptor,
  2005. PFORMAT_STRING pFormat,
  2006. ...
  2007. );
  2008. #if _MSC_FULL_VER >= 13103270
  2009. #ifndef NDR_IMPL
  2010. #ifdef __cplusplus
  2011. extern "C"
  2012. #endif
  2013. void * _AddressOfReturnAddress(void);
  2014. #define NdrClientCall2(x, y, z) NdrClientCall2(x, y, (unsigned char *)_AddressOfReturnAddress()+4)
  2015. #endif
  2016. #endif
  2017. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2018. NdrClientCall(
  2019. PMIDL_STUB_DESC pStubDescriptor,
  2020. PFORMAT_STRING pFormat,
  2021. ...
  2022. );
  2023. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2024. NdrAsyncClientCall(
  2025. PMIDL_STUB_DESC pStubDescriptor,
  2026. PFORMAT_STRING pFormat,
  2027. ...
  2028. );
  2029. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2030. NdrDcomAsyncClientCall(
  2031. PMIDL_STUB_DESC pStubDescriptor,
  2032. PFORMAT_STRING pFormat,
  2033. ...
  2034. );
  2035. /* server */
  2036. typedef enum {
  2037. STUB_UNMARSHAL,
  2038. STUB_CALL_SERVER,
  2039. STUB_MARSHAL,
  2040. STUB_CALL_SERVER_NO_HRESULT
  2041. }STUB_PHASE;
  2042. typedef enum {
  2043. PROXY_CALCSIZE,
  2044. PROXY_GETBUFFER,
  2045. PROXY_MARSHAL,
  2046. PROXY_SENDRECEIVE,
  2047. PROXY_UNMARSHAL
  2048. }PROXY_PHASE;
  2049. struct IRpcStubBuffer; // Forward declaration
  2050. // Raw RPC only
  2051. RPCRTAPI
  2052. void
  2053. RPC_ENTRY
  2054. NdrAsyncServerCall(
  2055. PRPC_MESSAGE pRpcMsg
  2056. );
  2057. // old dcom async scheme
  2058. RPCRTAPI
  2059. long
  2060. RPC_ENTRY
  2061. NdrAsyncStubCall(
  2062. struct IRpcStubBuffer * pThis,
  2063. struct IRpcChannelBuffer * pChannel,
  2064. PRPC_MESSAGE pRpcMsg,
  2065. unsigned long * pdwStubPhase
  2066. );
  2067. // async uuid
  2068. RPCRTAPI
  2069. long
  2070. RPC_ENTRY
  2071. NdrDcomAsyncStubCall(
  2072. struct IRpcStubBuffer * pThis,
  2073. struct IRpcChannelBuffer * pChannel,
  2074. PRPC_MESSAGE pRpcMsg,
  2075. unsigned long * pdwStubPhase
  2076. );
  2077. RPCRTAPI
  2078. long
  2079. RPC_ENTRY
  2080. NdrStubCall2(
  2081. struct IRpcStubBuffer * pThis,
  2082. struct IRpcChannelBuffer * pChannel,
  2083. PRPC_MESSAGE pRpcMsg,
  2084. unsigned long * pdwStubPhase
  2085. );
  2086. RPCRTAPI
  2087. void
  2088. RPC_ENTRY
  2089. NdrServerCall2(
  2090. PRPC_MESSAGE pRpcMsg
  2091. );
  2092. RPCRTAPI
  2093. long
  2094. RPC_ENTRY
  2095. NdrStubCall (
  2096. struct IRpcStubBuffer * pThis,
  2097. struct IRpcChannelBuffer * pChannel,
  2098. PRPC_MESSAGE pRpcMsg,
  2099. unsigned long * pdwStubPhase
  2100. );
  2101. RPCRTAPI
  2102. void
  2103. RPC_ENTRY
  2104. NdrServerCall(
  2105. PRPC_MESSAGE pRpcMsg
  2106. );
  2107. RPCRTAPI
  2108. int
  2109. RPC_ENTRY
  2110. NdrServerUnmarshall(
  2111. struct IRpcChannelBuffer * pChannel,
  2112. PRPC_MESSAGE pRpcMsg,
  2113. PMIDL_STUB_MESSAGE pStubMsg,
  2114. PMIDL_STUB_DESC pStubDescriptor,
  2115. PFORMAT_STRING pFormat,
  2116. void * pParamList
  2117. );
  2118. RPCRTAPI
  2119. void
  2120. RPC_ENTRY
  2121. NdrServerMarshall(
  2122. struct IRpcStubBuffer * pThis,
  2123. struct IRpcChannelBuffer * pChannel,
  2124. PMIDL_STUB_MESSAGE pStubMsg,
  2125. PFORMAT_STRING pFormat
  2126. );
  2127. /* Comm and Fault status */
  2128. RPCRTAPI
  2129. RPC_STATUS
  2130. RPC_ENTRY
  2131. NdrMapCommAndFaultStatus(
  2132. PMIDL_STUB_MESSAGE pStubMsg,
  2133. unsigned long * pCommStatus,
  2134. unsigned long * pFaultStatus,
  2135. RPC_STATUS Status
  2136. );
  2137. /* Helper routines */
  2138. RPCRTAPI
  2139. int
  2140. RPC_ENTRY
  2141. NdrSH_UPDecision(
  2142. PMIDL_STUB_MESSAGE pStubMsg,
  2143. unsigned char * * pPtrInMem,
  2144. RPC_BUFPTR pBuffer
  2145. );
  2146. RPCRTAPI
  2147. int
  2148. RPC_ENTRY
  2149. NdrSH_TLUPDecision(
  2150. PMIDL_STUB_MESSAGE pStubMsg,
  2151. unsigned char * * pPtrInMem
  2152. );
  2153. RPCRTAPI
  2154. int
  2155. RPC_ENTRY
  2156. NdrSH_TLUPDecisionBuffer(
  2157. PMIDL_STUB_MESSAGE pStubMsg,
  2158. unsigned char * * pPtrInMem
  2159. );
  2160. RPCRTAPI
  2161. int
  2162. RPC_ENTRY
  2163. NdrSH_IfAlloc(
  2164. PMIDL_STUB_MESSAGE pStubMsg,
  2165. unsigned char * * pPtrInMem,
  2166. unsigned long Count
  2167. );
  2168. RPCRTAPI
  2169. int
  2170. RPC_ENTRY
  2171. NdrSH_IfAllocRef(
  2172. PMIDL_STUB_MESSAGE pStubMsg,
  2173. unsigned char * * pPtrInMem,
  2174. unsigned long Count
  2175. );
  2176. RPCRTAPI
  2177. int
  2178. RPC_ENTRY
  2179. NdrSH_IfAllocSet(
  2180. PMIDL_STUB_MESSAGE pStubMsg,
  2181. unsigned char * * pPtrInMem,
  2182. unsigned long Count
  2183. );
  2184. RPCRTAPI
  2185. RPC_BUFPTR
  2186. RPC_ENTRY
  2187. NdrSH_IfCopy(
  2188. PMIDL_STUB_MESSAGE pStubMsg,
  2189. unsigned char * * pPtrInMem,
  2190. unsigned long Count
  2191. );
  2192. RPCRTAPI
  2193. RPC_BUFPTR
  2194. RPC_ENTRY
  2195. NdrSH_IfAllocCopy(
  2196. PMIDL_STUB_MESSAGE pStubMsg,
  2197. unsigned char * * pPtrInMem,
  2198. unsigned long Count
  2199. );
  2200. RPCRTAPI
  2201. unsigned long
  2202. RPC_ENTRY
  2203. NdrSH_Copy(
  2204. unsigned char * pStubMsg,
  2205. unsigned char * pPtrInMem,
  2206. unsigned long Count
  2207. );
  2208. RPCRTAPI
  2209. void
  2210. RPC_ENTRY
  2211. NdrSH_IfFree(
  2212. PMIDL_STUB_MESSAGE pMessage,
  2213. unsigned char * pPtr );
  2214. RPCRTAPI
  2215. RPC_BUFPTR
  2216. RPC_ENTRY
  2217. NdrSH_StringMarshall(
  2218. PMIDL_STUB_MESSAGE pMessage,
  2219. unsigned char * pMemory,
  2220. unsigned long Count,
  2221. int Size );
  2222. RPCRTAPI
  2223. RPC_BUFPTR
  2224. RPC_ENTRY
  2225. NdrSH_StringUnMarshall(
  2226. PMIDL_STUB_MESSAGE pMessage,
  2227. unsigned char * * pMemory,
  2228. int Size );
  2229. /****************************************************************************
  2230. MIDL 2.0 memory package: rpc_ss_* rpc_sm_*
  2231. ****************************************************************************/
  2232. typedef void * RPC_SS_THREAD_HANDLE;
  2233. typedef void * __RPC_API
  2234. RPC_CLIENT_ALLOC (
  2235. IN size_t Size
  2236. );
  2237. typedef void __RPC_API
  2238. RPC_CLIENT_FREE (
  2239. IN void * Ptr
  2240. );
  2241. /*++
  2242. RpcSs* package
  2243. --*/
  2244. RPCRTAPI
  2245. void *
  2246. RPC_ENTRY
  2247. RpcSsAllocate (
  2248. IN size_t Size
  2249. );
  2250. RPCRTAPI
  2251. void
  2252. RPC_ENTRY
  2253. RpcSsDisableAllocate (
  2254. void
  2255. );
  2256. RPCRTAPI
  2257. void
  2258. RPC_ENTRY
  2259. RpcSsEnableAllocate (
  2260. void
  2261. );
  2262. RPCRTAPI
  2263. void
  2264. RPC_ENTRY
  2265. RpcSsFree (
  2266. IN void * NodeToFree
  2267. );
  2268. RPCRTAPI
  2269. RPC_SS_THREAD_HANDLE
  2270. RPC_ENTRY
  2271. RpcSsGetThreadHandle (
  2272. void
  2273. );
  2274. RPCRTAPI
  2275. void
  2276. RPC_ENTRY
  2277. RpcSsSetClientAllocFree (
  2278. IN RPC_CLIENT_ALLOC * ClientAlloc,
  2279. IN RPC_CLIENT_FREE * ClientFree
  2280. );
  2281. RPCRTAPI
  2282. void
  2283. RPC_ENTRY
  2284. RpcSsSetThreadHandle (
  2285. IN RPC_SS_THREAD_HANDLE Id
  2286. );
  2287. RPCRTAPI
  2288. void
  2289. RPC_ENTRY
  2290. RpcSsSwapClientAllocFree (
  2291. IN RPC_CLIENT_ALLOC * ClientAlloc,
  2292. IN RPC_CLIENT_FREE * ClientFree,
  2293. OUT RPC_CLIENT_ALLOC * * OldClientAlloc,
  2294. OUT RPC_CLIENT_FREE * * OldClientFree
  2295. );
  2296. /*++
  2297. RpcSm* package
  2298. --*/
  2299. RPCRTAPI
  2300. void *
  2301. RPC_ENTRY
  2302. RpcSmAllocate (
  2303. IN size_t Size,
  2304. OUT RPC_STATUS * pStatus
  2305. );
  2306. RPCRTAPI
  2307. RPC_STATUS
  2308. RPC_ENTRY
  2309. RpcSmClientFree (
  2310. IN void * pNodeToFree
  2311. );
  2312. RPCRTAPI
  2313. RPC_STATUS
  2314. RPC_ENTRY
  2315. RpcSmDestroyClientContext (
  2316. IN void * * ContextHandle
  2317. );
  2318. RPCRTAPI
  2319. RPC_STATUS
  2320. RPC_ENTRY
  2321. RpcSmDisableAllocate (
  2322. void
  2323. );
  2324. RPCRTAPI
  2325. RPC_STATUS
  2326. RPC_ENTRY
  2327. RpcSmEnableAllocate (
  2328. void
  2329. );
  2330. RPCRTAPI
  2331. RPC_STATUS
  2332. RPC_ENTRY
  2333. RpcSmFree (
  2334. IN void * NodeToFree
  2335. );
  2336. RPCRTAPI
  2337. RPC_SS_THREAD_HANDLE
  2338. RPC_ENTRY
  2339. RpcSmGetThreadHandle (
  2340. OUT RPC_STATUS * pStatus
  2341. );
  2342. RPCRTAPI
  2343. RPC_STATUS
  2344. RPC_ENTRY
  2345. RpcSmSetClientAllocFree (
  2346. IN RPC_CLIENT_ALLOC * ClientAlloc,
  2347. IN RPC_CLIENT_FREE * ClientFree
  2348. );
  2349. RPCRTAPI
  2350. RPC_STATUS
  2351. RPC_ENTRY
  2352. RpcSmSetThreadHandle (
  2353. IN RPC_SS_THREAD_HANDLE Id
  2354. );
  2355. RPCRTAPI
  2356. RPC_STATUS
  2357. RPC_ENTRY
  2358. RpcSmSwapClientAllocFree (
  2359. IN RPC_CLIENT_ALLOC * ClientAlloc,
  2360. IN RPC_CLIENT_FREE * ClientFree,
  2361. OUT RPC_CLIENT_ALLOC * * OldClientAlloc,
  2362. OUT RPC_CLIENT_FREE * * OldClientFree
  2363. );
  2364. /*++
  2365. Ndr stub entry points
  2366. --*/
  2367. RPCRTAPI
  2368. void
  2369. RPC_ENTRY
  2370. NdrRpcSsEnableAllocate(
  2371. PMIDL_STUB_MESSAGE pMessage );
  2372. RPCRTAPI
  2373. void
  2374. RPC_ENTRY
  2375. NdrRpcSsDisableAllocate(
  2376. PMIDL_STUB_MESSAGE pMessage );
  2377. RPCRTAPI
  2378. void
  2379. RPC_ENTRY
  2380. NdrRpcSmSetClientToOsf(
  2381. PMIDL_STUB_MESSAGE pMessage );
  2382. RPCRTAPI
  2383. void *
  2384. RPC_ENTRY
  2385. NdrRpcSmClientAllocate (
  2386. IN size_t Size
  2387. );
  2388. RPCRTAPI
  2389. void
  2390. RPC_ENTRY
  2391. NdrRpcSmClientFree (
  2392. IN void * NodeToFree
  2393. );
  2394. RPCRTAPI
  2395. void *
  2396. RPC_ENTRY
  2397. NdrRpcSsDefaultAllocate (
  2398. IN size_t Size
  2399. );
  2400. RPCRTAPI
  2401. void
  2402. RPC_ENTRY
  2403. NdrRpcSsDefaultFree (
  2404. IN void * NodeToFree
  2405. );
  2406. /****************************************************************************
  2407. end of memory package: rpc_ss_* rpc_sm_*
  2408. ****************************************************************************/
  2409. /****************************************************************************
  2410. * Full Pointer APIs
  2411. ****************************************************************************/
  2412. RPCRTAPI
  2413. PFULL_PTR_XLAT_TABLES
  2414. RPC_ENTRY
  2415. NdrFullPointerXlatInit(
  2416. unsigned long NumberOfPointers,
  2417. XLAT_SIDE XlatSide
  2418. );
  2419. RPCRTAPI
  2420. void
  2421. RPC_ENTRY
  2422. NdrFullPointerXlatFree(
  2423. PFULL_PTR_XLAT_TABLES pXlatTables
  2424. );
  2425. RPCRTAPI
  2426. int
  2427. RPC_ENTRY
  2428. NdrFullPointerQueryPointer(
  2429. PFULL_PTR_XLAT_TABLES pXlatTables,
  2430. void * pPointer,
  2431. unsigned char QueryType,
  2432. unsigned long * pRefId
  2433. );
  2434. RPCRTAPI
  2435. int
  2436. RPC_ENTRY
  2437. NdrFullPointerQueryRefId(
  2438. PFULL_PTR_XLAT_TABLES pXlatTables,
  2439. unsigned long RefId,
  2440. unsigned char QueryType,
  2441. void * * ppPointer
  2442. );
  2443. RPCRTAPI
  2444. void
  2445. RPC_ENTRY
  2446. NdrFullPointerInsertRefId(
  2447. PFULL_PTR_XLAT_TABLES pXlatTables,
  2448. unsigned long RefId,
  2449. void * pPointer
  2450. );
  2451. RPCRTAPI
  2452. int
  2453. RPC_ENTRY
  2454. NdrFullPointerFree(
  2455. PFULL_PTR_XLAT_TABLES pXlatTables,
  2456. void * Pointer
  2457. );
  2458. RPCRTAPI
  2459. void *
  2460. RPC_ENTRY
  2461. NdrAllocate(
  2462. PMIDL_STUB_MESSAGE pStubMsg,
  2463. size_t Len
  2464. );
  2465. RPCRTAPI
  2466. void
  2467. RPC_ENTRY
  2468. NdrClearOutParameters(
  2469. PMIDL_STUB_MESSAGE pStubMsg,
  2470. PFORMAT_STRING pFormat,
  2471. void * ArgAddr
  2472. );
  2473. /****************************************************************************
  2474. * Proxy APIs
  2475. ****************************************************************************/
  2476. RPCRTAPI
  2477. void *
  2478. RPC_ENTRY
  2479. NdrOleAllocate (
  2480. IN size_t Size
  2481. );
  2482. RPCRTAPI
  2483. void
  2484. RPC_ENTRY
  2485. NdrOleFree (
  2486. IN void * NodeToFree
  2487. );
  2488. #ifdef CONST_VTABLE
  2489. #define CONST_VTBL const
  2490. #else
  2491. #define CONST_VTBL
  2492. #endif
  2493. /****************************************************************************
  2494. * VC COM support
  2495. ****************************************************************************/
  2496. #ifndef DECLSPEC_SELECTANY
  2497. #if (_MSC_VER >= 1100)
  2498. #define DECLSPEC_SELECTANY __declspec(selectany)
  2499. #else
  2500. #define DECLSPEC_SELECTANY
  2501. #endif
  2502. #endif
  2503. #ifndef DECLSPEC_NOVTABLE
  2504. #if (_MSC_VER >= 1100) && defined(__cplusplus)
  2505. #define DECLSPEC_NOVTABLE __declspec(novtable)
  2506. #else
  2507. #define DECLSPEC_NOVTABLE
  2508. #endif
  2509. #endif
  2510. #ifndef DECLSPEC_UUID
  2511. #if (_MSC_VER >= 1100) && defined(__cplusplus)
  2512. #define DECLSPEC_UUID(x) __declspec(uuid(x))
  2513. #else
  2514. #define DECLSPEC_UUID(x)
  2515. #endif
  2516. #endif
  2517. #define MIDL_INTERFACE(x) struct DECLSPEC_UUID(x) DECLSPEC_NOVTABLE
  2518. #if _MSC_VER >= 1100
  2519. #define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) \
  2520. EXTERN_C const IID DECLSPEC_SELECTANY itf = {l1,s1,s2,{c1,c2,c3,c4,c5,c6,c7,c8}}
  2521. #else
  2522. #define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) EXTERN_C const IID itf
  2523. #endif
  2524. /****************************************************************************
  2525. * UserMarshal information
  2526. ****************************************************************************/
  2527. typedef struct _NDR_USER_MARSHAL_INFO_LEVEL1
  2528. {
  2529. void * Buffer;
  2530. unsigned long BufferSize;
  2531. void *(__RPC_API * pfnAllocate)(size_t);
  2532. void (__RPC_API * pfnFree)(void *);
  2533. struct IRpcChannelBuffer * pRpcChannelBuffer;
  2534. ULONG_PTR Reserved[5];
  2535. } NDR_USER_MARSHAL_INFO_LEVEL1;
  2536. #if !defined( RC_INVOKED )
  2537. #if _MSC_VER >= 1200
  2538. #pragma warning(push)
  2539. #endif
  2540. #pragma warning(disable:4201)
  2541. #endif
  2542. typedef struct _NDR_USER_MARSHAL_INFO
  2543. {
  2544. unsigned long InformationLevel;
  2545. union {
  2546. NDR_USER_MARSHAL_INFO_LEVEL1 Level1;
  2547. };
  2548. } NDR_USER_MARSHAL_INFO;
  2549. #if !defined( RC_INVOKED )
  2550. #if _MSC_VER >= 1200
  2551. #pragma warning(pop)
  2552. #else
  2553. #pragma warning(default:4201)
  2554. #endif
  2555. #endif
  2556. RPC_STATUS
  2557. RPC_ENTRY
  2558. NdrGetUserMarshalInfo (
  2559. IN unsigned long * pFlags,
  2560. IN unsigned long InformationLevel,
  2561. OUT NDR_USER_MARSHAL_INFO * pMarshalInfo
  2562. );
  2563. /****************************************************************************
  2564. * 64bit APIs
  2565. ****************************************************************************/
  2566. RPC_STATUS RPC_ENTRY
  2567. NdrCreateServerInterfaceFromStub(
  2568. IN struct IRpcStubBuffer* pStub,
  2569. IN OUT RPC_SERVER_INTERFACE *pServerIf );
  2570. /*
  2571. * Interpreter calls
  2572. */
  2573. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2574. NdrClientCall3(
  2575. MIDL_STUBLESS_PROXY_INFO *pProxyInfo,
  2576. unsigned long nProcNum,
  2577. void * pReturnValue,
  2578. ...
  2579. );
  2580. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2581. Ndr64AsyncClientCall(
  2582. MIDL_STUBLESS_PROXY_INFO *pProxyInfo,
  2583. unsigned long nProcNum,
  2584. void * pReturnValue,
  2585. ...
  2586. );
  2587. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2588. Ndr64DcomAsyncClientCall(
  2589. MIDL_STUBLESS_PROXY_INFO *pProxyInfo,
  2590. unsigned long nProcNum,
  2591. void * pReturnValue,
  2592. ...
  2593. );
  2594. struct IRpcStubBuffer; // Forward declaration
  2595. RPCRTAPI
  2596. void
  2597. RPC_ENTRY
  2598. Ndr64AsyncServerCall(
  2599. PRPC_MESSAGE pRpcMsg
  2600. );
  2601. RPCRTAPI
  2602. void
  2603. RPC_ENTRY
  2604. Ndr64AsyncServerCall64(
  2605. PRPC_MESSAGE pRpcMsg
  2606. );
  2607. RPCRTAPI
  2608. void
  2609. RPC_ENTRY
  2610. Ndr64AsyncServerCallAll(
  2611. PRPC_MESSAGE pRpcMsg
  2612. );
  2613. RPCRTAPI
  2614. long
  2615. RPC_ENTRY
  2616. Ndr64AsyncStubCall(
  2617. struct IRpcStubBuffer * pThis,
  2618. struct IRpcChannelBuffer * pChannel,
  2619. PRPC_MESSAGE pRpcMsg,
  2620. unsigned long * pdwStubPhase
  2621. );
  2622. /* async uuid */
  2623. RPCRTAPI
  2624. long
  2625. RPC_ENTRY
  2626. Ndr64DcomAsyncStubCall(
  2627. struct IRpcStubBuffer * pThis,
  2628. struct IRpcChannelBuffer * pChannel,
  2629. PRPC_MESSAGE pRpcMsg,
  2630. unsigned long * pdwStubPhase
  2631. );
  2632. RPCRTAPI
  2633. long
  2634. RPC_ENTRY
  2635. NdrStubCall3 (
  2636. struct IRpcStubBuffer * pThis,
  2637. struct IRpcChannelBuffer * pChannel,
  2638. PRPC_MESSAGE pRpcMsg,
  2639. unsigned long * pdwStubPhase
  2640. );
  2641. RPCRTAPI
  2642. void
  2643. RPC_ENTRY
  2644. NdrServerCallAll(
  2645. PRPC_MESSAGE pRpcMsg
  2646. );
  2647. RPCRTAPI
  2648. void
  2649. RPC_ENTRY
  2650. NdrServerCallNdr64(
  2651. PRPC_MESSAGE pRpcMsg
  2652. );
  2653. RPCRTAPI
  2654. void
  2655. RPC_ENTRY
  2656. NdrServerCall3(
  2657. PRPC_MESSAGE pRpcMsg
  2658. );
  2659. /* [partial_ignore] functions*/
  2660. RPCRTAPI
  2661. void
  2662. RPC_ENTRY
  2663. NdrPartialIgnoreClientMarshall(
  2664. PMIDL_STUB_MESSAGE pStubMsg,
  2665. void * pMemory
  2666. );
  2667. RPCRTAPI
  2668. void
  2669. RPC_ENTRY
  2670. NdrPartialIgnoreServerUnmarshall(
  2671. PMIDL_STUB_MESSAGE pStubMsg,
  2672. void ** ppMemory
  2673. );
  2674. RPCRTAPI
  2675. void
  2676. RPC_ENTRY
  2677. NdrPartialIgnoreClientBufferSize(
  2678. PMIDL_STUB_MESSAGE pStubMsg,
  2679. void * pMemory
  2680. );
  2681. RPCRTAPI
  2682. void
  2683. RPC_ENTRY
  2684. NdrPartialIgnoreServerInitialize(
  2685. PMIDL_STUB_MESSAGE pStubMsg,
  2686. void ** ppMemory,
  2687. PFORMAT_STRING pFormat
  2688. );
  2689. void RPC_ENTRY
  2690. RpcUserFree( handle_t AsyncHandle, void * pBuffer );
  2691. #ifdef __cplusplus
  2692. }
  2693. #endif
  2694. #include <poppack.h>
  2695. #endif /* __RPCNDR_H__ */