Windows NT 4.0 source code leak
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.

221 lines
4.3 KiB

4 years ago
  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. ilbase.cxx
  5. Abstract:
  6. Intermediate Language translator for base types
  7. Notes:
  8. Author:
  9. GregJen Dec-24-1993 Created.
  10. Notes:
  11. ----------------------------------------------------------------------------*/
  12. /****************************************************************************
  13. * include files
  14. ***************************************************************************/
  15. #include "becls.hxx"
  16. #pragma hdrstop
  17. #include "ilxlat.hxx"
  18. #include "ilreg.hxx"
  19. /****************************************************************************
  20. * local data
  21. ***************************************************************************/
  22. /****************************************************************************
  23. * externs
  24. ***************************************************************************/
  25. extern CMD_ARG * pCommand;
  26. extern BOOL IsTempName( char *);
  27. extern REUSE_DICT * pReUseDict;
  28. extern REUSE_DICT * pLocalReUseDict;
  29. /****************************************************************************
  30. * definitions
  31. ***************************************************************************/
  32. // #define trace_cg
  33. //--------------------------------------------------------------------
  34. //
  35. // node_skl::ILxlate
  36. //
  37. // Notes:
  38. //
  39. //
  40. //
  41. //--------------------------------------------------------------------
  42. CG_CLASS *
  43. node_skl::ILxlate( XLAT_CTXT * pContext )
  44. {
  45. #ifdef trace_cg
  46. printf("..node_skl... kind is %d\n",NodeKind() );
  47. #endif
  48. return NULL;
  49. };
  50. //--------------------------------------------------------------------
  51. //
  52. // node_base_type::ILxlate
  53. //
  54. // Notes:
  55. //
  56. //
  57. //
  58. //--------------------------------------------------------------------
  59. CG_CLASS *
  60. node_base_type::ILxlate( XLAT_CTXT * pContext )
  61. {
  62. CG_NDR * pCG;
  63. #ifdef trace_cg
  64. printf("..node_base_type\n");
  65. #endif
  66. pContext->BaseTypeSizes( this );
  67. // process any context_handle attributes from param nodes
  68. if ( pContext->ExtractAttribute( ATTR_CONTEXT ) )
  69. {
  70. pContext->FixMemSizes( this );
  71. pCG = new CG_CONTEXT_HANDLE( this, NULL, *pContext );
  72. }
  73. switch ( NodeKind() )
  74. {
  75. case NODE_HANDLE_T:
  76. {
  77. pCG = new CG_PRIMITIVE_HANDLE( this, NULL, *pContext );
  78. break;
  79. }
  80. case NODE_VOID:
  81. {
  82. // VOID should only occur as as a single VOID param;
  83. // return NULL here, then the PARAM returns NULL as well
  84. if (!pContext->AnyAncestorBits(IL_IN_LIBRARY) && !pContext->AnyAncestorBits(IL_IN_LOCAL) && !pCommand->IsHookOleEnabled())
  85. return NULL;
  86. }
  87. default:
  88. {
  89. pCG = new CG_BASETYPE( this, *pContext );
  90. break;
  91. }
  92. };
  93. #ifdef trace_cg
  94. printf("..node_base_type return \n");
  95. #endif
  96. return pCG;
  97. };
  98. //--------------------------------------------------------------------
  99. //
  100. // node_label::ILxlate
  101. //
  102. // Notes:
  103. //
  104. //
  105. //
  106. //--------------------------------------------------------------------
  107. CG_CLASS *
  108. node_label::ILxlate( XLAT_CTXT * pContext )
  109. {
  110. pContext->ExtractAttribute(ATTR_IDLDESCATTR);
  111. pContext->ExtractAttribute(ATTR_VARDESCATTR);
  112. pContext->ExtractAttribute(ATTR_ID);
  113. pContext->ExtractAttribute(ATTR_HIDDEN);
  114. #ifdef trace_cg
  115. printf("..node_label\n");
  116. #endif
  117. return NULL;
  118. };
  119. //--------------------------------------------------------------------
  120. //
  121. // node_e_status_t::ILxlate
  122. //
  123. // Notes:
  124. //
  125. //
  126. //
  127. //--------------------------------------------------------------------
  128. CG_CLASS *
  129. node_e_status_t::ILxlate( XLAT_CTXT * pContext )
  130. {
  131. XLAT_CTXT MyContext( this, pContext );
  132. CG_ERROR_STATUS_T * pCG;
  133. #ifdef trace_cg
  134. printf("..node_e_status_t\n");
  135. #endif
  136. MyContext.BaseTypeSizes( this );
  137. // gaj - do we need to see which we used ??
  138. MyContext.ExtractAttribute( ATTR_COMMSTAT );
  139. MyContext.ExtractAttribute( ATTR_FAULTSTAT );
  140. pContext->ReturnSize( MyContext );
  141. pCG = new CG_ERROR_STATUS_T( this, MyContext );
  142. return pCG;
  143. };
  144. //--------------------------------------------------------------------
  145. //
  146. // node_wchar_t::ILxlate
  147. //
  148. // Notes:
  149. //
  150. //
  151. //
  152. //--------------------------------------------------------------------
  153. CG_CLASS *
  154. node_wchar_t::ILxlate( XLAT_CTXT * pContext )
  155. {
  156. CG_BASETYPE * pCG;
  157. #ifdef trace_cg
  158. printf("..node_wchar_t\n");
  159. #endif
  160. pContext->BaseTypeSizes( this );
  161. pCG = new CG_BASETYPE( this, *pContext );
  162. return pCG;
  163. };