main
h 124 lines 2.83 KB
Raw
1 #pragma once
2 // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3
4
5 #if defined(__cplusplus)
6 extern "C" {
7 #endif
8
9
10 // constants
11
12 enum BURN_PAYLOAD_PACKAGING
13 {
14 BURN_PAYLOAD_PACKAGING_NONE,
15 BURN_PAYLOAD_PACKAGING_EMBEDDED,
16 BURN_PAYLOAD_PACKAGING_EXTERNAL,
17 };
18
19 enum BURN_PAYLOAD_STATE
20 {
21 BURN_PAYLOAD_STATE_NONE,
22 BURN_PAYLOAD_STATE_ACQUIRED,
23 BURN_PAYLOAD_STATE_CACHED,
24 };
25
26 enum BURN_PAYLOAD_VERIFICATION
27 {
28 BURN_PAYLOAD_VERIFICATION_NONE,
29 BURN_PAYLOAD_VERIFICATION_AUTHENTICODE,
30 BURN_PAYLOAD_VERIFICATION_HASH,
31 BURN_PAYLOAD_VERIFICATION_UPDATE_BUNDLE,
32 };
33
34
35 // structs
36
37 typedef struct _BURN_PAYLOAD
38 {
39 LPWSTR sczKey;
40 BURN_PAYLOAD_PACKAGING packaging;
41 BOOL fLayoutOnly;
42 DWORD64 qwFileSize;
43 LPWSTR sczFilePath; // file path relative to the execute location
44
45 BYTE* pbCertificateRootPublicKeyIdentifier;
46 DWORD cbCertificateRootPublicKeyIdentifier;
47 BYTE* pbCertificateRootThumbprint;
48 DWORD cbCertificateRootThumbprint;
49 BYTE* pbHash;
50 DWORD cbHash;
51 BURN_PAYLOAD_VERIFICATION verification;
52
53 LPWSTR sczSourcePath;
54 BURN_CONTAINER* pContainer;
55 DOWNLOAD_SOURCE downloadSource;
56
57 // mutable members
58 BURN_PAYLOAD_STATE state;
59 LPWSTR sczLocalFilePath; // location of extracted or downloaded copy
60
61 LPWSTR sczUnverifiedPath;
62 DWORD cRemainingInstances;
63
64 BOOL fFailedVerificationFromAcquisition;
65 LPWSTR sczFailedLocalAcquisitionPath;
66 } BURN_PAYLOAD;
67
68 typedef struct _BURN_PAYLOADS
69 {
70 BURN_PAYLOAD* rgPayloads;
71 DWORD cPayloads;
72 STRINGDICT_HANDLE sdhPayloads; // value is BURN_PAYLOAD*
73 } BURN_PAYLOADS;
74
75 typedef struct _BURN_PAYLOAD_GROUP_ITEM
76 {
77 BURN_PAYLOAD* pPayload;
78
79 // mutable members
80 BOOL fCached;
81 DWORD64 qwCommittedCacheProgress;
82 } BURN_PAYLOAD_GROUP_ITEM;
83
84 typedef struct _BURN_PAYLOAD_GROUP
85 {
86 BURN_PAYLOAD_GROUP_ITEM* rgItems;
87 DWORD cItems;
88 DWORD64 qwTotalSize;
89 } BURN_PAYLOAD_GROUP;
90
91 // functions
92
93 HRESULT PayloadsParseFromXml(
94 __in BURN_PAYLOADS* pPayloads,
95 __in_opt BURN_CONTAINERS* pContainers,
96 __in_opt BURN_PAYLOAD_GROUP* pLayoutPayloads,
97 __in IXMLDOMNode* pixnBundle
98 );
99 void PayloadUninitialize(
100 __in BURN_PAYLOAD* pPayload
101 );
102 void PayloadsUninitialize(
103 __in BURN_PAYLOADS* pPayloads
104 );
105 HRESULT PayloadExtractUXContainer(
106 __in BURN_PAYLOADS* pPayloads,
107 __in BURN_CONTAINER_CONTEXT* pContainerContext,
108 __in_z LPCWSTR wzTargetDir
109 );
110 HRESULT PayloadFindById(
111 __in BURN_PAYLOADS* pPayloads,
112 __in_z LPCWSTR wzId,
113 __out BURN_PAYLOAD** ppPayload
114 );
115 HRESULT PayloadFindEmbeddedBySourcePath(
116 __in STRINGDICT_HANDLE sdhPayloads,
117 __in_z LPCWSTR wzStreamName,
118 __out BURN_PAYLOAD** ppPayload
119 );
120
121
122 #if defined(__cplusplus)
123 }
124 #endif