2 * FreeLoader - registry.h
4 * Copyright (C) 2001 Eric Kohl
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.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #define INVALID_HANDLE_VALUE NULL
27 typedef struct _REG_KEY
30 LIST_ENTRY SubKeyList
;
43 } KEY
, *FRLDRHKEY
, **PFRLDRHKEY
;
46 typedef struct _REG_VALUE
61 #define ERROR_SUCCESS 0L
62 #define ERROR_OUTOFMEMORY 14L
63 #define ERROR_INVALID_PARAMETER 87L
64 #define ERROR_MORE_DATA 234L
65 #define ERROR_NO_MORE_ITEMS 259L
72 * InitializeListHead (
73 * PLIST_ENTRY ListHead
76 * FUNCTION: Initializes a double linked list
78 * ListHead = Caller supplied storage for the head of the list
80 #define InitializeListHead(ListHead) \
82 (ListHead)->Flink = (ListHead); \
83 (ListHead)->Blink = (ListHead); \
90 * PLIST_ENTRY ListHead,
94 * FUNCTION: Inserts an entry in a double linked list
96 * ListHead = Head of the list
97 * Entry = Entry to insert
99 #define InsertHeadList(ListHead, ListEntry) \
101 PLIST_ENTRY OldFlink; \
102 OldFlink = (ListHead)->Flink; \
103 (ListEntry)->Flink = OldFlink; \
104 (ListEntry)->Blink = (ListHead); \
105 OldFlink->Blink = (ListEntry); \
106 (ListHead)->Flink = (ListEntry); \
107 assert((ListEntry) != NULL); \
108 assert((ListEntry)->Blink!=NULL); \
109 assert((ListEntry)->Blink->Flink == (ListEntry)); \
110 assert((ListEntry)->Flink != NULL); \
111 assert((ListEntry)->Flink->Blink == (ListEntry)); \
118 * PLIST_ENTRY ListHead,
123 * Inserts an entry in a double linked list
126 * ListHead = Head of the list
127 * Entry = Entry to insert
129 #define InsertTailList(ListHead, ListEntry) \
131 PLIST_ENTRY OldBlink; \
132 OldBlink = (ListHead)->Blink; \
133 (ListEntry)->Flink = (ListHead); \
134 (ListEntry)->Blink = OldBlink; \
135 OldBlink->Flink = (ListEntry); \
136 (ListHead)->Blink = (ListEntry); \
137 assert((ListEntry) != NULL); \
138 assert((ListEntry)->Blink != NULL); \
139 assert((ListEntry)->Blink->Flink == (ListEntry)); \
140 assert((ListEntry)->Flink != NULL); \
141 assert((ListEntry)->Flink->Blink == (ListEntry)); \
151 * Removes an entry from a double linked list
154 * ListEntry = Entry to remove
156 #define RemoveEntryList(ListEntry) \
158 PLIST_ENTRY OldFlink; \
159 PLIST_ENTRY OldBlink; \
160 assert((ListEntry) != NULL); \
161 assert((ListEntry)->Blink!=NULL); \
162 assert((ListEntry)->Blink->Flink == (ListEntry)); \
163 assert((ListEntry)->Flink != NULL); \
164 assert((ListEntry)->Flink->Blink == (ListEntry)); \
165 OldFlink = (ListEntry)->Flink; \
166 OldBlink = (ListEntry)->Blink; \
167 OldFlink->Blink = OldBlink; \
168 OldBlink->Flink = OldFlink; \
169 (ListEntry)->Flink = NULL; \
170 (ListEntry)->Blink = NULL; \
175 #define REG_EXPAND_SZ 2
178 #define REG_DWORD_BIG_ENDIAN 5
179 #define REG_DWORD_LITTLE_ENDIAN 4
181 #define REG_MULTI_SZ 7
182 #define REG_RESOURCE_LIST 8
183 #define REG_FULL_RESOURCE_DESCRIPTOR 9
184 #define REG_RESOURCE_REQUIREMENTS_LIST 10
189 RegInitializeRegistry(VOID
);
192 RegInitCurrentControlSet(BOOL LastKnownGood
);
196 RegCreateKey(FRLDRHKEY ParentKey
,
201 RegDeleteKey(FRLDRHKEY Key
,
205 RegEnumKey(FRLDRHKEY Key
,
211 RegOpenKey(FRLDRHKEY ParentKey
,
217 RegSetValue(FRLDRHKEY Key
,
224 RegQueryValue(FRLDRHKEY Key
,
231 RegDeleteValue(FRLDRHKEY Key
,
235 RegEnumValue(FRLDRHKEY Key
,
244 RegGetSubKeyCount (FRLDRHKEY Key
);
247 RegGetValueCount (FRLDRHKEY Key
);
251 RegImportBinaryHive (PCHAR ChunkBase
,
255 RegExportBinaryHive (PCHAR KeyName
,
260 #endif /* __REGISTRY_H */