aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/inc/regutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/regutil.h')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/regutil.h246
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
6extern "C" {
7#endif
8
9
10#define ReleaseRegKey(h) if (h) { ::RegCloseKey(h); h = NULL; }
11
12typedef 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
19typedef 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 );
30typedef 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 );
37typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYEXW)(
38 __in HKEY hKey,
39 __in LPCWSTR lpSubKey,
40 __in REGSAM samDesired,
41 __reserved DWORD Reserved
42 );
43typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYW)(
44 __in HKEY hKey,
45 __in LPCWSTR lpSubKey
46 );
47typedef 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 );
57typedef 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 );
67typedef 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 );
81typedef 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 );
89typedef 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 );
97typedef LSTATUS (APIENTRY *PFN_REGDELETEVALUEW)(
98 __in HKEY hKey,
99 __in_opt LPCWSTR lpValueName
100 );
101
102HRESULT DAPI RegInitialize();
103void DAPI RegUninitialize();
104
105void 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 );
116HRESULT DAPI RegCreate(
117 __in HKEY hkRoot,
118 __in_z LPCWSTR wzSubKey,
119 __in DWORD dwAccess,
120 __out HKEY* phk
121 );
122HRESULT 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 );
131HRESULT DAPI RegOpen(
132 __in HKEY hkRoot,
133 __in_z LPCWSTR wzSubKey,
134 __in DWORD dwAccess,
135 __out HKEY* phk
136 );
137HRESULT DAPI RegDelete(
138 __in HKEY hkRoot,
139 __in_z LPCWSTR wzSubKey,
140 __in REG_KEY_BITNESS kbKeyBitness,
141 __in BOOL fDeleteTree
142 );
143HRESULT DAPI RegKeyEnum(
144 __in HKEY hk,
145 __in DWORD dwIndex,
146 __deref_out_z LPWSTR* psczKey
147 );
148HRESULT DAPI RegValueEnum(
149 __in HKEY hk,
150 __in DWORD dwIndex,
151 __deref_out_z LPWSTR* psczName,
152 __out_opt DWORD *pdwType
153 );
154HRESULT DAPI RegGetType(
155 __in HKEY hk,
156 __in_z_opt LPCWSTR wzName,
157 __out DWORD *pdwType
158 );
159HRESULT 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 );
165HRESULT DAPI RegReadString(
166 __in HKEY hk,
167 __in_z_opt LPCWSTR wzName,
168 __deref_out_z LPWSTR* psczValue
169 );
170HRESULT 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 );
176HRESULT DAPI RegReadVersion(
177 __in HKEY hk,
178 __in_z_opt LPCWSTR wzName,
179 __out DWORD64* pdw64Version
180 );
181HRESULT DAPI RegReadNumber(
182 __in HKEY hk,
183 __in_z_opt LPCWSTR wzName,
184 __out DWORD* pdwValue
185 );
186HRESULT DAPI RegReadQword(
187 __in HKEY hk,
188 __in_z_opt LPCWSTR wzName,
189 __out DWORD64* pqwValue
190 );
191HRESULT DAPI RegWriteBinary(
192 __in HKEY hk,
193 __in_z_opt LPCWSTR wzName,
194 __in_bcount(cbBuffer) const BYTE *pbBuffer,
195 __in DWORD cbBuffer
196 );
197HRESULT DAPI RegWriteString(
198 __in HKEY hk,
199 __in_z_opt LPCWSTR wzName,
200 __in_z_opt LPCWSTR wzValue
201 );
202HRESULT DAPI RegWriteStringArray(
203 __in HKEY hk,
204 __in_z_opt LPCWSTR wzName,
205 __in_ecount(cStrings) LPWSTR *rgwzStrings,
206 __in DWORD cStrings
207 );
208HRESULT DAPI RegWriteStringFormatted(
209 __in HKEY hk,
210 __in_z_opt LPCWSTR wzName,
211 __in __format_string LPCWSTR szFormat,
212 ...
213 );
214HRESULT DAPI RegWriteNumber(
215 __in HKEY hk,
216 __in_z_opt LPCWSTR wzName,
217 __in DWORD dwValue
218 );
219HRESULT DAPI RegWriteQword(
220 __in HKEY hk,
221 __in_z_opt LPCWSTR wzName,
222 __in DWORD64 qwValue
223 );
224HRESULT DAPI RegQueryKey(
225 __in HKEY hk,
226 __out_opt DWORD* pcSubKeys,
227 __out_opt DWORD* pcValues
228 );
229HRESULT 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 );
236BOOL 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