aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/inc/butil.h
blob: 5d390344ec563d80dcbc6b767e3ce0f93868a17c (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
204
205
206
207
208
209
210
#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.


#ifdef __cplusplus
extern "C" {
#endif

typedef enum _BUNDLE_INSTALL_CONTEXT
{
    BUNDLE_INSTALL_CONTEXT_MACHINE,
    BUNDLE_INSTALL_CONTEXT_USER,
} BUNDLE_INSTALL_CONTEXT;

typedef enum _BUNDLE_QUERY_CALLBACK_RESULT
{
    BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE,
    BUNDLE_QUERY_CALLBACK_RESULT_CANCEL,
} BUNDLE_QUERY_CALLBACK_RESULT;

typedef enum _BUNDLE_RELATION_TYPE
{
    BUNDLE_RELATION_NONE,
    BUNDLE_RELATION_DETECT,
    BUNDLE_RELATION_UPGRADE,
    BUNDLE_RELATION_ADDON,
    BUNDLE_RELATION_PATCH,
    BUNDLE_RELATION_DEPENDENT_ADDON,
    BUNDLE_RELATION_DEPENDENT_PATCH,
} BUNDLE_RELATION_TYPE;

typedef struct _BUNDLE_QUERY_RELATED_BUNDLE_RESULT
{
    LPCWSTR wzBundleId;
    BUNDLE_INSTALL_CONTEXT installContext;
    REG_KEY_BITNESS regBitness;
    HKEY hkBundle;
    BUNDLE_RELATION_TYPE relationType;
} BUNDLE_QUERY_RELATED_BUNDLE_RESULT;

typedef BUNDLE_QUERY_CALLBACK_RESULT(CALLBACK *PFNBUNDLE_QUERY_RELATED_BUNDLE_CALLBACK)(
    __in const BUNDLE_QUERY_RELATED_BUNDLE_RESULT* pBundle,
    __in_opt LPVOID pvContext
    );


/********************************************************************
BundleGetBundleInfo - Queries the bundle installation metadata for a given property,
    the caller is expected to free the memory returned vis psczValue

RETURNS:
    E_INVALIDARG
        An invalid parameter was passed to the function.
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT)
        The bundle is not installed
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY)
        The property is unrecognized
    E_NOTIMPL:
        Tried to read a bundle attribute for a type which has not been implemented

    All other returns are unexpected returns from other dutil methods.
********************************************************************/
HRESULT DAPI BundleGetBundleInfo(
    __in_z LPCWSTR wzBundleId,
    __in_z LPCWSTR wzAttribute,
    __deref_out_z LPWSTR* psczValue
    );

/********************************************************************
BundleGetBundleInfoFixed - Queries the bundle installation metadata for a given property

RETURNS:
    E_INVALIDARG
        An invalid parameter was passed to the function.
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT)
        The bundle is not installed
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY)
        The property is unrecognized
    HRESULT_FROM_WIN32(ERROR_MORE_DATA)
        A buffer is too small to hold the requested data.
    E_NOTIMPL:
        Tried to read a bundle attribute for a type which has not been implemented

    All other returns are unexpected returns from other dutil methods.
********************************************************************/
HRESULT DAPI BundleGetBundleInfoFixed(
    __in_z LPCWSTR wzBundleId,
    __in_z LPCWSTR wzAttribute,
    __out_ecount_opt(*pcchValue) LPWSTR wzValue,
    __inout SIZE_T* pcchValue
    );

/********************************************************************
BundleEnumRelatedBundle - Queries the bundle installation metadata for installs with the given upgrade code.
Enumerate 32-bit and 64-bit in two passes.

RETURNS:
    E_INVALIDARG
        An invalid parameter was passed to the function.
    S_OK
        Related bundle was found.
    S_FALSE
        Related bundle was not found.

    All other returns are unexpected returns from other dutil methods.
********************************************************************/
HRESULT DAPI BundleEnumRelatedBundle(
    __in_z LPCWSTR wzUpgradeCode,
    __in BUNDLE_INSTALL_CONTEXT context,
    __in REG_KEY_BITNESS kbKeyBitness,
    __inout PDWORD pdwStartIndex,
    __deref_out_z LPWSTR* psczBundleId
    );

/********************************************************************
BundleEnumRelatedBundleFixed - Queries the bundle installation metadata for installs with the given upgrade code
Enumerate 32-bit and 64-bit in two passes.

NOTE: lpBundleIdBuff is a buffer to receive the bundle GUID. This buffer must be 39 characters long.
        The first 38 characters are for the GUID, and the last character is for the terminating null character.
RETURNS:
    E_INVALIDARG
        An invalid parameter was passed to the function.
    S_OK
        Related bundle was found.
    S_FALSE
        Related bundle was not found.

    All other returns are unexpected returns from other dutil methods.
********************************************************************/
HRESULT DAPI BundleEnumRelatedBundleFixed(
    __in_z LPCWSTR wzUpgradeCode,
    __in BUNDLE_INSTALL_CONTEXT context,
    __in REG_KEY_BITNESS kbKeyBitness,
    __inout PDWORD pdwStartIndex,
    __out_ecount(MAX_GUID_CHARS+1) LPWSTR wzBundleId
    );

/********************************************************************
BundleGetBundleVariable - Queries the bundle installation metadata for a given variable,
    the caller is expected to free the memory returned vis psczValue

RETURNS:
    S_OK
        Success, if the variable had a value, it's returned in psczValue
    E_INVALIDARG
        An invalid parameter was passed to the function.
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT)
        The bundle is not installed
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY)
        The variable is unrecognized
    E_NOTIMPL:
        Tried to read a bundle variable for a type which has not been implemented

    All other returns are unexpected returns from other dutil methods.
********************************************************************/
HRESULT DAPI BundleGetBundleVariable(
    __in_z LPCWSTR wzBundleId,
    __in_z LPCWSTR wzVariable,
    __deref_out_z LPWSTR* psczValue
    );

/********************************************************************
BundleGetBundleVariableFixed - Queries the bundle installation metadata for a given variable

RETURNS:
    S_OK
        Success, if the variable had a value, it's returned in psczValue
    E_INVALIDARG
        An invalid parameter was passed to the function.
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT)
        The bundle is not installed
    HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY)
        The variable is unrecognized
    HRESULT_FROM_WIN32(ERROR_MORE_DATA)
        A buffer is too small to hold the requested data.
    E_NOTIMPL:
        Tried to read a bundle variable for a type which has not been implemented

    All other returns are unexpected returns from other dutil methods.
********************************************************************/
HRESULT DAPI BundleGetBundleVariableFixed(
    __in_z LPCWSTR wzBundleId,
    __in_z LPCWSTR wzVariable,
    __out_ecount_opt(*pcchValue) LPWSTR wzValue,
    __inout SIZE_T* pcchValue
    );

/********************************************************************
BundleQueryRelatedBundles - Queries the bundle installation metadata for installs with the given detect, upgrade, addon, and patch codes.
                            Passes each related bundle to the callback function.
********************************************************************/
HRESULT BundleQueryRelatedBundles(
    __in BUNDLE_INSTALL_CONTEXT installContext,
    __in_z_opt LPCWSTR* rgwzDetectCodes,
    __in DWORD cDetectCodes,
    __in_z_opt LPCWSTR* rgwzUpgradeCodes,
    __in DWORD cUpgradeCodes,
    __in_z_opt LPCWSTR* rgwzAddonCodes,
    __in DWORD cAddonCodes,
    __in_z_opt LPCWSTR* rgwzPatchCodes,
    __in DWORD cPatchCodes,
    __in PFNBUNDLE_QUERY_RELATED_BUNDLE_CALLBACK pfnCallback,
    __in_opt LPVOID pvContext
    );


#ifdef __cplusplus
}
#endif