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.

1043 lines
27 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. misccls.hxx
  5. Abstract:
  6. cg classes for miscellaneous nodes.
  7. Notes:
  8. History:
  9. ----------------------------------------------------------------------------*/
  10. #ifndef __MISCCLS_HXX__
  11. #define __MISCCLS_HXX__
  12. #include "ndrcls.hxx"
  13. #include "auxcls.hxx"
  14. #include "bindcls.hxx"
  15. class node_file;
  16. class node_interface;
  17. class node_source;
  18. class CG_INTERFACE : public CG_NDR
  19. {
  20. private:
  21. //
  22. // CG nodes for the implicit handle, if any...
  23. //
  24. CG_HANDLE * pImpHdlCG;
  25. //
  26. // Store the Protseq endpoint count. This count is 0 if the
  27. // endpoint attribute was not specified.
  28. //
  29. short ProtSeqEPCount;
  30. //
  31. // flags.
  32. //
  33. BOOL fMopsPresent : 1;
  34. BOOL fCallbacksPresent : 1;
  35. BOOL fAllRpcSS : 1;
  36. BOOL fUsesRpcSS : 1;
  37. BOOL fHasPipes : 1;
  38. BOOL fTypeInfoInitialized: 1;
  39. BOOL fHasMSConfStructAttr: 1;
  40. NdrVersionControl VersionControl; // compiler evaluation
  41. //
  42. // This set of fields gathers info about dispatch tables. There is a
  43. // normal dispatch table and a callback dispatch table. We keep separate
  44. // dictionaries for these dispatch tables.
  45. //
  46. DISPATCH_TABLE * pNormalDispatchTable;
  47. DISPATCH_TABLE * pCallbackDispatchTable;
  48. DISPATCH_TABLE ** ppDispatchTable;
  49. DISPATCH_TABLE ** ppDispatchTableSaved;
  50. void * _pCTI;
  51. protected:
  52. char* pStubDescName; // Interface's stub descriptor name.
  53. char* pSyntaxInfoName; // name for MIDL_SYNTAX_INFO of this interface
  54. char* pProxyInfoName; // name for MIDL_STUBLESS_PROXY_INFO
  55. GUID_STRS GuidStrs; // Store the 5 are components of the guid.
  56. char* pIntfName; // handy place to cache the interface name
  57. BOOL fVisited; // used when enumerating all base classes
  58. BOOL fLocal : 1; // whether intf is local
  59. CG_INTERFACE* pCGBase;
  60. public:
  61. //
  62. // The constructor.
  63. //
  64. CG_INTERFACE(
  65. node_interface * pI,
  66. GUID_STRS GStrs,
  67. BOOL CallbacksYes,
  68. BOOL fMopsYes,
  69. CG_HANDLE * pIH,
  70. CG_INTERFACE* pIFBase
  71. );
  72. //
  73. // code generation methods.
  74. //
  75. CG_INTERFACE * SetBaseInterfaceCG( CG_INTERFACE * pCG )
  76. {
  77. return ( pCGBase = pCG );
  78. }
  79. CG_INTERFACE * GetBaseInterfaceCG()
  80. {
  81. return pCGBase;
  82. }
  83. unsigned long LayOut();
  84. virtual
  85. ID_CG GetCGID()
  86. {
  87. return ID_CG_INTERFACE;
  88. }
  89. virtual
  90. void Visit( CG_VISITOR *pVisitor )
  91. {
  92. pVisitor->Visit( this );
  93. }
  94. // interfaces in the current file that are [local] are delegated
  95. virtual
  96. BOOL IsDelegated()
  97. {
  98. return fLocal;
  99. }
  100. virtual
  101. BOOL IsObject()
  102. {
  103. return FALSE;
  104. }
  105. virtual
  106. BOOL IsIUnknown()
  107. {
  108. return FALSE;
  109. }
  110. BOOL IsDispatchable(BOOL fInTypeLib)
  111. {
  112. CG_CLASS * pCG;
  113. named_node * pBaseIntf;
  114. if (0 == _stricmp("IDispatch", pIntfName ) )
  115. {
  116. return TRUE;
  117. }
  118. else
  119. if (0 == _stricmp("IUnknown", pIntfName ) )
  120. {
  121. return FALSE;
  122. }
  123. else
  124. {
  125. node_skl * pType = GetType();
  126. if (pBaseIntf = ((node_interface *)(pType))->GetMyBaseInterfaceReference())
  127. {
  128. node_interface_reference * pRef = (node_interface_reference *)pBaseIntf;
  129. // skip forward reference if necessary
  130. if (pRef->NodeKind() == NODE_FORWARD)
  131. {
  132. pRef = (node_interface_reference *)pRef->GetChild();
  133. }
  134. pCG = ((node_interface *)(pRef->GetChild()))->GetCG( fInTypeLib );
  135. return ((CG_INTERFACE *)pCG)->IsDispatchable(fInTypeLib);
  136. }
  137. else
  138. return FALSE;
  139. }
  140. }
  141. char * GetInterfaceName()
  142. {
  143. return pIntfName;
  144. }
  145. virtual
  146. CG_STATUS GenClientInfo( CCB * pCCB );
  147. virtual
  148. CG_STATUS OutputClientStub( CCB * pCCB );
  149. virtual
  150. CG_STATUS GenServerInfo( CCB * pCCB );
  151. virtual
  152. CG_STATUS OutputServerStub( CCB * pCCB );
  153. void OutputComplexReturnThunks( CCB * pCCB );
  154. virtual
  155. CG_STATUS GenHeader( CCB * pCCB );
  156. virtual
  157. CG_STATUS GenProxyInfo( CCB *pCCB,
  158. BOOL IsForCallback );
  159. virtual
  160. CG_STATUS GenSyntaxInfo( CCB *pCCB,
  161. BOOL IsForCallback);
  162. virtual
  163. void Out_InterpreterServerInfo( CCB * pCCB,
  164. CGSIDE Side );
  165. virtual
  166. void Out_ServerInfo(CCB *pCCB,
  167. BOOL fHasThunk,
  168. BOOL IsForCallback );
  169. virtual
  170. void Out_ProxyInfo( CCB * pCCB,
  171. BOOL IsForCallback );
  172. //
  173. // Generate typeinfo
  174. //
  175. virtual
  176. CG_STATUS GenTypeInfo( CCB * pCCB);
  177. //
  178. // only create a typeinfo
  179. //
  180. virtual
  181. CG_STATUS CreateTypeInfo( CCB * pCCB);
  182. //
  183. // Get And set methods.
  184. //
  185. CG_HANDLE * GetImplicitHandle()
  186. {
  187. return pImpHdlCG;
  188. }
  189. char * GetStubDescName()
  190. {
  191. return pStubDescName;
  192. }
  193. char * GetProxyInfoName()
  194. {
  195. return pProxyInfoName;
  196. }
  197. char * GetMulSyntaxInfoName()
  198. {
  199. return pSyntaxInfoName;
  200. }
  201. BOOL SetAllRpcSS( BOOL f )
  202. {
  203. return (fAllRpcSS = f);
  204. }
  205. BOOL IsAllRpcSS()
  206. {
  207. return fAllRpcSS;
  208. }
  209. void SetUsesRpcSS( BOOL f )
  210. {
  211. fUsesRpcSS = f;
  212. }
  213. BOOL GetUsesRpcSS()
  214. {
  215. return fUsesRpcSS;
  216. }
  217. BOOL SetHasPipes( BOOL f )
  218. {
  219. return (fHasPipes = f);
  220. }
  221. BOOL HasPipes()
  222. {
  223. return fHasPipes;
  224. }
  225. NdrVersionControl & GetNdrVersionControl()
  226. {
  227. return( VersionControl );
  228. }
  229. virtual
  230. void EvaluateVersionControl();
  231. virtual
  232. BOOL HasStublessProxies()
  233. {
  234. return FALSE;
  235. }
  236. BOOL HasItsOwnOi2();
  237. virtual
  238. BOOL HasOi2()
  239. {
  240. return VersionControl.HasOi2();
  241. }
  242. //
  243. // Dispatch table management functions.
  244. //
  245. void CreateDispatchTables();
  246. void SetDispatchTBLPtrForCallback()
  247. {
  248. ppDispatchTable = &pCallbackDispatchTable;
  249. }
  250. void RestoreDispatchTBLPtr()
  251. {
  252. ppDispatchTable = &pNormalDispatchTable;
  253. }
  254. void RegisterProcedure( node_skl * pProc,
  255. DISPATCH_TABLE_FLAGS Flags )
  256. {
  257. (*ppDispatchTable)->RegisterProcedure(pProc, Flags);
  258. }
  259. unsigned short GetNormalProcedureCount()
  260. {
  261. return pNormalDispatchTable->GetCount();
  262. }
  263. unsigned short GetCallbackProcedureCount()
  264. {
  265. return pCallbackDispatchTable->GetCount();
  266. }
  267. unsigned short GetNormalProcedureList(
  268. ITERATOR& NormalProcList,
  269. DISPATCH_TABLE_FLAGS Flags
  270. )
  271. {
  272. return pNormalDispatchTable->GetProcList(
  273. NormalProcList,
  274. Flags
  275. );
  276. }
  277. unsigned short GetCallbackProcedureList(
  278. ITERATOR& CallbackProcList,
  279. DISPATCH_TABLE_FLAGS Flags )
  280. {
  281. return pCallbackDispatchTable->GetProcList(
  282. CallbackProcList,
  283. Flags
  284. );
  285. }
  286. //
  287. // miscellaneous methods.
  288. //
  289. ITERATOR * GetProtSeqEps();
  290. char * GetCBDispatchTableName()
  291. {
  292. return 0;
  293. }
  294. char * GetMopIInfoName()
  295. {
  296. return 0;
  297. }
  298. BOOL HasInterpretedProc();
  299. BOOL HasOnlyInterpretedProcs();
  300. BOOL HasInterpretedCallbackProc();
  301. BOOL HasClientInterpretedCommOrFaultProc(
  302. CCB * pCCB );
  303. BOOL IsLastInterface()
  304. {
  305. return ( NULL == GetSibling() );
  306. }
  307. CG_STATUS InitializeCCB( CCB * pCCB );
  308. void Out_ProcOffsetTable( CCB *pCCB, BOOL IsForCallback = FALSE );
  309. void OutputProcOffsets( CCB * pCCB, BOOL fLast, BOOL IsForCallback );
  310. void OutputThunkTableEntries( CCB * pCCB, BOOL fLast );
  311. virtual
  312. node_skl * GetThisDeclarator()
  313. {
  314. return NULL;
  315. }
  316. void GetMyMemberFunctions( ITERATOR & I )
  317. {
  318. GetMembers( I );
  319. }
  320. void GetMyMemberFunctions( CG_ITERATOR & I )
  321. {
  322. GetMembers( I );
  323. }
  324. virtual
  325. void GetAllMemberFunctions( ITERATOR & I )
  326. {
  327. GetMyMemberFunctions( I );
  328. }
  329. BOOL HasPicklingStuff()
  330. {
  331. CG_ITERATOR I;
  332. CG_NDR * pCG;
  333. if( GetMembers( I ) )
  334. {
  335. while( ITERATOR_GETNEXT( I, pCG ) )
  336. {
  337. if (pCG->GetCGID() == ID_CG_ENCODE_PROC ||
  338. pCG->GetCGID() == ID_CG_TYPE_ENCODE_PROC
  339. )
  340. return TRUE;
  341. }
  342. }
  343. return FALSE;
  344. }
  345. BOOL HasPicklingStuffOnly()
  346. {
  347. CG_ITERATOR I;
  348. CG_NDR * pCG;
  349. if( GetMembers( I ) )
  350. {
  351. while( ITERATOR_GETNEXT( I, pCG ) )
  352. {
  353. if (pCG->GetCGID() != ID_CG_ENCODE_PROC &&
  354. pCG->GetCGID() != ID_CG_TYPE_ENCODE_PROC
  355. )
  356. return FALSE;
  357. }
  358. return TRUE;
  359. }
  360. return FALSE;
  361. }
  362. virtual
  363. void GetListOfUniqueBaseInterfaces( ITERATOR & )
  364. {
  365. }
  366. void MarkVisited( BOOL fMark )
  367. {
  368. fVisited = fMark;
  369. }
  370. BOOL IsVisited()
  371. {
  372. return fVisited;
  373. }
  374. void GetGuidStrs( char * &p1,
  375. char * &p2,
  376. char * &p3,
  377. char * &p4,
  378. char * &p5 )
  379. {
  380. GuidStrs.GetStrs( p1, p2, p3, p4, p5 );
  381. }
  382. GUID_STRS & GetGuidStrs()
  383. {
  384. return GuidStrs;
  385. }
  386. void OutputInterfaceIdComment( CCB * pCCB );
  387. void SetHasMSConfStructAttr() { fHasMSConfStructAttr = TRUE; }
  388. BOOL GetHasMSConfStructAttr() { return fHasMSConfStructAttr; }
  389. };
  390. class CG_OBJECT_INTERFACE : public CG_INTERFACE
  391. {
  392. // a node_id declaration for the this pointer for this interface
  393. node_skl * pThisDeclarator;
  394. BOOL fForcedDelegation; // some weird cases
  395. public:
  396. //
  397. // The constructor.
  398. //
  399. CG_OBJECT_INTERFACE(
  400. node_interface * pI,
  401. GUID_STRS GStrs,
  402. BOOL fCallbacksYes,
  403. BOOL fMopsYes,
  404. CG_OBJECT_INTERFACE * pBCG
  405. );
  406. //
  407. // code generation methods.
  408. //
  409. virtual
  410. ID_CG GetCGID()
  411. {
  412. return ID_CG_OBJECT_INTERFACE;
  413. }
  414. virtual
  415. void Visit( CG_VISITOR *pVisitor )
  416. {
  417. pVisitor->Visit( this );
  418. }
  419. virtual
  420. BOOL IsObject()
  421. {
  422. return TRUE;
  423. }
  424. // interfaces in the current file that are [local] are delegated
  425. virtual
  426. BOOL IsDelegated()
  427. {
  428. return fLocal;
  429. }
  430. BOOL HasForcedDelegation()
  431. {
  432. return fForcedDelegation;
  433. }
  434. void SetHasForcedDelegation()
  435. {
  436. fForcedDelegation = 1;
  437. }
  438. CG_OBJECT_INTERFACE * GetDelegatedInterface()
  439. {
  440. CG_INTERFACE* pBaseIF = GetBaseInterfaceCG();
  441. while ( pBaseIF != 0 )
  442. {
  443. if ( pBaseIF->IsDelegated() )
  444. return (CG_OBJECT_INTERFACE*) pBaseIF;
  445. pBaseIF = pBaseIF->GetBaseInterfaceCG();
  446. }
  447. return NULL;
  448. }
  449. BOOL IsLastObjectInterface();
  450. BOOL HasOnlyInterpretedMethods();
  451. BOOL IsLocal()
  452. {
  453. return fLocal;
  454. }
  455. BOOL HasItsOwnStublessProxies();
  456. virtual
  457. void EvaluateVersionControl();
  458. virtual
  459. BOOL HasStublessProxies()
  460. {
  461. return GetNdrVersionControl()
  462. .HasStublessProxies();
  463. }
  464. virtual
  465. CG_STATUS GenProxy( CCB * pCCB );
  466. virtual
  467. CG_STATUS OutputProxy( CCB * pCCB );
  468. virtual
  469. CG_STATUS GenHeader( CCB * pCCB );
  470. //
  471. // miscellaneous methods.
  472. //
  473. CG_STATUS CPlusPlusLanguageBinding(CCB *pCCB);
  474. CG_STATUS CLanguageBinding(CCB *pCCB);
  475. CG_STATUS ProxyPrototypes(CCB *pCCB);
  476. CG_STATUS GenInterfaceProxy( CCB *pCCB, unsigned long index);
  477. CG_STATUS GenInterfaceStub( CCB *pCCB, unsigned long index);
  478. unsigned long CountMemberFunctions();
  479. unsigned long PrintProxyMemberFunctions( ISTREAM * pStream,
  480. BOOL fForcesDelegation );
  481. unsigned long PrintStubMemberFunctions( ISTREAM * pStream );
  482. STATUS_T PrintVtableEntries( CCB * pCCB );
  483. STATUS_T PrintMemberFunctions( ISTREAM * pStream,
  484. BOOL fAbstract = TRUE );
  485. virtual
  486. node_skl * GetThisDeclarator()
  487. {
  488. return pThisDeclarator;
  489. }
  490. virtual
  491. void GetAllMemberFunctions( ITERATOR & I )
  492. {
  493. CG_OBJECT_INTERFACE* pBaseCG = (CG_OBJECT_INTERFACE*)GetBaseInterfaceCG();
  494. if ( pBaseCG )
  495. pBaseCG->GetAllMemberFunctions( I );
  496. GetMyMemberFunctions( I );
  497. }
  498. CG_STATUS CLanguageMacros(CCB *pCCB);
  499. CG_STATUS PrintCMacros(CCB *pCCB);
  500. };
  501. class CG_INHERITED_OBJECT_INTERFACE : public CG_OBJECT_INTERFACE
  502. {
  503. public:
  504. //
  505. // The constructor.
  506. //
  507. CG_INHERITED_OBJECT_INTERFACE(
  508. node_interface * pI,
  509. GUID_STRS GStrs,
  510. BOOL fCallbacksYes,
  511. BOOL fMopsYes,
  512. CG_OBJECT_INTERFACE * pBCG
  513. ) : CG_OBJECT_INTERFACE(
  514. pI,
  515. GStrs,
  516. fCallbacksYes,
  517. fMopsYes,
  518. pBCG )
  519. {
  520. };
  521. //
  522. // code generation methods.
  523. //
  524. virtual
  525. ID_CG GetCGID()
  526. {
  527. return ID_CG_INHERITED_OBJECT_INTERFACE;
  528. }
  529. virtual
  530. void Visit( CG_VISITOR *pVisitor )
  531. {
  532. pVisitor->Visit( this );
  533. }
  534. virtual
  535. CG_STATUS GenProxy( CCB * pCCB );
  536. virtual
  537. CG_STATUS OutputProxy( CCB * pCCB );
  538. virtual
  539. CG_STATUS GenHeader( CCB * )
  540. {
  541. return CG_OK;
  542. }
  543. CG_STATUS GenInterfaceProxy( CCB *,
  544. unsigned long )
  545. {
  546. return CG_OK;
  547. }
  548. CG_STATUS GenInterfaceStub( CCB *,
  549. unsigned long )
  550. {
  551. return CG_OK;
  552. }
  553. //
  554. // miscellaneous methods.
  555. //
  556. // interfaces inherited from another file are delegated
  557. virtual
  558. BOOL IsDelegated()
  559. {
  560. return TRUE;
  561. }
  562. };
  563. class CG_IUNKNOWN_OBJECT_INTERFACE : public CG_INHERITED_OBJECT_INTERFACE
  564. {
  565. BOOL fInherited;
  566. public:
  567. //
  568. // The constructor.
  569. //
  570. CG_IUNKNOWN_OBJECT_INTERFACE(
  571. node_interface * pI,
  572. GUID_STRS GStrs,
  573. BOOL fCallbacksYes,
  574. BOOL fMopsYes,
  575. CG_OBJECT_INTERFACE * pBCG,
  576. BOOL fInh
  577. ) : CG_INHERITED_OBJECT_INTERFACE(
  578. pI,
  579. GStrs,
  580. fCallbacksYes,
  581. fMopsYes,
  582. pBCG ), fInherited( fInh )
  583. {
  584. }
  585. //
  586. // code generation methods.
  587. //
  588. virtual
  589. ID_CG GetCGID()
  590. {
  591. if ( fInherited )
  592. return CG_INHERITED_OBJECT_INTERFACE::GetCGID();
  593. else
  594. return CG_OBJECT_INTERFACE::GetCGID();
  595. }
  596. virtual
  597. void Visit( CG_VISITOR *pVisitor )
  598. {
  599. pVisitor->Visit( this );
  600. }
  601. virtual
  602. CG_STATUS GenProxy( CCB * pCCB )
  603. {
  604. if ( fInherited )
  605. return CG_INHERITED_OBJECT_INTERFACE::GenProxy( pCCB );
  606. else
  607. return CG_OBJECT_INTERFACE::GenProxy( pCCB );
  608. }
  609. virtual
  610. CG_STATUS OutputProxy( CCB * pCCB )
  611. {
  612. if ( fInherited )
  613. return CG_INHERITED_OBJECT_INTERFACE::OutputProxy( pCCB );
  614. else
  615. return CG_OBJECT_INTERFACE::OutputProxy( pCCB );
  616. }
  617. virtual
  618. CG_STATUS GenHeader( CCB * pCCB )
  619. {
  620. if ( fInherited )
  621. return CG_INHERITED_OBJECT_INTERFACE::GenHeader( pCCB );
  622. else
  623. return CG_OBJECT_INTERFACE::GenHeader( pCCB );
  624. }
  625. CG_STATUS GenInterfaceProxy( CCB *pCCB,
  626. unsigned long index)
  627. {
  628. if ( fInherited )
  629. return CG_INHERITED_OBJECT_INTERFACE::GenInterfaceProxy( pCCB, index );
  630. else
  631. return CG_OBJECT_INTERFACE::GenInterfaceProxy( pCCB, index );
  632. }
  633. CG_STATUS GenInterfaceStub( CCB *pCCB,
  634. unsigned long index)
  635. {
  636. if ( fInherited )
  637. return CG_INHERITED_OBJECT_INTERFACE::GenInterfaceStub( pCCB, index );
  638. else
  639. return CG_OBJECT_INTERFACE::GenInterfaceStub( pCCB, index );
  640. }
  641. //
  642. // miscellaneous methods.
  643. //
  644. // IUnknown is never delegated
  645. virtual
  646. BOOL IsDelegated()
  647. {
  648. return FALSE;
  649. }
  650. virtual
  651. BOOL IsIUnknown()
  652. {
  653. return TRUE;
  654. }
  655. };
  656. class CG_LIBRARY : public CG_NDR
  657. {
  658. public:
  659. CG_LIBRARY ( node_library * pLib, XLAT_SIZE_INFO & szInfo )
  660. : CG_NDR ( pLib, szInfo )
  661. {
  662. }
  663. CG_STATUS GenTypeInfo(CCB * pCCB);
  664. virtual
  665. CG_STATUS GenHeader(CCB *pCCB);
  666. CG_STATUS GenCode(CCB * )
  667. {
  668. return CG_OK;
  669. }
  670. ID_CG GetCGID()
  671. {
  672. return ID_CG_LIBRARY;
  673. }
  674. virtual
  675. void Visit( CG_VISITOR *pVisitor )
  676. {
  677. pVisitor->Visit( this );
  678. }
  679. };
  680. class CG_INTERFACE_REFERENCE : public CG_NDR
  681. {
  682. private:
  683. public:
  684. CG_INTERFACE_REFERENCE ( node_interface_reference * pRef, XLAT_SIZE_INFO & szInfo )
  685. : CG_NDR ( pRef, szInfo )
  686. {
  687. }
  688. CG_STATUS GenTypeInfo(CCB * pCCB);
  689. virtual
  690. CG_STATUS GenHeader(CCB *pCCB);
  691. CG_STATUS GenCode(CCB * )
  692. {
  693. return CG_OK;
  694. }
  695. ID_CG GetCGID()
  696. {
  697. return ID_CG_INTERFACE_REFERENCE;
  698. }
  699. virtual
  700. void Visit( CG_VISITOR *pVisitor )
  701. {
  702. pVisitor->Visit( this );
  703. }
  704. };
  705. class CG_DISPINTERFACE : public CG_OBJECT_INTERFACE
  706. {
  707. private:
  708. GUID_STRS GuidStrs;
  709. void * _pCTI;
  710. CG_CLASS * _pcgDispatch;
  711. public:
  712. CG_DISPINTERFACE (
  713. node_dispinterface * pI,
  714. GUID_STRS GStrs,
  715. CG_OBJECT_INTERFACE * pBCG
  716. ) : CG_OBJECT_INTERFACE(pI, GStrs, FALSE, FALSE, pBCG)
  717. {
  718. GuidStrs = GStrs;
  719. GuidStrs.SetValue();
  720. _pCTI = NULL;
  721. _pcgDispatch = pBCG;
  722. }
  723. CG_STATUS GenTypeInfo(CCB * pCCB);
  724. virtual
  725. CG_STATUS GenHeader(CCB *pCCB);
  726. CG_STATUS GenCode(CCB * )
  727. {
  728. return CG_OK;
  729. }
  730. ID_CG GetCGID()
  731. {
  732. return ID_CG_DISPINTERFACE;
  733. }
  734. virtual
  735. void Visit( CG_VISITOR *pVisitor )
  736. {
  737. pVisitor->Visit( this );
  738. }
  739. CG_CLASS * GetCGDispatch(void)
  740. {
  741. return _pcgDispatch;
  742. }
  743. };
  744. class CG_MODULE : public CG_NDR
  745. {
  746. private:
  747. void * _pCTI;
  748. public:
  749. CG_MODULE ( node_module * pMod, XLAT_SIZE_INFO & szInfo )
  750. : CG_NDR ( pMod, szInfo )
  751. {
  752. _pCTI = NULL;
  753. }
  754. CG_STATUS GenTypeInfo(CCB * pCCB);
  755. virtual
  756. CG_STATUS GenHeader(CCB *pCCB);
  757. CG_STATUS GenCode(CCB * )
  758. {
  759. return CG_OK;
  760. }
  761. ID_CG GetCGID()
  762. {
  763. return ID_CG_MODULE;
  764. }
  765. virtual
  766. void Visit( CG_VISITOR *pVisitor )
  767. {
  768. pVisitor->Visit( this );
  769. }
  770. unsigned long LayOut();
  771. };
  772. class CG_COCLASS : public CG_NDR
  773. {
  774. private:
  775. void * _pCTI;
  776. public:
  777. CG_COCLASS ( node_coclass * pCoclass, XLAT_SIZE_INFO & szInfo )
  778. : CG_NDR ( pCoclass, szInfo )
  779. {
  780. _pCTI = NULL;
  781. }
  782. virtual
  783. CG_STATUS GenTypeInfo(CCB * pCCB);
  784. virtual
  785. CG_STATUS GenHeader(CCB *pCCB);
  786. CG_STATUS GenCode(CCB * )
  787. {
  788. return CG_OK;
  789. }
  790. ID_CG GetCGID()
  791. {
  792. return ID_CG_COCLASS;
  793. }
  794. virtual
  795. void Visit( CG_VISITOR *pVisitor )
  796. {
  797. pVisitor->Visit( this );
  798. }
  799. unsigned long LayOut();
  800. };
  801. class CG_SAFEARRAY : public CG_NDR
  802. {
  803. public:
  804. CG_SAFEARRAY ( node_safearray * pSA, XLAT_SIZE_INFO & szInfo )
  805. : CG_NDR ( pSA, szInfo )
  806. {
  807. }
  808. //
  809. // TYPEDESC generation routine
  810. //
  811. virtual
  812. CG_STATUS GetTypeDesc(TYPEDESC * &ptd, CCB * pCCB);
  813. ID_CG
  814. GetCGID()
  815. {
  816. return ID_CG_SAFEARRAY;
  817. }
  818. virtual
  819. void Visit( CG_VISITOR *pVisitor )
  820. {
  821. pVisitor->Visit( this );
  822. }
  823. };
  824. extern GUID_STRS FakeNDR64TransferSyntaxGuidStrs;
  825. extern GUID_STRS NDR64TransferSyntaxGuidStrs;
  826. extern GUID_STRS TransferSyntaxGuidStrs;
  827. #endif // __MISCCLS_HXX__