| 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 | #define ReleaseDependencyArray(rg, c) if (rg) { DepDependencyArrayFree(rg, c); } |
| 10 | #define ReleaseNullDependencyArray(rg, c) if (rg) { DepDependencyArrayFree(rg, c); rg = NULL; } |
| 11 | |
| 12 | typedef struct _DEPENDENCY |
| 13 | { |
| 14 | LPWSTR sczKey; |
| 15 | LPWSTR sczName; |
| 16 | } DEPENDENCY; |
| 17 | |
| 18 | |
| 19 | /*************************************************************************** |
| 20 | DepGetProviderInformation - gets the various pieces of data registered |
| 21 | with a dependency. |
| 22 | |
| 23 | Note: Returns E_NOTFOUND if the dependency was not found. |
| 24 | ***************************************************************************/ |
| 25 | DAPI_(HRESULT) DepGetProviderInformation( |
| 26 | __in HKEY hkHive, |
| 27 | __in_z LPCWSTR wzProviderKey, |
| 28 | __deref_out_z_opt LPWSTR* psczId, |
| 29 | __deref_out_z_opt LPWSTR* psczName, |
| 30 | __deref_out_z_opt LPWSTR* psczVersion |
| 31 | ); |
| 32 | |
| 33 | /*************************************************************************** |
| 34 | DepCheckDependency - Checks that the dependency is registered and within |
| 35 | the proper version range. |
| 36 | |
| 37 | Note: Returns E_NOTFOUND if the dependency was not found. |
| 38 | ***************************************************************************/ |
| 39 | DAPI_(HRESULT) DepCheckDependency( |
| 40 | __in HKEY hkHive, |
| 41 | __in_z LPCWSTR wzProviderKey, |
| 42 | __in_z_opt LPCWSTR wzMinVersion, |
| 43 | __in_z_opt LPCWSTR wzMaxVersion, |
| 44 | __in int iAttributes, |
| 45 | __in STRINGDICT_HANDLE sdDependencies, |
| 46 | __deref_inout_ecount_opt(*pcDependencies) DEPENDENCY** prgDependencies, |
| 47 | __inout LPUINT pcDependencies |
| 48 | ); |
| 49 | |
| 50 | /*************************************************************************** |
| 51 | DepCheckDependents - Checks if any dependents are still installed for the |
| 52 | given provider key. |
| 53 | |
| 54 | ***************************************************************************/ |
| 55 | DAPI_(HRESULT) DepCheckDependents( |
| 56 | __in HKEY hkHive, |
| 57 | __in_z LPCWSTR wzProviderKey, |
| 58 | __reserved int iAttributes, |
| 59 | __in_opt C_STRINGDICT_HANDLE sdIgnoredDependents, |
| 60 | __deref_inout_ecount_opt(*pcDependents) DEPENDENCY** prgDependents, |
| 61 | __inout LPUINT pcDependents |
| 62 | ); |
| 63 | |
| 64 | /*************************************************************************** |
| 65 | DepRegisterDependency - Registers the dependency provider. |
| 66 | |
| 67 | ***************************************************************************/ |
| 68 | DAPI_(HRESULT) DepRegisterDependency( |
| 69 | __in HKEY hkHive, |
| 70 | __in_z LPCWSTR wzProviderKey, |
| 71 | __in_z LPCWSTR wzVersion, |
| 72 | __in_z LPCWSTR wzDisplayName, |
| 73 | __in_z_opt LPCWSTR wzId, |
| 74 | __in int iAttributes |
| 75 | ); |
| 76 | |
| 77 | /*************************************************************************** |
| 78 | DepDependentExists - Determines if a dependent is registered. |
| 79 | |
| 80 | Note: Returns S_OK if dependent is registered. |
| 81 | Returns E_FILENOTFOUND if dependent is not registered |
| 82 | ***************************************************************************/ |
| 83 | DAPI_(HRESULT) DepDependentExists( |
| 84 | __in HKEY hkHive, |
| 85 | __in_z LPCWSTR wzDependencyProviderKey, |
| 86 | __in_z LPCWSTR wzProviderKey |
| 87 | ); |
| 88 | |
| 89 | /*************************************************************************** |
| 90 | DepRegisterDependent - Registers a dependent under the dependency provider. |
| 91 | |
| 92 | ***************************************************************************/ |
| 93 | DAPI_(HRESULT) DepRegisterDependent( |
| 94 | __in HKEY hkHive, |
| 95 | __in_z LPCWSTR wzDependencyProviderKey, |
| 96 | __in_z LPCWSTR wzProviderKey, |
| 97 | __in_z_opt LPCWSTR wzMinVersion, |
| 98 | __in_z_opt LPCWSTR wzMaxVersion, |
| 99 | __in int iAttributes |
| 100 | ); |
| 101 | |
| 102 | /*************************************************************************** |
| 103 | DepUnregisterDependency - Removes the dependency provider. |
| 104 | |
| 105 | Note: Caller should call CheckDependents prior to remove a dependency. |
| 106 | Returns E_FILENOTFOUND if the dependency is not registered. |
| 107 | ***************************************************************************/ |
| 108 | DAPI_(HRESULT) DepUnregisterDependency( |
| 109 | __in HKEY hkHive, |
| 110 | __in_z LPCWSTR wzProviderKey |
| 111 | ); |
| 112 | |
| 113 | /*************************************************************************** |
| 114 | DepUnregisterDependent - Removes a dependent under the dependency provider. |
| 115 | |
| 116 | Note: Returns E_FILENOTFOUND if neither the dependency or dependent are |
| 117 | registered. |
| 118 | ***************************************************************************/ |
| 119 | DAPI_(HRESULT) DepUnregisterDependent( |
| 120 | __in HKEY hkHive, |
| 121 | __in_z LPCWSTR wzDependencyProviderKey, |
| 122 | __in_z LPCWSTR wzProviderKey |
| 123 | ); |
| 124 | |
| 125 | /*************************************************************************** |
| 126 | DependencyArrayAlloc - Allocates or expands an array of DEPENDENCY structs. |
| 127 | |
| 128 | ***************************************************************************/ |
| 129 | DAPI_(HRESULT) DepDependencyArrayAlloc( |
| 130 | __deref_inout_ecount_opt(*pcDependencies) DEPENDENCY** prgDependencies, |
| 131 | __inout LPUINT pcDependencies, |
| 132 | __in_z LPCWSTR wzKey, |
| 133 | __in_z_opt LPCWSTR wzName |
| 134 | ); |
| 135 | |
| 136 | /*************************************************************************** |
| 137 | DepDependencyArrayFree - Frees an array of DEPENDENCY structs. |
| 138 | |
| 139 | ***************************************************************************/ |
| 140 | DAPI_(void) DepDependencyArrayFree( |
| 141 | __in_ecount(cDependencies) DEPENDENCY* rgDependencies, |
| 142 | __in UINT cDependencies |
| 143 | ); |
| 144 | |
| 145 | #ifdef __cplusplus |
| 146 | } |
| 147 | #endif |