diff options
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/regutil.h')
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/regutil.h | 246 |
1 files changed, 246 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/regutil.h b/src/libs/dutil/WixToolset.DUtil/inc/regutil.h new file mode 100644 index 00000000..75284940 --- /dev/null +++ b/src/libs/dutil/WixToolset.DUtil/inc/regutil.h | |||
@@ -0,0 +1,246 @@ | |||
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 | |||
10 | #define ReleaseRegKey(h) if (h) { ::RegCloseKey(h); h = NULL; } | ||
11 | |||
12 | typedef enum REG_KEY_BITNESS | ||
13 | { | ||
14 | REG_KEY_DEFAULT = 0, | ||
15 | REG_KEY_32BIT = 1, | ||
16 | REG_KEY_64BIT = 2 | ||
17 | } REG_KEY_BITNESS; | ||
18 | |||
19 | typedef LSTATUS (APIENTRY *PFN_REGCREATEKEYEXW)( | ||
20 | __in HKEY hKey, | ||
21 | __in LPCWSTR lpSubKey, | ||
22 | __reserved DWORD Reserved, | ||
23 | __in_opt LPWSTR lpClass, | ||
24 | __in DWORD dwOptions, | ||
25 | __in REGSAM samDesired, | ||
26 | __in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, | ||
27 | __out PHKEY phkResult, | ||
28 | __out_opt LPDWORD lpdwDisposition | ||
29 | ); | ||
30 | typedef LSTATUS (APIENTRY *PFN_REGOPENKEYEXW)( | ||
31 | __in HKEY hKey, | ||
32 | __in_opt LPCWSTR lpSubKey, | ||
33 | __reserved DWORD ulOptions, | ||
34 | __in REGSAM samDesired, | ||
35 | __out PHKEY phkResult | ||
36 | ); | ||
37 | typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYEXW)( | ||
38 | __in HKEY hKey, | ||
39 | __in LPCWSTR lpSubKey, | ||
40 | __in REGSAM samDesired, | ||
41 | __reserved DWORD Reserved | ||
42 | ); | ||
43 | typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYW)( | ||
44 | __in HKEY hKey, | ||
45 | __in LPCWSTR lpSubKey | ||
46 | ); | ||
47 | typedef LSTATUS (APIENTRY *PFN_REGENUMKEYEXW)( | ||
48 | __in HKEY hKey, | ||
49 | __in DWORD dwIndex, | ||
50 | __out LPWSTR lpName, | ||
51 | __inout LPDWORD lpcName, | ||
52 | __reserved LPDWORD lpReserved, | ||
53 | __inout_opt LPWSTR lpClass, | ||
54 | __inout_opt LPDWORD lpcClass, | ||
55 | __out_opt PFILETIME lpftLastWriteTime | ||
56 | ); | ||
57 | typedef LSTATUS (APIENTRY *PFN_REGENUMVALUEW)( | ||
58 | __in HKEY hKey, | ||
59 | __in DWORD dwIndex, | ||
60 | __out LPWSTR lpValueName, | ||
61 | __inout LPDWORD lpcchValueName, | ||
62 | __reserved LPDWORD lpReserved, | ||
63 | __out_opt LPDWORD lpType, | ||
64 | __out_opt LPBYTE lpData, | ||
65 | __out_opt LPDWORD lpcbData | ||
66 | ); | ||
67 | typedef LSTATUS (APIENTRY *PFN_REGQUERYINFOKEYW)( | ||
68 | __in HKEY hKey, | ||
69 | __out_opt LPWSTR lpClass, | ||
70 | __inout_opt LPDWORD lpcClass, | ||
71 | __reserved LPDWORD lpReserved, | ||
72 | __out_opt LPDWORD lpcSubKeys, | ||
73 | __out_opt LPDWORD lpcMaxSubKeyLen, | ||
74 | __out_opt LPDWORD lpcMaxClassLen, | ||
75 | __out_opt LPDWORD lpcValues, | ||
76 | __out_opt LPDWORD lpcMaxValueNameLen, | ||
77 | __out_opt LPDWORD lpcMaxValueLen, | ||
78 | __out_opt LPDWORD lpcbSecurityDescriptor, | ||
79 | __out_opt PFILETIME lpftLastWriteTime | ||
80 | ); | ||
81 | typedef LSTATUS (APIENTRY *PFN_REGQUERYVALUEEXW)( | ||
82 | __in HKEY hKey, | ||
83 | __in_opt LPCWSTR lpValueName, | ||
84 | __reserved LPDWORD lpReserved, | ||
85 | __out_opt LPDWORD lpType, | ||
86 | __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData, | ||
87 | __inout_opt LPDWORD lpcbData | ||
88 | ); | ||
89 | typedef LSTATUS (APIENTRY *PFN_REGSETVALUEEXW)( | ||
90 | __in HKEY hKey, | ||
91 | __in_opt LPCWSTR lpValueName, | ||
92 | __reserved DWORD Reserved, | ||
93 | __in DWORD dwType, | ||
94 | __in_bcount_opt(cbData) CONST BYTE* lpData, | ||
95 | __in DWORD cbData | ||
96 | ); | ||
97 | typedef LSTATUS (APIENTRY *PFN_REGDELETEVALUEW)( | ||
98 | __in HKEY hKey, | ||
99 | __in_opt LPCWSTR lpValueName | ||
100 | ); | ||
101 | |||
102 | HRESULT DAPI RegInitialize(); | ||
103 | void DAPI RegUninitialize(); | ||
104 | |||
105 | void DAPI RegFunctionOverride( | ||
106 | __in_opt PFN_REGCREATEKEYEXW pfnRegCreateKeyExW, | ||
107 | __in_opt PFN_REGOPENKEYEXW pfnRegOpenKeyExW, | ||
108 | __in_opt PFN_REGDELETEKEYEXW pfnRegDeleteKeyExW, | ||
109 | __in_opt PFN_REGENUMKEYEXW pfnRegEnumKeyExW, | ||
110 | __in_opt PFN_REGENUMVALUEW pfnRegEnumValueW, | ||
111 | __in_opt PFN_REGQUERYINFOKEYW pfnRegQueryInfoKeyW, | ||
112 | __in_opt PFN_REGQUERYVALUEEXW pfnRegQueryValueExW, | ||
113 | __in_opt PFN_REGSETVALUEEXW pfnRegSetValueExW, | ||
114 | __in_opt PFN_REGDELETEVALUEW pfnRegDeleteValueW | ||
115 | ); | ||
116 | HRESULT DAPI RegCreate( | ||
117 | __in HKEY hkRoot, | ||
118 | __in_z LPCWSTR wzSubKey, | ||
119 | __in DWORD dwAccess, | ||
120 | __out HKEY* phk | ||
121 | ); | ||
122 | HRESULT DAPI RegCreateEx( | ||
123 | __in HKEY hkRoot, | ||
124 | __in_z LPCWSTR wzSubKey, | ||
125 | __in DWORD dwAccess, | ||
126 | __in BOOL fVolatile, | ||
127 | __in_opt SECURITY_ATTRIBUTES* pSecurityAttributes, | ||
128 | __out HKEY* phk, | ||
129 | __out_opt BOOL* pfCreated | ||
130 | ); | ||
131 | HRESULT DAPI RegOpen( | ||
132 | __in HKEY hkRoot, | ||
133 | __in_z LPCWSTR wzSubKey, | ||
134 | __in DWORD dwAccess, | ||
135 | __out HKEY* phk | ||
136 | ); | ||
137 | HRESULT DAPI RegDelete( | ||
138 | __in HKEY hkRoot, | ||
139 | __in_z LPCWSTR wzSubKey, | ||
140 | __in REG_KEY_BITNESS kbKeyBitness, | ||
141 | __in BOOL fDeleteTree | ||
142 | ); | ||
143 | HRESULT DAPI RegKeyEnum( | ||
144 | __in HKEY hk, | ||
145 | __in DWORD dwIndex, | ||
146 | __deref_out_z LPWSTR* psczKey | ||
147 | ); | ||
148 | HRESULT DAPI RegValueEnum( | ||
149 | __in HKEY hk, | ||
150 | __in DWORD dwIndex, | ||
151 | __deref_out_z LPWSTR* psczName, | ||
152 | __out_opt DWORD *pdwType | ||
153 | ); | ||
154 | HRESULT DAPI RegGetType( | ||
155 | __in HKEY hk, | ||
156 | __in_z_opt LPCWSTR wzName, | ||
157 | __out DWORD *pdwType | ||
158 | ); | ||
159 | HRESULT DAPI RegReadBinary( | ||
160 | __in HKEY hk, | ||
161 | __in_z_opt LPCWSTR wzName, | ||
162 | __deref_out_bcount_opt(*pcbBuffer) BYTE** ppbBuffer, | ||
163 | __out SIZE_T *pcbBuffer | ||
164 | ); | ||
165 | HRESULT DAPI RegReadString( | ||
166 | __in HKEY hk, | ||
167 | __in_z_opt LPCWSTR wzName, | ||
168 | __deref_out_z LPWSTR* psczValue | ||
169 | ); | ||
170 | HRESULT DAPI RegReadStringArray( | ||
171 | __in HKEY hk, | ||
172 | __in_z_opt LPCWSTR wzName, | ||
173 | __deref_out_ecount_opt(*pcStrings) LPWSTR** prgsczStrings, | ||
174 | __out DWORD *pcStrings | ||
175 | ); | ||
176 | HRESULT DAPI RegReadVersion( | ||
177 | __in HKEY hk, | ||
178 | __in_z_opt LPCWSTR wzName, | ||
179 | __out DWORD64* pdw64Version | ||
180 | ); | ||
181 | HRESULT DAPI RegReadNumber( | ||
182 | __in HKEY hk, | ||
183 | __in_z_opt LPCWSTR wzName, | ||
184 | __out DWORD* pdwValue | ||
185 | ); | ||
186 | HRESULT DAPI RegReadQword( | ||
187 | __in HKEY hk, | ||
188 | __in_z_opt LPCWSTR wzName, | ||
189 | __out DWORD64* pqwValue | ||
190 | ); | ||
191 | HRESULT DAPI RegWriteBinary( | ||
192 | __in HKEY hk, | ||
193 | __in_z_opt LPCWSTR wzName, | ||
194 | __in_bcount(cbBuffer) const BYTE *pbBuffer, | ||
195 | __in DWORD cbBuffer | ||
196 | ); | ||
197 | HRESULT DAPI RegWriteString( | ||
198 | __in HKEY hk, | ||
199 | __in_z_opt LPCWSTR wzName, | ||
200 | __in_z_opt LPCWSTR wzValue | ||
201 | ); | ||
202 | HRESULT DAPI RegWriteStringArray( | ||
203 | __in HKEY hk, | ||
204 | __in_z_opt LPCWSTR wzName, | ||
205 | __in_ecount(cStrings) LPWSTR *rgwzStrings, | ||
206 | __in DWORD cStrings | ||
207 | ); | ||
208 | HRESULT DAPI RegWriteStringFormatted( | ||
209 | __in HKEY hk, | ||
210 | __in_z_opt LPCWSTR wzName, | ||
211 | __in __format_string LPCWSTR szFormat, | ||
212 | ... | ||
213 | ); | ||
214 | HRESULT DAPI RegWriteNumber( | ||
215 | __in HKEY hk, | ||
216 | __in_z_opt LPCWSTR wzName, | ||
217 | __in DWORD dwValue | ||
218 | ); | ||
219 | HRESULT DAPI RegWriteQword( | ||
220 | __in HKEY hk, | ||
221 | __in_z_opt LPCWSTR wzName, | ||
222 | __in DWORD64 qwValue | ||
223 | ); | ||
224 | HRESULT DAPI RegQueryKey( | ||
225 | __in HKEY hk, | ||
226 | __out_opt DWORD* pcSubKeys, | ||
227 | __out_opt DWORD* pcValues | ||
228 | ); | ||
229 | HRESULT DAPI RegKeyReadNumber( | ||
230 | __in HKEY hk, | ||
231 | __in_z LPCWSTR wzSubKey, | ||
232 | __in_z_opt LPCWSTR wzName, | ||
233 | __in BOOL f64Bit, | ||
234 | __out DWORD* pdwValue | ||
235 | ); | ||
236 | BOOL DAPI RegValueExists( | ||
237 | __in HKEY hk, | ||
238 | __in_z LPCWSTR wzSubKey, | ||
239 | __in_z_opt LPCWSTR wzName, | ||
240 | __in BOOL f64Bit | ||
241 | ); | ||
242 | |||
243 | #ifdef __cplusplus | ||
244 | } | ||
245 | #endif | ||
246 | |||