Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

581 lines
26 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. output.hxx
  5. Abstract:
  6. Prototypes for all output routines.
  7. Notes:
  8. History:
  9. Sep-18-1993 VibhasC Created.
  10. ----------------------------------------------------------------------------*/
  11. #ifndef __OUTPUT_HXX__
  12. #define __OUTPUT_HXX__
  13. #include "nodeskl.hxx"
  14. #include "ccb.hxx"
  15. #include "analysis.hxx"
  16. #include "expr.hxx"
  17. #include "makexpr.hxx"
  18. #include "prttype.hxx"
  19. #include "sdesc.hxx"
  20. #include "misccls.hxx"
  21. /*****************************************************************************
  22. local defines and includes.
  23. *****************************************************************************/
  24. #define STANDARD_STUB_TAB (4)
  25. #define NC_SIZE_RTN_NAME 0
  26. #define NC_MARSHALL_RTN_NAME 1
  27. #define NC_UNMARSHALL_RTN_NAME 2
  28. #define NC_MEMSIZE_RTN_NAME 3
  29. #define NC_FREE_RTN_NAME 4
  30. enum GUIDFORMAT
  31. {
  32. GUIDFORMAT_RAW = 0, // Raw values (e.g. 0x0000,0x0000,...)
  33. GUIDFORMAT_STRUCT = 1 // Struct init (e.g. {0x0000,0x0000,...})
  34. };
  35. /*****************************************************************************
  36. prototypes.
  37. *****************************************************************************/
  38. inline
  39. void Out_IndentInc( CCB * pCCB )
  40. {
  41. pCCB->GetStream()->IndentInc();
  42. }
  43. inline
  44. void Out_IndentDec( CCB * pCCB )
  45. {
  46. pCCB->GetStream()->IndentDec();
  47. }
  48. void Out_AddToBufferPointer(
  49. CCB * pCCB,
  50. expr_node * pResource,
  51. expr_node * pAmountExpr );
  52. void Out_MarshallSimple( CCB * pCCB,
  53. RESOURCE * pResource,
  54. node_skl * pType,
  55. expr_node * pSource,
  56. BOOL fIncr,
  57. unsigned short Size
  58. );
  59. void Out_ClientProcedureProlog( CCB * pCCB, node_skl * pType );
  60. void Out_ServerProcedureProlog( CCB * pCCB,
  61. node_skl * pType,
  62. ITERATOR& LocalsList,
  63. ITERATOR& ParamsList,
  64. ITERATOR& TransientList
  65. );
  66. void Out_ProcedureProlog( CCB * pCCB,
  67. PNAME pProcName,
  68. node_skl * pType,
  69. ITERATOR& LocalsList,
  70. ITERATOR& ParamsList,
  71. ITERATOR& TransientList
  72. );
  73. void Out_CallManager( CCB * pCCB,
  74. expr_proc_call * pExpr,
  75. expr_node * pReturn,
  76. BOOL fIsCallback );
  77. inline
  78. void Out_ProcClosingBrace( CCB * pCCB )
  79. {
  80. pCCB->GetStream()->NewLine();
  81. pCCB->GetStream()->Write( '}' );
  82. pCCB->GetStream()->NewLine();
  83. }
  84. void Out_StubDescriptor( CG_HANDLE * pImplicitHandle,
  85. CCB * pCCB );
  86. void Out_ClientLocalVariables( CCB * pCCB,
  87. ITERATOR& LocalVarList );
  88. void Out_HandleInitialize(
  89. CCB * pCCB,
  90. ITERATOR& BindingParamList,
  91. expr_node * pAssignExpr,
  92. BOOL fAuto,
  93. unsigned short OpBits
  94. );
  95. void Out_AutoHandleSendReceive( CCB * pCCB,
  96. expr_node * pDest,
  97. expr_node * pProc
  98. );
  99. void Out_NormalSendReceive( CCB * pCCB, BOOL fAnyOuts );
  100. void Out_NormalFreeBuffer( CCB * pCCB );
  101. void Out_IncludeOfFile( CCB * pCCB, PFILENAME p, BOOL fAngleBracket );
  102. void Out_EP_Info( CCB * pCCB, ITERATOR * I );
  103. void Out_MKTYPLIB_Guid( CCB *pCCB,
  104. GUID_STRS & GStrs,
  105. char * szPrefix,
  106. char * szName );
  107. void Out_Guid( CCB *pCCB,
  108. GUID_STRS & GStrs,
  109. GUIDFORMAT format = GUIDFORMAT_STRUCT );
  110. void Out_IFInfo(
  111. CCB * pCCB,
  112. char * pCIntInfoTypeName,
  113. char * pCIntInfoVarName,
  114. char * pCIntInfoSizeOfString,
  115. GUID_STRS & UserGuidStrs,
  116. unsigned short UserMajor,
  117. unsigned short UserMinor,
  118. // GUID_STRS & XferGuidStrs,
  119. // unsigned short XferSynMajor,
  120. // unsigned short XferSynMinor,
  121. char * pCallbackDispatchTable,
  122. int ProtSeqEpCount,
  123. char * ProtSeqEPTypeName,
  124. char * ProtSeqEPVarName,
  125. BOOL fNoDefaultEpv,
  126. BOOL fSide,
  127. BOOL fHasPipes
  128. );
  129. void Out_OneSyntaxInfo( CCB * pCCB,
  130. BOOL IsForCallback,
  131. SYNTAX_ENUM syntaxType );
  132. void Out_TransferSyntax(
  133. CCB *pCCB,
  134. GUID_STRS & XferGuidStr,
  135. unsigned short XferSynMajor,
  136. unsigned short XferSynMinor );
  137. void Out_DispatchTableStuff( CCB * pCCB,
  138. ITERATOR& ProcList,
  139. short CountOfProcs );
  140. void Out_ManagerEpv( CCB * pCCB,
  141. PNAME InterfaceName,
  142. ITERATOR& ProcList,
  143. short Count);
  144. void Out_ServerStubMessageInit( CCB * pCCB );
  145. void Out_FormatInfoExtern( CCB * pCCB );
  146. void Out_TypeFormatStringExtern( CCB * pCCB );
  147. void Out_ProcFormatStringExtern( CCB * pCCB );
  148. void Out_StubDescriptorExtern( CCB * pCCB );
  149. void Out_ProxyInfoExtern( CCB * pCCB );
  150. void Out_InterpreterServerInfoExtern( CCB * pCCB );
  151. void Out_NdrInitStackTop( CCB * pCCB );
  152. void Out_NdrMarshallCall( CCB * pCCB,
  153. char * pRoutineName,
  154. char * pParamName,
  155. long FormatStringOffset,
  156. BOOL fTakeAddress,
  157. BOOL fDereference );
  158. void Out_NdrUnmarshallCall( CCB * pCCB,
  159. char * pRoutineName,
  160. char * pParamName,
  161. long FormatStringOffset,
  162. BOOL fTakeAddress,
  163. BOOL fMustAllocFlag );
  164. void Out_NdrBufferSizeCall( CCB * pCCB,
  165. char * pRoutineName,
  166. char * pParamName,
  167. long FormatStringOffset,
  168. BOOL fTakeAddress,
  169. BOOL fDereference,
  170. BOOL fPtrToStubMsg );
  171. void Out_NdrFreeCall( CCB * pCCB,
  172. char * pRoutineName,
  173. char * pParamName,
  174. long FormatStringOffset,
  175. BOOL fTakeAddress,
  176. BOOL fDereference );
  177. void Out_NdrConvert( CCB * pCCB,
  178. long FormatStringOffset,
  179. long ParamTotal,
  180. unsigned short ProcOptimFlags );
  181. void Out_NdrNsGetBuffer( CCB * pCCB );
  182. void Out_NdrGetBuffer( CCB * pCCB );
  183. void Out_NdrNsSendReceive( CCB * pCCB );
  184. void Out_NdrSendReceive( CCB * pCCB );
  185. void Out_NdrFreeBuffer( CCB * pCCB );
  186. void Out_FreeParamInline( CCB * pCCB );
  187. void Out_CContextHandleMarshall( CCB * pCCB,
  188. char * pName,
  189. BOOL IsPointer );
  190. void Out_SContextHandleMarshall( CCB * pCCB,
  191. char * pName,
  192. char * pRundownRoutineName );
  193. void Out_SContextHandleNewMarshall( CCB * pCCB,
  194. char * pName,
  195. char * pRundownRoutineName,
  196. long TypeOffset );
  197. void Out_CContextHandleUnmarshall( CCB * pCCB,
  198. char * pName,
  199. BOOL IsPointer,
  200. BOOL IsReturn );
  201. void Out_SContextHandleUnmarshall( CCB * pCCB,
  202. char * pName,
  203. BOOL IsOutOnly );
  204. void Out_SContextHandleNewUnmarshall( CCB * pCCB,
  205. char * pName,
  206. BOOL IsOutOnly,
  207. long TypeOffset );
  208. void Out_DispatchTableTypedef( CCB * pCCB,
  209. PNAME pInterfaceName,
  210. ITERATOR &ProcNodeList,
  211. int flag );
  212. void Out_GenHdlPrototypes( CCB * pCCB,
  213. ITERATOR& List
  214. );
  215. void Out_CtxtHdlPrototypes( CCB * pCCB,
  216. ITERATOR& List
  217. );
  218. void Out_PatchReference( CCB * pCCB,
  219. expr_node * pDest,
  220. expr_node * pSource,
  221. BOOL fIncr );
  222. void Out_If( CCB * pCCB, expr_node * pExpr );
  223. void Out_Else( CCB * pCCB );
  224. void Out_Endif( CCB * pCCB );
  225. void Out_UniquePtrMarshall( CCB * pCCB,
  226. expr_node * pDest,
  227. expr_node * pSrc );
  228. void Out_IfUniquePtrInBuffer( CCB * pCCB,
  229. expr_node * pSrc );
  230. void Out_Assign( CCB * pCCB,
  231. expr_node * pDest,
  232. expr_node * pSrc );
  233. void Out_Memcopy( CCB * pCCB,
  234. expr_node * pDest,
  235. expr_node * pSrc,
  236. expr_node * pLength );
  237. void Out_strlen( CCB * pCCB,
  238. expr_node * pDest,
  239. expr_node * pSource,
  240. unsigned short Size );
  241. void Out_For( CCB * pCCB,
  242. expr_node * pIndexExpr,
  243. expr_node * pInitialExpr,
  244. expr_node * pFinalExpr,
  245. expr_node * pIncrExpr );
  246. void Out_EndFor( CCB * pCCB );
  247. void Out_UPDecision(
  248. CCB * pCCB,
  249. expr_node * pPtrInBuffer,
  250. expr_node * pPtrInMemory );
  251. void Out_TLUPDecision(
  252. CCB * pCCB,
  253. expr_node * pPtrInBuffer,
  254. expr_node * pPtrInMemory );
  255. void Out_IfAlloc(
  256. CCB * pCCB,
  257. expr_node * pPtrInMemory,
  258. expr_node * pBuffer,
  259. expr_node * pExprCount );
  260. void Out_If_IfAlloc(
  261. CCB * pCCB,
  262. expr_node * pPtrInMemory,
  263. expr_node * pBuffer,
  264. expr_node * pExprCount );
  265. void Out_If_IfAllocRef(
  266. CCB * pCCB,
  267. expr_node * pPtrInMemory,
  268. expr_node * pBuffer,
  269. expr_node * pExprCount );
  270. void Out_Alloc(
  271. CCB * pCCB,
  272. expr_node * pPtrInMemory,
  273. expr_node * pBuffer,
  274. expr_node * pExprCount );
  275. void Out_IfAllocSet(
  276. CCB * pCCB,
  277. expr_node * pPtrInMemory,
  278. expr_node * pBuffer,
  279. expr_node * pExprCount );
  280. void Out_AllocSet(
  281. CCB * pCCB,
  282. expr_node * pPtrInMemory,
  283. expr_node * pBuffer,
  284. expr_node * pExprCount );
  285. void Out_IfCopy(
  286. CCB * pCCB,
  287. expr_node * pPtrInMemory,
  288. expr_node * pBuffer,
  289. expr_node * pExprCount );
  290. void Out_Copy(
  291. CCB * pCCB,
  292. expr_node * pPtrInMemory,
  293. expr_node * pBuffer,
  294. expr_node * pExprCount,
  295. expr_node * pAssign );
  296. void Out_IfAllocCopy(
  297. CCB * pCCB,
  298. expr_node * pPtrInMemory,
  299. expr_node * pBuffer,
  300. expr_node * pExprCount );
  301. void Out_AllocCopy(
  302. CCB * pCCB,
  303. expr_node * pPtrInMemory,
  304. expr_node * pBuffer,
  305. expr_node * pExprCount );
  306. void Out_ConfStringHdr(
  307. CCB * pCCB,
  308. expr_node * pDest,
  309. expr_node * pExprSize,
  310. expr_node * pExprLength,
  311. BOOL fMarsh );
  312. void Out_Copy(
  313. CCB * pCCB,
  314. expr_node * pDest,
  315. expr_node * pSource,
  316. expr_node * pExprCount,
  317. expr_node * pAssign );
  318. void Out_CContextMarshall(
  319. CCB * pCCB,
  320. expr_node * pDest,
  321. expr_node * pSource );
  322. void Out_CContextUnMarshall(
  323. CCB * pCCB,
  324. expr_node * pDest,
  325. expr_node * pSource,
  326. expr_node * pHandle,
  327. expr_node * pDRep );
  328. void Out_SContextMarshall(
  329. CCB * pCCB,
  330. expr_node * pDest,
  331. expr_node * pSource,
  332. expr_node * pRDRtn );
  333. void Out_SContextUnMarshall(
  334. CCB * pCCB,
  335. expr_node * pDest,
  336. expr_node * pSource,
  337. expr_node * pDRep );
  338. void Out_RaiseException( CCB * pCCB,
  339. PNAME pExceptionNameVarExpression );
  340. void Out_PlusEquals( CCB * pCCB,
  341. expr_node * pLHS,
  342. expr_node * pRHS );
  343. void Out_IfFree( CCB * pCCB,
  344. expr_node * pSrc );
  345. void Out_RpcTryFinally( CCB * pCCB );
  346. void Out_RpcFinally( CCB * pCCB );
  347. void Out_RpcEndFinally( CCB * pCCB );
  348. void Out_RpcTryExcept( CCB * pCCB );
  349. void Out_RpcExcept( CCB * pCCB,
  350. char * pFilterString );
  351. void Out_RpcEndExcept( CCB * pCCB );
  352. void Out_CallNdrMapCommAndFaultStatus( CCB * pCCB,
  353. expr_node * pAddOfStubMsg,
  354. expr_node * StatRes,
  355. expr_node * pCommExpr,
  356. expr_node * pFaultExpr );
  357. void Out_CallToXmit( CCB * pCCB,
  358. PNAME PresentedName,
  359. expr_node * pPresented,
  360. expr_node * pTransmitted );
  361. void Out_CallFreeXmit( CCB * pCCB,
  362. PNAME PresentedName,
  363. expr_node * Xmitted );
  364. void Out_CallFromXmit( CCB * pCCB,
  365. PNAME PresentedName,
  366. expr_node * pPresented,
  367. expr_node * pXmitted );
  368. void Out_CallFreeInst( CCB * pCCB,
  369. PNAME PresentedName,
  370. expr_node * pPresented );
  371. void Out_TransmitAsPrototypes( CCB * pCCB,
  372. ITERATOR& ListOfPresentedTypes );
  373. void Out_RepAsPrototypes( CCB * pCCB,
  374. ITERATOR& ListOfPresentedTypes );
  375. void Out_UserMarshalPrototypes( CCB * pCCB,
  376. ITERATOR& ListOfPresentedTypes );
  377. void Out_CSSizingAndConversionPrototypes( CCB * pCCB,
  378. ITERATOR& ListOfCSTypes );
  379. void Out_Comment( CCB * pCCB, char * pComment );
  380. void Out_TLUPDecisionBufferOnly( CCB * pCCB,
  381. expr_node * pPtrInBuffer,
  382. expr_node * pPtrInMemory );
  383. void Out_StringMarshall( CCB * pCCB,
  384. expr_node * pMemory,
  385. expr_node * pCount,
  386. expr_node * pSize );
  387. void Out_StringUnMarshall( CCB * pCCB,
  388. expr_node * pMemory,
  389. expr_node * pSize );
  390. void Out_StructSizingCall( CCB * pCCB,
  391. expr_node * pSource,
  392. expr_node * pLengthVar );
  393. void Out_StructMarshallCall( CCB * pCCB,
  394. expr_node * pSrc,
  395. expr_node * pPtrInBuffer );
  396. void Out_FullPointerInit( CCB * pCCB );
  397. void Out_FullPointerFree( CCB * pCCB );
  398. char * MakeRtnName( char * pBuffer, char * pName, int Code );
  399. void Out_RpcSSEnableAllocate( CCB * pCCB );
  400. void Out_RpcSSDisableAllocate( CCB * pCCB );
  401. void Out_RpcSSSetClientToOsf( CCB * pCCB );
  402. void Out_MemsetToZero( CCB * pCCB,
  403. expr_node * pDest,
  404. expr_node * pSize );
  405. void Out_IID(CCB *pCCB);
  406. void Out_CLSID(CCB *pCCB);
  407. void Out_CallAsProxyPrototypes(CCB *pCCB, ITERATOR & ListOfCallAsRoutines);
  408. void Out_CallAsServerPrototypes(CCB *pCCB, ITERATOR & ListOfCallAsRoutines);
  409. void Out_CallMemberFunction( CCB * pCCB,
  410. expr_proc_call * pProcExpr,
  411. expr_node * pRet,
  412. BOOL fThunk );
  413. void Out_SetOperationBits( CCB * pCCB, unsigned int OpBits);
  414. void Out_TypeAlignSizePrototypes( CCB * pCCB, ITERATOR& List );
  415. void Out_TypeEncodePrototypes( CCB * pCCB, ITERATOR& List );
  416. void Out_TypeDecodePrototypes( CCB * pCCB, ITERATOR& List );
  417. void Out_TypeFreePrototypes( CCB * pCCB, ITERATOR& List );
  418. void OutputNdrAlignment( CCB * pCCB, unsigned short Align );
  419. void Out_NotifyPrototypes( CCB * pCCB,
  420. ITERATOR& ListOfNotifyRoutines );
  421. void Out_MultiDimVars( CCB * pCCB, CG_PARAM * pParam );
  422. void Out_MultiDimVarsInit( CCB * pCCB, CG_PARAM * pParam );
  423. void Out_CheckUnMarshallPastBufferEnd( CCB * pCCB, ulong size = 0 );
  424. void Out_NotifyTable ( CCB* pCCB );
  425. void Out_NotifyTableExtern ( CCB* pCCB );
  426. void Out_TypePicklingInfo( CCB* pCCB);
  427. void Out_PartialIgnoreClientMarshall( CCB *pCCB, char *pParamName );
  428. void Out_PartialIgnoreServerUnmarshall( CCB *pCCB, char *pParamName );
  429. void Out_PartialIgnoreClientBufferSize( CCB *pCCB, char *pParamName );
  430. void Out_PartialIgnoreServerInitialize( CCB *pCCB, char *pParamName, long FormatStringOffset );
  431. #endif // __OUTPUT_HXX__