| 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 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
| 9 | typedef enum _BUNDLE_INSTALL_CONTEXT |
| 10 | { |
| 11 | BUNDLE_INSTALL_CONTEXT_MACHINE, |
| 12 | BUNDLE_INSTALL_CONTEXT_USER, |
| 13 | } BUNDLE_INSTALL_CONTEXT; |
| 14 | |
| 15 | typedef enum _BUNDLE_QUERY_CALLBACK_RESULT |
| 16 | { |
| 17 | BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE, |
| 18 | BUNDLE_QUERY_CALLBACK_RESULT_CANCEL, |
| 19 | } BUNDLE_QUERY_CALLBACK_RESULT; |
| 20 | |
| 21 | typedef enum _BUNDLE_RELATION_TYPE |
| 22 | { |
| 23 | BUNDLE_RELATION_NONE, |
| 24 | BUNDLE_RELATION_DETECT, |
| 25 | BUNDLE_RELATION_UPGRADE, |
| 26 | BUNDLE_RELATION_ADDON, |
| 27 | BUNDLE_RELATION_PATCH, |
| 28 | BUNDLE_RELATION_DEPENDENT_ADDON, |
| 29 | BUNDLE_RELATION_DEPENDENT_PATCH, |
| 30 | } BUNDLE_RELATION_TYPE; |
| 31 | |
| 32 | typedef struct _BUNDLE_QUERY_RELATED_BUNDLE_RESULT |
| 33 | { |
| 34 | LPCWSTR wzBundleId; |
| 35 | BUNDLE_INSTALL_CONTEXT installContext; |
| 36 | REG_KEY_BITNESS regBitness; |
| 37 | HKEY hkBundle; |
| 38 | BUNDLE_RELATION_TYPE relationType; |
| 39 | } BUNDLE_QUERY_RELATED_BUNDLE_RESULT; |
| 40 | |
| 41 | typedef BUNDLE_QUERY_CALLBACK_RESULT(CALLBACK *PFNBUNDLE_QUERY_RELATED_BUNDLE_CALLBACK)( |
| 42 | __in const BUNDLE_QUERY_RELATED_BUNDLE_RESULT* pBundle, |
| 43 | __in_opt LPVOID pvContext |
| 44 | ); |
| 45 | |
| 46 | |
| 47 | /******************************************************************** |
| 48 | BundleGetBundleInfo - Queries the bundle installation metadata for a given property, |
| 49 | the caller is expected to free the memory returned vis psczValue |
| 50 | |
| 51 | RETURNS: |
| 52 | E_INVALIDARG |
| 53 | An invalid parameter was passed to the function. |
| 54 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT) |
| 55 | The bundle is not installed |
| 56 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY) |
| 57 | The property is unrecognized |
| 58 | E_NOTIMPL: |
| 59 | Tried to read a bundle attribute for a type which has not been implemented |
| 60 | |
| 61 | All other returns are unexpected returns from other dutil methods. |
| 62 | ********************************************************************/ |
| 63 | HRESULT DAPI BundleGetBundleInfo( |
| 64 | __in_z LPCWSTR wzBundleId, |
| 65 | __in_z LPCWSTR wzAttribute, |
| 66 | __deref_out_z LPWSTR* psczValue |
| 67 | ); |
| 68 | |
| 69 | /******************************************************************** |
| 70 | BundleGetBundleInfoFixed - Queries the bundle installation metadata for a given property |
| 71 | |
| 72 | RETURNS: |
| 73 | E_INVALIDARG |
| 74 | An invalid parameter was passed to the function. |
| 75 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT) |
| 76 | The bundle is not installed |
| 77 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY) |
| 78 | The property is unrecognized |
| 79 | HRESULT_FROM_WIN32(ERROR_MORE_DATA) |
| 80 | A buffer is too small to hold the requested data. |
| 81 | E_NOTIMPL: |
| 82 | Tried to read a bundle attribute for a type which has not been implemented |
| 83 | |
| 84 | All other returns are unexpected returns from other dutil methods. |
| 85 | ********************************************************************/ |
| 86 | HRESULT DAPI BundleGetBundleInfoFixed( |
| 87 | __in_z LPCWSTR wzBundleId, |
| 88 | __in_z LPCWSTR wzAttribute, |
| 89 | __out_ecount_opt(*pcchValue) LPWSTR wzValue, |
| 90 | __inout SIZE_T* pcchValue |
| 91 | ); |
| 92 | |
| 93 | /******************************************************************** |
| 94 | BundleEnumRelatedBundle - Queries the bundle installation metadata for installs with the given upgrade code. |
| 95 | Enumerate 32-bit and 64-bit in two passes. |
| 96 | |
| 97 | RETURNS: |
| 98 | E_INVALIDARG |
| 99 | An invalid parameter was passed to the function. |
| 100 | S_OK |
| 101 | Related bundle was found. |
| 102 | S_FALSE |
| 103 | Related bundle was not found. |
| 104 | |
| 105 | All other returns are unexpected returns from other dutil methods. |
| 106 | ********************************************************************/ |
| 107 | HRESULT DAPI BundleEnumRelatedBundle( |
| 108 | __in_z LPCWSTR wzUpgradeCode, |
| 109 | __in BUNDLE_INSTALL_CONTEXT context, |
| 110 | __in REG_KEY_BITNESS kbKeyBitness, |
| 111 | __inout PDWORD pdwStartIndex, |
| 112 | __deref_out_z LPWSTR* psczBundleId |
| 113 | ); |
| 114 | |
| 115 | /******************************************************************** |
| 116 | BundleEnumRelatedBundleFixed - Queries the bundle installation metadata for installs with the given upgrade code |
| 117 | Enumerate 32-bit and 64-bit in two passes. |
| 118 | |
| 119 | NOTE: lpBundleIdBuff is a buffer to receive the bundle GUID. This buffer must be 39 characters long. |
| 120 | The first 38 characters are for the GUID, and the last character is for the terminating null character. |
| 121 | RETURNS: |
| 122 | E_INVALIDARG |
| 123 | An invalid parameter was passed to the function. |
| 124 | S_OK |
| 125 | Related bundle was found. |
| 126 | S_FALSE |
| 127 | Related bundle was not found. |
| 128 | |
| 129 | All other returns are unexpected returns from other dutil methods. |
| 130 | ********************************************************************/ |
| 131 | HRESULT DAPI BundleEnumRelatedBundleFixed( |
| 132 | __in_z LPCWSTR wzUpgradeCode, |
| 133 | __in BUNDLE_INSTALL_CONTEXT context, |
| 134 | __in REG_KEY_BITNESS kbKeyBitness, |
| 135 | __inout PDWORD pdwStartIndex, |
| 136 | __out_ecount(MAX_GUID_CHARS+1) LPWSTR wzBundleId |
| 137 | ); |
| 138 | |
| 139 | /******************************************************************** |
| 140 | BundleGetBundleVariable - Queries the bundle installation metadata for a given variable, |
| 141 | the caller is expected to free the memory returned vis psczValue |
| 142 | |
| 143 | RETURNS: |
| 144 | S_OK |
| 145 | Success, if the variable had a value, it's returned in psczValue |
| 146 | E_INVALIDARG |
| 147 | An invalid parameter was passed to the function. |
| 148 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT) |
| 149 | The bundle is not installed |
| 150 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY) |
| 151 | The variable is unrecognized |
| 152 | E_NOTIMPL: |
| 153 | Tried to read a bundle variable for a type which has not been implemented |
| 154 | |
| 155 | All other returns are unexpected returns from other dutil methods. |
| 156 | ********************************************************************/ |
| 157 | HRESULT DAPI BundleGetBundleVariable( |
| 158 | __in_z LPCWSTR wzBundleId, |
| 159 | __in_z LPCWSTR wzVariable, |
| 160 | __deref_out_z LPWSTR* psczValue |
| 161 | ); |
| 162 | |
| 163 | /******************************************************************** |
| 164 | BundleGetBundleVariableFixed - Queries the bundle installation metadata for a given variable |
| 165 | |
| 166 | RETURNS: |
| 167 | S_OK |
| 168 | Success, if the variable had a value, it's returned in psczValue |
| 169 | E_INVALIDARG |
| 170 | An invalid parameter was passed to the function. |
| 171 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT) |
| 172 | The bundle is not installed |
| 173 | HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY) |
| 174 | The variable is unrecognized |
| 175 | HRESULT_FROM_WIN32(ERROR_MORE_DATA) |
| 176 | A buffer is too small to hold the requested data. |
| 177 | E_NOTIMPL: |
| 178 | Tried to read a bundle variable for a type which has not been implemented |
| 179 | |
| 180 | All other returns are unexpected returns from other dutil methods. |
| 181 | ********************************************************************/ |
| 182 | HRESULT DAPI BundleGetBundleVariableFixed( |
| 183 | __in_z LPCWSTR wzBundleId, |
| 184 | __in_z LPCWSTR wzVariable, |
| 185 | __out_ecount_opt(*pcchValue) LPWSTR wzValue, |
| 186 | __inout SIZE_T* pcchValue |
| 187 | ); |
| 188 | |
| 189 | /******************************************************************** |
| 190 | BundleQueryRelatedBundles - Queries the bundle installation metadata for installs with the given detect, upgrade, addon, and patch codes. |
| 191 | Passes each related bundle to the callback function. |
| 192 | ********************************************************************/ |
| 193 | HRESULT BundleQueryRelatedBundles( |
| 194 | __in BUNDLE_INSTALL_CONTEXT installContext, |
| 195 | __in_z_opt LPCWSTR* rgwzDetectCodes, |
| 196 | __in DWORD cDetectCodes, |
| 197 | __in_z_opt LPCWSTR* rgwzUpgradeCodes, |
| 198 | __in DWORD cUpgradeCodes, |
| 199 | __in_z_opt LPCWSTR* rgwzAddonCodes, |
| 200 | __in DWORD cAddonCodes, |
| 201 | __in_z_opt LPCWSTR* rgwzPatchCodes, |
| 202 | __in DWORD cPatchCodes, |
| 203 | __in PFNBUNDLE_QUERY_RELATED_BUNDLE_CALLBACK pfnCallback, |
| 204 | __in_opt LPVOID pvContext |
| 205 | ); |
| 206 | |
| 207 | |
| 208 | #ifdef __cplusplus |
| 209 | } |
| 210 | #endif |