aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/dependency.h
blob: d539e9b5818e22559845c096dad625300b42e4f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#pragma once
// 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.


#if defined(__cplusplus)
extern "C" {
#endif

// constants

const LPCWSTR DEPENDENCY_IGNOREDEPENDENCIES = L"IGNOREDEPENDENCIES";


typedef struct _BURN_DEPENDENCIES
{
    DEPENDENCY* rgIgnoredDependencies;
    UINT cIgnoredDependencies;
    LPCWSTR wzActiveParent;
    LPCWSTR wzSelfDependent;
    BOOL fIgnoreAllDependents;
    BOOL fSelfDependent;
    BOOL fActiveParent;
} BURN_DEPENDENCIES;


// function declarations

/********************************************************************
 DependencyUninitializeProvider - Frees and zeros memory allocated in
  the dependency provider.

*********************************************************************/
void DependencyUninitializeProvider(
    __in BURN_DEPENDENCY_PROVIDER* pProvider
    );

/********************************************************************
 DependencyParseProvidersFromXml - Parses dependency information
  from the manifest for the specified package.

*********************************************************************/
HRESULT DependencyParseProvidersFromXml(
    __in BURN_PACKAGE* pPackage,
    __in IXMLDOMNode* pixnPackage
    );

HRESULT DependencyInitialize(
    __in BURN_ENGINE_COMMAND* pInternalCommand,
    __in BURN_DEPENDENCIES* pDependencies,
    __in BURN_REGISTRATION* pRegistration
    );

void DependencyUninitialize(
    __in BURN_DEPENDENCIES* pDependencies
    );

/********************************************************************
 DependencyDetectProviderKeyBundleCode - Detect if the provider key is
  registered and if so what bundle is registered.

 Note: Returns E_NOTFOUND if the provider key is not registered.
*********************************************************************/
HRESULT DependencyDetectProviderKeyBundleCode(
    __in BURN_REGISTRATION* pRegistration
    );

/********************************************************************
 DependencyDetect - Detects dependency information.

*********************************************************************/
HRESULT DependencyDetectBundle(
    __in BURN_DEPENDENCIES* pDependencies,
    __in BURN_REGISTRATION* pRegistration
    );

HRESULT DependencyDetectChainPackage(
    __in BURN_PACKAGE* pPackage,
    __in BURN_REGISTRATION* pRegistration
    );

HRESULT DependencyDetectRelatedBundle(
    __in BURN_RELATED_BUNDLE* pRelatedBundle,
    __in BURN_REGISTRATION* pRegistration
    );

/********************************************************************
 DependencyPlanInitialize - Initializes the plan.

*********************************************************************/
HRESULT DependencyPlanInitialize(
    __in BURN_DEPENDENCIES* pDependencies,
    __in BURN_PLAN* pPlan
    );

/********************************************************************
 DependencyAllocIgnoreDependencies - Allocates the dependencies to
  ignore as a semicolon-delimited string.

*********************************************************************/
HRESULT DependencyAllocIgnoreDependencies(
    __in const BURN_PLAN *pPlan,
    __out_z LPWSTR* psczIgnoreDependencies
    );

/********************************************************************
 DependencyAddIgnoreDependencies - Populates the ignore dependency
  names.

*********************************************************************/
HRESULT DependencyAddIgnoreDependencies(
    __in STRINGDICT_HANDLE sdIgnoreDependencies,
    __in_z LPCWSTR wzAddIgnoreDependencies
    );

/********************************************************************
 DependencyPlanPackageBegin - Updates the dependency registration
  action depending on the calculated state for the package.

*********************************************************************/
HRESULT DependencyPlanPackageBegin(
    __in BOOL fPerMachine,
    __in BURN_PACKAGE* pPackage,
    __in BURN_PLAN* pPlan
    );

/********************************************************************
 DependencyPlanPackage - adds dependency related actions to the plan
  for this package.

*********************************************************************/
HRESULT DependencyPlanPackage(
    __in_opt DWORD *pdwInsertSequence,
    __in const BURN_PACKAGE* pPackage,
    __in BURN_PLAN* pPlan
    );

/********************************************************************
 DependencyPlanPackageComplete - Updates the dependency registration
  action depending on the planned action for the package.

*********************************************************************/
HRESULT DependencyPlanPackageComplete(
    __in BURN_PACKAGE* pPackage,
    __in BURN_PLAN* pPlan
    );

/********************************************************************
 DependencyExecutePackageProviderAction - Registers or unregisters
  provider information for the package contained within the action.

*********************************************************************/
HRESULT DependencyExecutePackageProviderAction(
    __in const BURN_EXECUTE_ACTION* pAction,
    __in BOOL fRollback
    );

/********************************************************************
 DependencyExecutePackageDependencyAction - Registers or unregisters
  dependency information for the package contained within the action.

*********************************************************************/
HRESULT DependencyExecutePackageDependencyAction(
    __in BOOL fPerMachine,
    __in const BURN_EXECUTE_ACTION* pAction,
    __in BOOL fRollback
    );

/********************************************************************
 DependencyRegisterBundle - Registers the bundle dependency provider.

*********************************************************************/
HRESULT DependencyRegisterBundle(
    __in const BURN_REGISTRATION* pRegistration
    );

/********************************************************************
 DependencyProcessDependentRegistration - Registers or unregisters dependents
  on the bundle based on the action.

*********************************************************************/
HRESULT DependencyProcessDependentRegistration(
    __in const BURN_REGISTRATION* pRegistration,
    __in const BURN_DEPENDENT_REGISTRATION_ACTION* pAction
    );

/********************************************************************
 DependencyUnregisterBundle - Removes the bundle dependency provider.

 Note: Does not check for existing dependents before removing the key.
*********************************************************************/
void DependencyUnregisterBundle(
    __in const BURN_REGISTRATION* pRegistration,
    __in const BURN_PACKAGES* pPackages
    );

HRESULT DependencyDetectCompatibleEntry(
    __in BURN_PACKAGE* pPackage,
    __in BURN_REGISTRATION* pRegistration
    );

#if defined(__cplusplus)
}
#endif