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.

619 lines
18 KiB

  1. /*
  2. Copyright (c) Microsoft Corporation
  3. */
  4. #include "stdinc.h"
  5. #include <windows.h>
  6. #include "sxsp.h"
  7. #include "actctxgenctxctb.h"
  8. #include "sxsexceptionhandling.h"
  9. #include "actctxgenctx.h"
  10. #define ENSURE_LAST_ERROR_SET() \
  11. do \
  12. { \
  13. ASSERT_NTC(::FusionpGetLastWin32Error() != ERROR_SUCCESS); \
  14. if (::FusionpGetLastWin32Error() == ERROR_SUCCESS) \
  15. ::FusionpSetLastWin32Error(ERROR_INTERNAL_ERROR); \
  16. } while (0)
  17. /*-----------------------------------------------------------------------------
  18. ACTivation ConTeXt GENneration ConTeXt ConTriButor
  19. -----------------------------------------------------------------------------*/
  20. int
  21. CActivationContextGenerationContextContributor::Compare(
  22. const void *pelem1,
  23. const void *pelem2
  24. )
  25. {
  26. const CActivationContextGenerationContextContributor *Ctb1 = reinterpret_cast<const CActivationContextGenerationContextContributor *>(pelem1);
  27. const CActivationContextGenerationContextContributor *Ctb2 = reinterpret_cast<const CActivationContextGenerationContextContributor *>(pelem2);
  28. if (Ctb1->IsExtendedSection())
  29. {
  30. if (!Ctb2->IsExtendedSection())
  31. return -1;
  32. // otherwise they're both extended...
  33. int i = memcmp(Ctb1->m_ActCtxCtb->GetExtensionGuidPtr(), Ctb2->m_ActCtxCtb->GetExtensionGuidPtr(), sizeof(GUID));
  34. if (i != 0)
  35. return i;
  36. }
  37. else
  38. {
  39. if (Ctb2->IsExtendedSection())
  40. return +1;
  41. }
  42. // comparison of unsigned numbers by subtraction does not work,
  43. // you can cast them to signed first, but this seems cleaner
  44. const ULONG sectionId1 = Ctb1->m_ActCtxCtb->m_SectionId;
  45. const ULONG sectionId2 = Ctb2->m_ActCtxCtb->m_SectionId;
  46. if (sectionId1 < sectionId2)
  47. return -1;
  48. if (sectionId1 > sectionId2)
  49. return +1;
  50. return 0;
  51. }
  52. CActivationContextGenerationContextContributor::~CActivationContextGenerationContextContributor()
  53. {
  54. if (m_ActCtxCtb != NULL)
  55. {
  56. CSxsPreserveLastError ple;
  57. m_ActCtxCtb->Release();
  58. ple.Restore();
  59. }
  60. }
  61. VOID
  62. CActivationContextGenerationContextContributor::PopulateCallbackHeader(
  63. ACTCTXCTB_CBHEADER &Header,
  64. ULONG Reason,
  65. PACTCTXGENCTX pActCtxGenCtx
  66. )
  67. {
  68. Header.Reason = Reason;
  69. Header.Flags = pActCtxGenCtx->m_Flags;
  70. Header.ManifestOperation = pActCtxGenCtx->m_ManifestOperation;
  71. Header.ManifestOperationFlags = pActCtxGenCtx->m_ManifestOperationFlags;
  72. Header.InstallationContext = &pActCtxGenCtx->m_InstallationContext;
  73. Header.ClsidMappingContext = &pActCtxGenCtx->m_ClsidMappingContext;
  74. Header.ExtensionGuid = m_ActCtxCtb->GetExtensionGuidPtr();
  75. Header.SectionId = m_ActCtxCtb->m_SectionId;
  76. Header.ContributorContext = m_ActCtxCtb->m_ContributorContext;
  77. Header.pOriginalActCtxGenCtx = pActCtxGenCtx;
  78. if (m_ManifestParseContextValid)
  79. Header.ManifestParseContext = m_ManifestParseContext;
  80. else
  81. Header.ManifestParseContext = NULL;
  82. Header.ActCtxGenContext = m_ActCtxGenContext;
  83. }
  84. BOOL
  85. CActivationContextGenerationContextContributor::Initialize(
  86. PACTCTXCTB ActCtxCtb,
  87. PVOID ActCtxGenContext
  88. )
  89. {
  90. BOOL fSuccess = FALSE;
  91. FN_TRACE_WIN32(fSuccess);
  92. INTERNAL_ERROR_CHECK(m_ActCtxCtb == NULL);
  93. INTERNAL_ERROR_CHECK(m_ActCtxGenContext == NULL);
  94. PARAMETER_CHECK(ActCtxCtb != NULL);
  95. ActCtxCtb->AddRef();
  96. m_ActCtxCtb = ActCtxCtb;
  97. m_ActCtxGenContext = ActCtxGenContext;
  98. m_IsExtendedSection = ActCtxCtb->m_IsExtendedSection;
  99. FN_EPILOG
  100. }
  101. PCWSTR
  102. CActivationContextGenerationContextContributor::Name() const
  103. {
  104. return m_ActCtxCtb->m_ContributorNameBuffer;
  105. }
  106. const GUID &
  107. CActivationContextGenerationContextContributor::ExtensionGuid() const
  108. {
  109. return m_ActCtxCtb->m_ExtensionGuid;
  110. }
  111. ULONG
  112. CActivationContextGenerationContextContributor::SectionId() const
  113. {
  114. return m_ActCtxCtb->m_SectionId;
  115. }
  116. ULONG
  117. CActivationContextGenerationContextContributor::SectionFormat() const
  118. {
  119. return m_ActCtxCtb->m_Format;
  120. }
  121. BOOL
  122. CActivationContextGenerationContextContributor::Fire_AllParsingDone(
  123. PACTCTXGENCTX pActCtxGenCtx
  124. )
  125. {
  126. BOOL fSuccess = FALSE;
  127. FN_TRACE_WIN32(fSuccess);
  128. ACTCTXCTB_CBALLPARSINGDONE CBData;
  129. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_ALLPARSINGDONE, pActCtxGenCtx);
  130. CBData.Success = TRUE;
  131. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  132. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  133. if (!CBData.Success)
  134. {
  135. ENSURE_LAST_ERROR_SET();
  136. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  137. goto Exit;
  138. }
  139. FN_EPILOG
  140. }
  141. BOOL
  142. CActivationContextGenerationContextContributor::Fire_GetSectionSize(
  143. PACTCTXGENCTX pActCtxGenCtx
  144. )
  145. {
  146. BOOL fSuccess = FALSE;
  147. FN_TRACE_WIN32(fSuccess);
  148. ACTCTXCTB_CBGETSECTIONSIZE CBData;
  149. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_GETSECTIONSIZE, pActCtxGenCtx);
  150. CBData.SectionSize = 0;
  151. CBData.Success = TRUE;
  152. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  153. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  154. if (!CBData.Success)
  155. {
  156. ENSURE_LAST_ERROR_SET();
  157. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  158. goto Exit;
  159. }
  160. m_SectionSize = CBData.SectionSize;
  161. FN_EPILOG
  162. }
  163. BOOL
  164. CActivationContextGenerationContextContributor::Fire_GetSectionData(
  165. PACTCTXGENCTX pActCtxGenCtx,
  166. PVOID Buffer
  167. )
  168. {
  169. BOOL fSuccess = FALSE;
  170. FN_TRACE_WIN32(fSuccess);
  171. ACTCTXCTB_CBGETSECTIONDATA CBData;
  172. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_GETSECTIONDATA, pActCtxGenCtx);
  173. CBData.SectionSize = m_SectionSize;
  174. CBData.SectionDataStart = Buffer;
  175. CBData.Success = TRUE;
  176. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  177. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  178. if (!CBData.Success)
  179. {
  180. ENSURE_LAST_ERROR_SET();
  181. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  182. goto Exit;
  183. }
  184. FN_EPILOG
  185. }
  186. BOOL
  187. CActivationContextGenerationContextContributor::Fire_ParseEnding(
  188. PACTCTXGENCTX pActCtxGenCtx,
  189. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext
  190. )
  191. {
  192. BOOL fSuccess = FALSE;
  193. FN_TRACE_WIN32(fSuccess);
  194. if ((m_ActCtxCtb != NULL) &&
  195. (m_ManifestParseContextValid) &&
  196. (!m_NoMoreCallbacksThisFile))
  197. {
  198. if (m_ManifestParseContextValid)
  199. {
  200. ACTCTXCTB_CBPARSEENDING CBData;
  201. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_PARSEENDING, pActCtxGenCtx);
  202. CBData.AssemblyContext = AssemblyContext;
  203. CBData.Success = TRUE;
  204. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  205. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  206. if (!CBData.Success)
  207. {
  208. ENSURE_LAST_ERROR_SET();
  209. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  210. goto Exit;
  211. }
  212. }
  213. }
  214. FN_EPILOG
  215. }
  216. VOID
  217. CActivationContextGenerationContextContributor::Fire_ParseEnded(
  218. PACTCTXGENCTX pActCtxGenCtx,
  219. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext
  220. )
  221. {
  222. FN_TRACE();
  223. if ((m_ActCtxCtb != NULL) &&
  224. (m_ManifestParseContextValid) &&
  225. (!m_NoMoreCallbacksThisFile))
  226. {
  227. if (m_ManifestParseContextValid)
  228. {
  229. CSxsPreserveLastError ple;
  230. ACTCTXCTB_CBPARSEENDED CBData;
  231. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_PARSEENDED, pActCtxGenCtx);
  232. CBData.AssemblyContext = AssemblyContext;
  233. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  234. m_ManifestParseContextValid = FALSE;
  235. m_ManifestParseContext = NULL;
  236. ple.Restore();
  237. }
  238. }
  239. }
  240. BOOL
  241. CActivationContextGenerationContextContributor::Fire_ActCtxGenEnding(
  242. PACTCTXGENCTX pActCtxGenCtx
  243. )
  244. {
  245. BOOL fSuccess = FALSE;
  246. FN_TRACE_WIN32(fSuccess);
  247. if (m_ActCtxCtb != NULL)
  248. {
  249. ACTCTXCTB_CBACTCTXGENENDING CBData;
  250. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_ACTCTXGENENDING, pActCtxGenCtx);
  251. CBData.Success = TRUE;
  252. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  253. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  254. if (!CBData.Success)
  255. {
  256. ENSURE_LAST_ERROR_SET();
  257. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  258. goto Exit;
  259. }
  260. }
  261. FN_EPILOG
  262. }
  263. VOID
  264. CActivationContextGenerationContextContributor::Fire_ActCtxGenEnded(
  265. PACTCTXGENCTX pActCtxGenCtx
  266. )
  267. {
  268. FN_TRACE();
  269. if (m_ActCtxCtb != NULL)
  270. {
  271. CSxsPreserveLastError ple;
  272. ACTCTXCTB_CBACTCTXGENENDED CBData;
  273. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_ACTCTXGENENDED, pActCtxGenCtx);
  274. CBData.Success = (BOOL) ((LONG_PTR) -1);
  275. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  276. ASSERT(CBData.Success == (BOOL) ((LONG_PTR) -1));
  277. m_ActCtxGenContext = NULL;
  278. ple.Restore();
  279. }
  280. }
  281. BOOL
  282. CActivationContextGenerationContextContributor::Fire_BeginChildren(
  283. PACTCTXGENCTX pActCtxGenCtx,
  284. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext,
  285. PCACTCTXCTB_PARSE_CONTEXT ParseContext,
  286. PCSXS_NODE_INFO NodeInfo
  287. )
  288. {
  289. BOOL fSuccess = FALSE;
  290. FN_TRACE_WIN32(fSuccess);
  291. if (!m_NoMoreCallbacksThisFile)
  292. {
  293. ACTCTXCTB_CBBEGINCHILDREN CBData;
  294. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_BEGINCHILDREN, pActCtxGenCtx);
  295. CBData.AssemblyContext = AssemblyContext;
  296. CBData.ParseContext = ParseContext;
  297. CBData.NodeInfo = NodeInfo;
  298. CBData.Success = TRUE;
  299. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  300. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  301. if (!CBData.Success)
  302. {
  303. ENSURE_LAST_ERROR_SET();
  304. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  305. goto Exit;
  306. }
  307. }
  308. FN_EPILOG
  309. }
  310. BOOL
  311. CActivationContextGenerationContextContributor::Fire_EndChildren(
  312. PACTCTXGENCTX pActCtxGenCtx,
  313. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext,
  314. PCACTCTXCTB_PARSE_CONTEXT ParseContext,
  315. BOOL Empty,
  316. PCSXS_NODE_INFO NodeInfo
  317. )
  318. {
  319. BOOL fSuccess = FALSE;
  320. FN_TRACE_WIN32(fSuccess);
  321. if (!m_NoMoreCallbacksThisFile)
  322. {
  323. ACTCTXCTB_CBENDCHILDREN CBData;
  324. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_ENDCHILDREN, pActCtxGenCtx);
  325. CBData.Empty = Empty;
  326. CBData.NodeInfo = NodeInfo;
  327. CBData.ParseContext = ParseContext;
  328. CBData.AssemblyContext = AssemblyContext;
  329. CBData.Success = TRUE;
  330. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  331. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  332. if (!CBData.Success)
  333. {
  334. ENSURE_LAST_ERROR_SET();
  335. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  336. goto Exit;
  337. }
  338. }
  339. FN_EPILOG
  340. }
  341. BOOL
  342. CActivationContextGenerationContextContributor::Fire_ElementParsed(
  343. PACTCTXGENCTX pActCtxGenCtx,
  344. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext,
  345. PCACTCTXCTB_PARSE_CONTEXT ParseContext,
  346. USHORT NodeCount,
  347. PCSXS_NODE_INFO NodeInfo
  348. )
  349. {
  350. FN_PROLOG_WIN32
  351. if (!m_NoMoreCallbacksThisFile)
  352. {
  353. ACTCTXCTB_CBELEMENTPARSED CBData;
  354. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_ELEMENTPARSED, pActCtxGenCtx);
  355. CBData.NodeCount = NodeCount;
  356. CBData.NodeInfo = NodeInfo;
  357. CBData.ParseContext = ParseContext;
  358. CBData.AssemblyContext = AssemblyContext;
  359. CBData.Success = TRUE;
  360. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  361. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  362. if (!CBData.Success)
  363. {
  364. ENSURE_LAST_ERROR_SET();
  365. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  366. TRACE_WIN32_FAILURE((*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header));
  367. goto Exit;
  368. }
  369. }
  370. FN_EPILOG
  371. }
  372. BOOL
  373. CActivationContextGenerationContextContributor::Fire_PCDATAParsed(
  374. PACTCTXGENCTX pActCtxGenCtx,
  375. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext,
  376. PCACTCTXCTB_PARSE_CONTEXT ParseContext,
  377. const WCHAR *String,
  378. ULONG Cch
  379. )
  380. {
  381. BOOL fSuccess = FALSE;
  382. FN_TRACE_WIN32(fSuccess);
  383. if (!m_NoMoreCallbacksThisFile)
  384. {
  385. ACTCTXCTB_CBPCDATAPARSED CBData;
  386. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_PCDATAPARSED, pActCtxGenCtx);
  387. CBData.ParseContext = ParseContext;
  388. CBData.AssemblyContext = AssemblyContext;
  389. CBData.Text = String;
  390. CBData.TextCch = Cch;
  391. CBData.Success = TRUE;
  392. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  393. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  394. if (!CBData.Success)
  395. {
  396. ENSURE_LAST_ERROR_SET();
  397. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  398. goto Exit;
  399. }
  400. }
  401. FN_EPILOG
  402. }
  403. BOOL
  404. CActivationContextGenerationContextContributor::Fire_CDATAParsed(
  405. PACTCTXGENCTX pActCtxGenCtx,
  406. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext,
  407. PCACTCTXCTB_PARSE_CONTEXT ParseContext,
  408. const WCHAR *String,
  409. ULONG Cch
  410. )
  411. {
  412. BOOL fSuccess = FALSE;
  413. FN_TRACE_WIN32(fSuccess);
  414. if (!m_NoMoreCallbacksThisFile)
  415. {
  416. ACTCTXCTB_CBCDATAPARSED CBData;
  417. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_CDATAPARSED, pActCtxGenCtx);
  418. CBData.ParseContext = ParseContext;
  419. CBData.AssemblyContext = AssemblyContext;
  420. CBData.Text = String;
  421. CBData.TextCch = Cch;
  422. CBData.Success = TRUE;
  423. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  424. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  425. if (!CBData.Success)
  426. {
  427. ENSURE_LAST_ERROR_SET();
  428. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  429. goto Exit;
  430. }
  431. }
  432. FN_EPILOG
  433. }
  434. BOOL
  435. CActivationContextGenerationContextContributor::Fire_IdentityDetermined(
  436. PACTCTXGENCTX pActCtxGenCtx,
  437. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext,
  438. PCACTCTXCTB_PARSE_CONTEXT ParseContext,
  439. PCASSEMBLY_IDENTITY AssemblyIdentity
  440. )
  441. {
  442. BOOL fSuccess = FALSE;
  443. FN_TRACE_WIN32(fSuccess);
  444. if (!m_NoMoreCallbacksThisFile)
  445. {
  446. ACTCTXCTB_CBIDENTITYDETERMINED CBData;
  447. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_IDENTITYDETERMINED, pActCtxGenCtx);
  448. CBData.AssemblyIdentity = AssemblyIdentity;
  449. CBData.ParseContext = ParseContext;
  450. CBData.AssemblyContext = AssemblyContext;
  451. CBData.Success = TRUE;
  452. ::FusionpSetLastWin32Error(ERROR_SUCCESS);
  453. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  454. if (!CBData.Success)
  455. {
  456. ENSURE_LAST_ERROR_SET();
  457. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  458. goto Exit;
  459. }
  460. }
  461. FN_EPILOG
  462. }
  463. BOOL
  464. CActivationContextGenerationContextContributor::Fire_ParseBeginning(
  465. PACTCTXGENCTX pActCtxGenCtx,
  466. PCACTCTXCTB_ASSEMBLY_CONTEXT AssemblyContext,
  467. DWORD FileFlags,
  468. ULONG ParseType,
  469. ULONG FilePathType,
  470. PCWSTR FilePath,
  471. SIZE_T FilePathCch,
  472. const FILETIME &FileLastWriteTime,
  473. ULONG FileFormatVersionMajor,
  474. ULONG FileFormatVersionMinor,
  475. ULONG MetadataSatelliteRosterIndex
  476. )
  477. {
  478. BOOL fSuccess = FALSE;
  479. FN_TRACE_WIN32(fSuccess);
  480. ACTCTXCTB_CBPARSEBEGINNING CBData;
  481. PARAMETER_CHECK(FilePathType == ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE);
  482. INTERNAL_ERROR_CHECK(!m_ManifestParseContextValid);
  483. this->PopulateCallbackHeader(CBData.Header, ACTCTXCTB_CBREASON_PARSEBEGINNING, pActCtxGenCtx);
  484. CBData.FileFlags = FileFlags;
  485. CBData.ParseType = ParseType;
  486. CBData.AssemblyContext = AssemblyContext;
  487. CBData.FilePath = FilePath;
  488. CBData.FilePathCch = FilePathCch;
  489. CBData.FilePathType = FilePathType;
  490. CBData.FileLastWriteTime = FileLastWriteTime;
  491. CBData.FileFormatVersionMajor = FileFormatVersionMajor;
  492. CBData.FileFormatVersionMinor = FileFormatVersionMinor;
  493. CBData.MetadataSatelliteRosterIndex = MetadataSatelliteRosterIndex;
  494. CBData.NoMoreCallbacksThisFile = FALSE;
  495. CBData.Success = TRUE;
  496. (*(m_ActCtxCtb->m_CallbackFunction))((PACTCTXCTB_CALLBACK_DATA) &CBData.Header);
  497. if (!CBData.Success)
  498. {
  499. ENSURE_LAST_ERROR_SET();
  500. pActCtxGenCtx->m_ManifestOperationFlags |= MANIFEST_OPERATION_INSTALL_FLAG_ABORT;
  501. goto Exit;
  502. }
  503. m_NoMoreCallbacksThisFile = CBData.NoMoreCallbacksThisFile;
  504. if (!m_NoMoreCallbacksThisFile)
  505. {
  506. // If they set the no more callbacks flag, we don't track the parse context.
  507. m_ManifestParseContext = CBData.Header.ManifestParseContext;
  508. m_ManifestParseContextValid = TRUE;
  509. }
  510. else
  511. {
  512. m_ManifestParseContext = NULL;
  513. m_ManifestParseContextValid = FALSE;
  514. // You can't pass back a per-file parsing context if you don't want any more callbacks for this
  515. // file.
  516. ASSERT(CBData.Header.ManifestParseContext == NULL);
  517. }
  518. FN_EPILOG
  519. }