[MKHIVE] Remove key name in our custom registry tree; use cell index instead
[reactos.git] / reactos / tools / mkhive / registry.h
1 /* COPYRIGHT: See COPYING in the top level directory
2 * PROJECT: ReactOS hive maker
3 * FILE: tools/mkhive/registry.h
4 * PURPOSE: Registry code
5 */
6
7 #pragma once
8
9 typedef struct _REG_VALUE
10 {
11 LIST_ENTRY ValueList;
12
13 /* value name */
14 ULONG NameSize;
15 PCHAR Name;
16
17 /* value data */
18 ULONG DataType;
19 ULONG DataSize;
20 PCHAR Data;
21 } VALUE, *PVALUE;
22
23 typedef struct _REG_KEY
24 {
25 LIST_ENTRY KeyList;
26 LIST_ENTRY SubKeyList;
27 LIST_ENTRY ValueList;
28
29 ULONG SubKeyCount;
30 ULONG ValueCount;
31
32 /* default data */
33 ULONG DataType;
34 ULONG DataSize;
35 PCHAR Data;
36
37 /* Information on hard disk structure */
38 HCELL_INDEX KeyCellOffsetInParentHive;
39 HCELL_INDEX KeyCellOffset;
40 PCM_KEY_NODE KeyCell;
41 PCMHIVE RegistryHive;
42
43 /* Used when linking to another key */
44 struct _REG_KEY* LinkedKey;
45 } KEY, *FRLDRHKEY, **PFRLDRHKEY, *MEMKEY, **PMEMKEY;
46
47 #define HKEY_TO_MEMKEY(hKey) ((MEMKEY)(hKey))
48 #define MEMKEY_TO_HKEY(memKey) ((HKEY)(memKey))
49
50 extern CMHIVE DefaultHive; /* \Registry\User\.DEFAULT */
51 extern CMHIVE SamHive; /* \Registry\Machine\SAM */
52 extern CMHIVE SecurityHive; /* \Registry\Machine\SECURITY */
53 extern CMHIVE SoftwareHive; /* \Registry\Machine\SOFTWARE */
54 extern CMHIVE SystemHive; /* \Registry\Machine\SYSTEM */
55
56 #define ERROR_SUCCESS 0L
57 #define ERROR_UNSUCCESSFUL 1L
58 #define ERROR_OUTOFMEMORY 14L
59 #define ERROR_INVALID_PARAMETER 87L
60 #define ERROR_MORE_DATA 234L
61 #define ERROR_NO_MORE_ITEMS 259L
62
63 #define REG_NONE 0
64 #define REG_SZ 1
65 #define REG_EXPAND_SZ 2
66 #define REG_BINARY 3
67 #define REG_DWORD 4
68 #define REG_DWORD_BIG_ENDIAN 5
69 #define REG_DWORD_LITTLE_ENDIAN 4
70 #define REG_LINK 6
71 #define REG_MULTI_SZ 7
72 #define REG_RESOURCE_LIST 8
73 #define REG_FULL_RESOURCE_DESCRIPTOR 9
74 #define REG_RESOURCE_REQUIREMENTS_LIST 10
75
76 LONG WINAPI
77 RegCreateKeyA(
78 IN HKEY hKey,
79 IN LPCSTR lpSubKey,
80 OUT PHKEY phkResult);
81
82 LONG WINAPI
83 RegOpenKeyA(
84 IN HKEY hKey,
85 IN LPCSTR lpSubKey,
86 OUT PHKEY phkResult);
87
88 LONG WINAPI
89 RegQueryValueExA(HKEY Key,
90 LPCSTR ValueName,
91 PULONG Reserved,
92 PULONG Type,
93 PUCHAR Data,
94 PSIZE_T DataSize);
95
96 LONG WINAPI
97 RegSetValueExA(
98 IN HKEY hKey,
99 IN LPCSTR lpValueName OPTIONAL,
100 ULONG Reserved,
101 IN ULONG dwType,
102 IN const UCHAR* lpData,
103 IN ULONG cbData);
104
105 LONG WINAPI
106 RegDeleteValueA(HKEY Key,
107 LPCSTR ValueName);
108
109 LONG WINAPI
110 RegDeleteKeyA(HKEY Key,
111 LPCSTR Name);
112
113 USHORT
114 RegGetSubKeyCount (HKEY Key);
115
116 ULONG
117 RegGetValueCount (HKEY Key);
118
119 VOID
120 RegInitializeRegistry(VOID);
121
122 VOID
123 RegShutdownRegistry(VOID);
124
125 /* EOF */