[FREELDR]
[reactos.git] / reactos / boot / freeldr / freeldr / include / registry.h
1 /*
2 * FreeLoader - registry.h
3 *
4 * Copyright (C) 2001 Eric Kohl
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #ifndef __REGISTRY_H
22 #define __REGISTRY_H
23
24 #define TAG_REG_NAME 'NgeR'
25 #define TAG_REG_KEY 'KgeR'
26 #define TAG_REG_KEY_DATA 'DgeR'
27 #define TAG_REG_VALUE 'VgeR'
28
29 typedef struct _REG_KEY
30 {
31 LIST_ENTRY KeyList;
32 LIST_ENTRY SubKeyList;
33 LIST_ENTRY ValueList;
34
35 ULONG SubKeyCount;
36 ULONG ValueCount;
37
38 ULONG NameSize;
39 PWCHAR Name;
40
41 /* default data */
42 ULONG DataType;
43 ULONG DataSize;
44 PCHAR Data;
45 } KEY, *FRLDRHKEY, **PFRLDRHKEY;
46
47
48 typedef struct _REG_VALUE
49 {
50 LIST_ENTRY ValueList;
51
52 /* value name */
53 ULONG NameSize;
54 PWCHAR Name;
55
56 /* value data */
57 ULONG DataType;
58 ULONG DataSize;
59 PCHAR Data;
60 } VALUE, *PVALUE;
61
62 #define assert(x)
63
64 VOID
65 RegInitializeRegistry(VOID);
66
67 LONG
68 RegInitCurrentControlSet(BOOLEAN LastKnownGood);
69
70
71 LONG
72 RegCreateKey(FRLDRHKEY ParentKey,
73 PCWSTR KeyName,
74 PFRLDRHKEY Key);
75
76 LONG
77 RegDeleteKey(FRLDRHKEY Key,
78 PCWSTR Name);
79
80 LONG
81 RegEnumKey(
82 _In_ FRLDRHKEY Key,
83 _In_ ULONG Index,
84 _Out_ PWCHAR Name,
85 _Inout_ ULONG* NameSize,
86 _Out_opt_ FRLDRHKEY *SubKey);
87
88 LONG
89 RegOpenKey(FRLDRHKEY ParentKey,
90 PCWSTR KeyName,
91 PFRLDRHKEY Key);
92
93
94 LONG
95 RegSetValue(FRLDRHKEY Key,
96 PCWSTR ValueName,
97 ULONG Type,
98 PCSTR Data,
99 ULONG DataSize);
100
101 LONG
102 RegQueryValue(FRLDRHKEY Key,
103 PCWSTR ValueName,
104 ULONG* Type,
105 PUCHAR Data,
106 ULONG* DataSize);
107
108 LONG
109 RegDeleteValue(FRLDRHKEY Key,
110 PCWSTR ValueName);
111
112 LONG
113 RegEnumValue(FRLDRHKEY Key,
114 ULONG Index,
115 PWCHAR ValueName,
116 ULONG* NameSize,
117 ULONG* Type,
118 PUCHAR Data,
119 ULONG* DataSize);
120
121 ULONG
122 RegGetSubKeyCount (FRLDRHKEY Key);
123
124 ULONG
125 RegGetValueCount (FRLDRHKEY Key);
126
127
128 BOOLEAN
129 RegImportBinaryHive (PCHAR ChunkBase,
130 ULONG ChunkSize);
131
132 BOOLEAN
133 RegExportBinaryHive (PCWSTR KeyName,
134 PCHAR ChunkBase,
135 ULONG* ChunkSize);
136
137
138 #endif /* __REGISTRY_H */
139
140 /* EOF */
141