Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
6.3 KiB

  1. /*************************************************/
  2. /* Common Library Component private include file */
  3. /*************************************************/
  4. // ****************************************************************************
  5. //
  6. // This file contains declarations that have to do with INF contexts
  7. //
  8. //
  9. // For each INF file loaded, Setup maintains a permanent INF information
  10. // block and a temporary INF information block.
  11. //
  12. // InfPermInfo: The permanent information block contains the data
  13. // that is kept throughout the life of Setup, even after an
  14. // INF file has been discarded. This is reused if an INF
  15. // is re-loaded.
  16. //
  17. // InfTempInfo: The temporary information block contains data that is
  18. // kept only as long as the INF is loaded. This consists
  19. // mainly of the preparsed INF and its symbol table.
  20. //
  21. //
  22. // An INF context consists of a line number ( which is the INF line being
  23. // executed), plus the temporary and permanent INF information.
  24. //
  25. // INF contexts are entered with the SHELL command and exited with the
  26. // RETURN command.
  27. //
  28. // ****************************************************************************
  29. //
  30. // Count of strings in each String-Table-Freeing node
  31. //
  32. #define cszPerStf (62)
  33. //
  34. // String-Table-Free structure
  35. //
  36. typedef struct _STF *PSTF;
  37. typedef struct _STF {
  38. PSTF pstfNext;
  39. SZ rgsz[cszPerStf];
  40. USHORT cszFree;
  41. } STF;
  42. typedef PSTF * PPSTF;
  43. //
  44. // INF permanent information. This is kept throughout all of SETUP.
  45. //
  46. // There is one if these for each INF file that has been used by SETUP.
  47. //
  48. typedef struct _INFPERMINFO *PINFPERMINFO;
  49. typedef struct _INFPERMINFO {
  50. PINFPERMINFO pNext; // Next in List
  51. SZ szName; // INF name
  52. UINT InfId; // INF Id
  53. PSDLE psdleHead; // Source media description list head
  54. PSDLE psdleCur; // Current source media description
  55. PCLN pclnHead; // Head of copy list
  56. PPCLN ppclnTail; // Tail of copy list
  57. PSTF pstfHead; // Head of free string table
  58. } INFPERMINFO;
  59. //
  60. // Parsed INF info. There is one of these per active INF plus a few
  61. // cached ones for previously used INFs.
  62. //
  63. typedef struct _PARSED_INF *PPARSED_INF;
  64. typedef struct _PARSED_INF {
  65. PPARSED_INF pPrev;
  66. PPARSED_INF pNext;
  67. PINFPERMINFO pInfPermInfo;
  68. PINFLINE MasterLineArray;
  69. UINT MasterLineCount;
  70. PUCHAR MasterFile;
  71. UINT MasterFileSize;
  72. } PARSED_INF;
  73. //
  74. // INF temporary information. This goes away when no context
  75. // references the INF.
  76. //
  77. typedef struct _INFTEMPINFO *PINFTEMPINFO;
  78. typedef struct _INFTEMPINFO {
  79. PINFTEMPINFO pPrev; // Previous in chain
  80. PINFTEMPINFO pNext; // Next in chain
  81. PINFPERMINFO pInfPermInfo; // INF permanent information
  82. PPARSED_INF pParsedInf; // Parsed INF
  83. DWORD cRef; // Reference count
  84. PSYMTAB SymTab; // Static symbol table
  85. } INFTEMPINFO;
  86. //
  87. // Context entry in context stack. There is one of these for
  88. // each context entered.
  89. //
  90. typedef struct _INFCONTEXT *PINFCONTEXT;
  91. typedef struct _INFCONTEXT {
  92. PINFCONTEXT pNext; // Next context in chain
  93. PINFTEMPINFO pInfTempInfo; // INF temporary info
  94. INT CurrentLine; // Current line being executed
  95. PSEFL pseflHead; // Flow statement block
  96. PSYMTAB SymTab; // Local symtol table
  97. SZ szShlScriptSection; // Shell script section
  98. SZ szHelpFile; // Help file
  99. DWORD dwLowContext; // Help context low
  100. DWORD dwHighContext; // Help context high
  101. DWORD dwHelpIndex; // Help index.
  102. BOOL bHelpIsIndexed; // Whether help is indexed
  103. } INFCONTEXT;
  104. //
  105. // Global variables
  106. //
  107. extern PINFCONTEXT pContextBottom; // The global (SETUP) context
  108. extern PINFCONTEXT pContextTop; // Top of context stack
  109. extern PINFPERMINFO pInfPermInfoHead; // Head of InfPermInfo list
  110. extern PINFPERMINFO pInfPermInfoTail; // Tail of InfPermInfo list
  111. //
  112. // Some macros for accessing contexts and INF information
  113. //
  114. #define pLocalContext() pContextTop
  115. #define pGlobalContext() pContextBottom
  116. #define pInfTempInfo( Context ) ((Context)->pInfTempInfo)
  117. #define pInfPermInfo( Context ) (pInfTempInfo( Context )->pInfPermInfo)
  118. #define pParsedInf( Context ) (pInfTempInfo( Context )->pParsedInf)
  119. #define pLocalInfTempInfo() pInfTempInfo( pLocalContext() )
  120. #define pLocalInfPermInfo() pInfPermInfo( pLocalContext() )
  121. #define PpclnHeadList( pPermInfo ) &(pPermInfo->pclnHead)
  122. #define PppclnTailList( pPermInfo ) &(pPermInfo->ppclnTail)
  123. #define PreCondSymTabInit(r) PreCondition( (pLocalContext() != NULL), r )
  124. //
  125. // Function Prototypes
  126. //
  127. extern BOOL APIENTRY PushContext( PINFCONTEXT pContext );
  128. extern PINFCONTEXT APIENTRY PopContext( VOID );
  129. extern VOID APIENTRY FreeContext( PINFCONTEXT pContext );
  130. extern PINFPERMINFO APIENTRY NameToInfPermInfo( SZ szName , BOOL AllocIfNotPresent);
  131. extern PINFPERMINFO APIENTRY AddInfPermInfo( SZ szName );
  132. extern BOOL APIENTRY PathToInfName( SZ szPath, SZ szName );
  133. extern PSYMTAB APIENTRY PInfSymTabFind( SZ szSymbol, SZ *szNewSymbol );
  134. extern PINFTEMPINFO APIENTRY CreateInfTempInfo( PINFPERMINFO );
  135. extern BOOL APIENTRY FFreeSrcDescrList(PINFPERMINFO);
  136. extern PSDLE APIENTRY PsdleFromDid(DID, PINFPERMINFO);
  137. extern BOOL APIENTRY FFreeCopyList(PINFPERMINFO);
  138. #if DBG
  139. extern BOOL APIENTRY FValidCopyList(PINFPERMINFO);
  140. #endif
  141. extern BOOL APIENTRY FInitFreeTable(PINFPERMINFO);
  142. extern BOOL APIENTRY FAddSzToFreeTable(SZ, PINFPERMINFO);
  143. extern BOOL APIENTRY FAddNewSzsInPoerToFreeTable(POER, POER, PINFPERMINFO);
  144. extern BOOL APIENTRY FFreeFreeTable(PINFPERMINFO);
  145. extern PPARSED_INF APIENTRY ParsedInfAlloc(PINFPERMINFO);
  146. extern BOOL APIENTRY FFreeParsedInf( PPARSED_INF);
  147. extern BOOL APIENTRY FlushInfParsedInfo(SZ szInfName);