This file is indexed.

/usr/include/x86_64-linux-gnu/winpr/registry.h is in libwinpr-dev 1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
/**
 * WinPR: Windows Portable Runtime
 * Windows Registry
 *
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef WINPR_REGISTRY_H
#define WINPR_REGISTRY_H

#include <winpr/windows.h>

#ifdef _WIN32

#include <winreg.h>

#else

#ifdef __cplusplus
extern "C" {
#endif

#include <winpr/winpr.h>
#include <winpr/wtypes.h>

#include <winpr/error.h>

#define DELETE				0x00010000
#define READ_CONTROL			0x00020000
#define WRITE_DAC			0x00040000
#define WRITE_OWNER			0x00080000
#define SYNCHRONIZE			0x00100000
#define STANDARD_RIGHTS_REQUIRED	0x000f0000

#define STANDARD_RIGHTS_READ		READ_CONTROL
#define STANDARD_RIGHTS_WRITE		READ_CONTROL
#define STANDARD_RIGHTS_EXECUTE		READ_CONTROL

#define STANDARD_RIGHTS_ALL		0x001F0000
#define SPECIFIC_RIGHTS_ALL		0x0000FFFF

#define OWNER_SECURITY_INFORMATION	0x00000001
#define GROUP_SECURITY_INFORMATION	0x00000002
#define DACL_SECURITY_INFORMATION	0x00000004
#define SACL_SECURITY_INFORMATION	0x00000008

#define REG_OPTION_RESERVED		0x00000000
#define REG_OPTION_NON_VOLATILE		0x00000000
#define REG_OPTION_VOLATILE		0x00000001
#define REG_OPTION_CREATE_LINK		0x00000002
#define REG_OPTION_BACKUP_RESTORE	0x00000004
#define REG_OPTION_OPEN_LINK		0x00000008

#define REG_CREATED_NEW_KEY		0x00000001
#define REG_OPENED_EXISTING_KEY		0x00000002

#define REG_NOTIFY_CHANGE_NAME		0x01
#define REG_NOTIFY_CHANGE_ATTRIBUTES	0x02
#define REG_NOTIFY_CHANGE_LAST_SET	0x04
#define REG_NOTIFY_CHANGE_SECURITY	0x08

#define KEY_QUERY_VALUE			0x00000001
#define KEY_SET_VALUE			0x00000002
#define KEY_CREATE_SUB_KEY		0x00000004
#define KEY_ENUMERATE_SUB_KEYS		0x00000008
#define KEY_NOTIFY			0x00000010
#define KEY_CREATE_LINK			0x00000020
#define KEY_WOW64_64KEY			0x00000100
#define KEY_WOW64_32KEY			0x00000200
#define KEY_WOW64_RES			0x00000300

#define REG_WHOLE_HIVE_VOLATILE		0x00000001
#define REG_REFRESH_HIVE		0x00000002
#define REG_NO_LAZY_FLUSH		0x00000004
#define REG_FORCE_RESTORE		0x00000008

#define KEY_READ			((STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | \
						KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY) & (~SYNCHRONIZE))

#define KEY_WRITE			((STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | \
						KEY_CREATE_SUB_KEY) & (~SYNCHRONIZE))

#define KEY_EXECUTE			((KEY_READ) & (~SYNCHRONIZE))

#define KEY_ALL_ACCESS			((STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | \
						KEY_SET_VALUE | KEY_CREATE_SUB_KEY | \
						KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | \
						KEY_CREATE_LINK) & (~SYNCHRONIZE))

#define REG_NONE			0
#define REG_SZ				1
#define REG_EXPAND_SZ			2
#define REG_BINARY			3
#define REG_DWORD			4
#define REG_DWORD_LITTLE_ENDIAN		4
#define REG_DWORD_BIG_ENDIAN		5
#define REG_LINK			6
#define REG_MULTI_SZ			7
#define REG_RESOURCE_LIST		8
#define REG_FULL_RESOURCE_DESCRIPTOR	9
#define REG_RESOURCE_REQUIREMENTS_LIST	10
#define REG_QWORD			11
#define REG_QWORD_LITTLE_ENDIAN		11

#define WINAPI WINPR_API

typedef HANDLE HKEY;
typedef HANDLE* PHKEY;

typedef DWORD ACCESS_MASK;
typedef ACCESS_MASK* PACCESS_MASK;

typedef ACCESS_MASK REGSAM;

#define HKEY_CLASSES_ROOT				((HKEY) (LONG_PTR) (LONG) 0x80000000)
#define HKEY_CURRENT_USER				((HKEY) (LONG_PTR) (LONG) 0x80000001)
#define HKEY_LOCAL_MACHINE				((HKEY) (LONG_PTR) (LONG) 0x80000002)
#define HKEY_USERS					((HKEY) (LONG_PTR) (LONG) 0x80000003)
#define HKEY_PERFORMANCE_DATA				((HKEY) (LONG_PTR) (LONG) 0x80000004)
#define HKEY_PERFORMANCE_TEXT				((HKEY) (LONG_PTR) (LONG) 0x80000050)
#define HKEY_PERFORMANCE_NLSTEXT			((HKEY) (LONG_PTR) (LONG) 0x80000060)
#define HKEY_CURRENT_CONFIG				((HKEY) (LONG_PTR) (LONG) 0x80000005)
#define HKEY_DYN_DATA					((HKEY) (LONG_PTR) (LONG) 0x80000006)
#define HKEY_CURRENT_USER_LOCAL_SETTINGS		((HKEY) (LONG_PTR) (LONG) 0x80000007)

#define RRF_RT_REG_NONE					0x00000001
#define RRF_RT_REG_SZ					0x00000002
#define RRF_RT_REG_EXPAND_SZ				0x00000004
#define RRF_RT_REG_BINARY				0x00000008
#define RRF_RT_REG_DWORD				0x00000010
#define RRF_RT_REG_MULTI_SZ				0x00000020
#define RRF_RT_REG_QWORD				0x00000040

#define RRF_RT_DWORD					(RRF_RT_REG_BINARY | RRF_RT_REG_DWORD)
#define RRF_RT_QWORD					(RRF_RT_REG_BINARY | RRF_RT_REG_QWORD)
#define RRF_RT_ANY					0x0000FFFF

#define RRF_NOEXPAND					0x10000000
#define RRF_ZEROONFAILURE				0x20000000

struct val_context
{
	int valuelen;
	LPVOID value_context;
	LPVOID val_buff_ptr;
};

typedef struct val_context *PVALCONTEXT;

typedef struct pvalueA
{
	LPSTR pv_valuename;
	int pv_valuelen;
	LPVOID pv_value_context;
	DWORD pv_type;
} PVALUEA, *PPVALUEA;

typedef struct pvalueW
{
	LPWSTR pv_valuename;
	int pv_valuelen;
	LPVOID pv_value_context;
	DWORD pv_type;
} PVALUEW, *PPVALUEW;

#ifdef UNICODE
typedef PVALUEW PVALUE;
typedef PPVALUEW PPVALUE;
#else
typedef PVALUEA PVALUE;
typedef PPVALUEA PPVALUE;
#endif

typedef struct value_entA
{
	LPSTR ve_valuename;
	DWORD ve_valuelen;
	DWORD_PTR ve_valueptr;
	DWORD ve_type;
} VALENTA, *PVALENTA;

typedef struct value_entW
{
	LPWSTR ve_valuename;
	DWORD ve_valuelen;
	DWORD_PTR ve_valueptr;
	DWORD ve_type;
} VALENTW, *PVALENTW;

#ifdef UNICODE
typedef VALENTW VALENT;
typedef PVALENTW PVALENT;
#else
typedef VALENTA VALENT;
typedef PVALENTA PVALENT;
#endif

WINPR_API LONG RegCloseKey(HKEY hKey);

WINPR_API LONG RegCopyTreeW(HKEY hKeySrc, LPCWSTR lpSubKey, HKEY hKeyDest);
WINPR_API LONG RegCopyTreeA(HKEY hKeySrc, LPCSTR lpSubKey, HKEY hKeyDest);

#ifdef UNICODE
#define RegCopyTree RegCopyTreeW
#else
#define RegCopyTree RegCopyTreeA
#endif

WINPR_API LONG RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions,
		REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);
WINPR_API LONG RegCreateKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions,
		REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);

#ifdef UNICODE
#define RegCreateKeyEx RegCreateKeyExW
#else
#define RegCreateKeyEx RegCreateKeyExA
#endif

WINPR_API LONG RegDeleteKeyExW(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired, DWORD Reserved);
WINPR_API LONG RegDeleteKeyExA(HKEY hKey, LPCSTR lpSubKey, REGSAM samDesired, DWORD Reserved);

#ifdef UNICODE
#define RegDeleteKeyEx RegDeleteKeyExW
#else
#define RegDeleteKeyEx RegDeleteKeyExA
#endif

WINPR_API LONG RegDeleteTreeW(HKEY hKey, LPCWSTR lpSubKey);
WINPR_API LONG RegDeleteTreeA(HKEY hKey, LPCSTR lpSubKey);

#ifdef UNICODE
#define RegDeleteTree RegDeleteTreeW
#else
#define RegDeleteTree RegDeleteTreeA
#endif

WINPR_API LONG RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName);
WINPR_API LONG RegDeleteValueA(HKEY hKey, LPCSTR lpValueName);

#ifdef UNICODE
#define RegDeleteValue RegDeleteValueW
#else
#define RegDeleteValue RegDeleteValueA
#endif

WINPR_API LONG RegDisablePredefinedCacheEx(void);

WINPR_API LONG RegEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, LPDWORD lpcName,
		LPDWORD lpReserved, LPWSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime);
WINPR_API LONG RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcName,
		LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime);

#ifdef UNICODE
#define RegEnumKeyEx RegEnumKeyExW
#else
#define RegEnumKeyEx RegEnumKeyExA
#endif

WINPR_API LONG RegEnumValueW(HKEY hKey, DWORD dwIndex, LPWSTR lpValueName,
		LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
WINPR_API LONG RegEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpValueName,
		LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);

#ifdef UNICODE
#define RegEnumValue RegEnumValueW
#else
#define RegEnumValue RegEnumValueA
#endif

WINPR_API LONG RegFlushKey(HKEY hKey);

WINPR_API LONG RegGetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation,
		PSECURITY_DESCRIPTOR pSecurityDescriptor, LPDWORD lpcbSecurityDescriptor);

WINPR_API LONG RegGetValueW(HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpValue,
		DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData);
WINPR_API LONG RegGetValueA(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue,
		DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData);

#ifdef UNICODE
#define RegGetValue RegGetValueW
#else
#define RegGetValue RegGetValueA
#endif

WINPR_API LONG RegLoadAppKeyW(LPCWSTR lpFile, PHKEY phkResult,
		REGSAM samDesired, DWORD dwOptions, DWORD Reserved);
WINPR_API LONG RegLoadAppKeyA(LPCSTR lpFile, PHKEY phkResult,
		REGSAM samDesired, DWORD dwOptions, DWORD Reserved);

#ifdef UNICODE
#define RegLoadAppKey RegLoadAppKeyW
#else
#define RegLoadAppKey RegLoadAppKeyA
#endif

WINPR_API LONG RegLoadKeyW(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile);
WINPR_API LONG RegLoadKeyA(HKEY hKey, LPCSTR lpSubKey, LPCSTR lpFile);

#ifdef UNICODE
#define RegLoadKey RegLoadKeyW
#else
#define RegLoadKey RegLoadKeyA
#endif

WINPR_API LONG RegLoadMUIStringW(HKEY hKey, LPCWSTR pszValue, LPWSTR pszOutBuf,
		DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCWSTR pszDirectory);
WINPR_API LONG RegLoadMUIStringA(HKEY hKey, LPCSTR pszValue, LPSTR pszOutBuf,
		DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCSTR pszDirectory);

#ifdef UNICODE
#define RegLoadMUIString RegLoadMUIStringW
#else
#define RegLoadMUIString RegLoadMUIStringA
#endif

WINPR_API LONG RegNotifyChangeKeyValue(HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, HANDLE hEvent, BOOL fAsynchronous);

WINPR_API LONG RegOpenCurrentUser(REGSAM samDesired, PHKEY phkResult);

WINPR_API LONG RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);
WINPR_API LONG RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);

#ifdef UNICODE
#define RegOpenKeyEx RegOpenKeyExW
#else
#define RegOpenKeyEx RegOpenKeyExA
#endif

WINPR_API LONG RegOpenUserClassesRoot(HANDLE hToken, DWORD dwOptions, REGSAM samDesired, PHKEY phkResult);

WINPR_API LONG RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved,
		LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen,
		LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen,
		LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime);
WINPR_API LONG RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved,
		LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen,
		LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen,
		LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime);

#ifdef UNICODE
#define RegQueryInfoKey RegQueryInfoKeyW
#else
#define RegQueryInfoKey RegQueryInfoKeyA
#endif

WINPR_API LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName,
		LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
WINPR_API LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName,
		LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);

#ifdef UNICODE
#define RegQueryValueEx RegQueryValueExW
#else
#define RegQueryValueEx RegQueryValueExA
#endif

WINPR_API LONG RegRestoreKeyW(HKEY hKey, LPCWSTR lpFile, DWORD dwFlags);
WINPR_API LONG RegRestoreKeyA(HKEY hKey, LPCSTR lpFile, DWORD dwFlags);

#ifdef UNICODE
#define RegRestoreKey RegRestoreKeyW
#else
#define RegRestoreKey RegRestoreKeyA
#endif

WINPR_API LONG RegSaveKeyExW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags);
WINPR_API LONG RegSaveKeyExA(HKEY hKey, LPCSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags);

#ifdef UNICODE
#define RegSaveKeyEx RegSaveKeyExW
#else
#define RegSaveKeyEx RegSaveKeyExA
#endif

WINPR_API LONG RegSetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor);

WINPR_API LONG RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData);
WINPR_API LONG RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData);

#ifdef UNICODE
#define RegSetValueEx RegSetValueExW
#else
#define RegSetValueEx RegSetValueExA
#endif

WINPR_API LONG RegUnLoadKeyW(HKEY hKey, LPCWSTR lpSubKey);
WINPR_API LONG RegUnLoadKeyA(HKEY hKey, LPCSTR lpSubKey);

#ifdef UNICODE
#define RegUnLoadKey RegUnLoadKeyW
#else
#define RegUnLoadKey RegUnLoadKeyA
#endif

#ifdef __cplusplus
}
#endif

#endif

#endif /* WINPR_REGISTRY_H */