ReactOS 0.4.15-dev-8135-g1bc6c90
registry.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _HIVE_LIST_ENTRY
 

Macros

#define MAX_NUMBER_OF_REGISTRY_HIVES   7
 
#define ERROR_SUCCESS   0L
 
#define ERROR_INVALID_FUNCTION   1L
 
#define ERROR_FILE_NOT_FOUND   2L
 
#define ERROR_ACCESS_DENIED   5L
 
#define ERROR_NOT_ENOUGH_MEMORY   8L
 
#define ERROR_GEN_FAILURE   31L
 
#define ERROR_INVALID_PARAMETER   87L
 
#define ERROR_NO_LOG_SPACE   1019L
 
#define ERROR_NO_SYSTEM_RESOURCES   1450L
 
#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
 

Typedefs

typedef struct _HIVE_LIST_ENTRY HIVE_LIST_ENTRY
 
typedef struct _HIVE_LIST_ENTRYPHIVE_LIST_ENTRY
 

Functions

VOID RegInitializeRegistry (IN PCSTR HiveList)
 
VOID RegShutdownRegistry (VOID)
 

Variables

HIVE_LIST_ENTRY RegistryHives []
 

Macro Definition Documentation

◆ ERROR_ACCESS_DENIED

#define ERROR_ACCESS_DENIED   5L

Definition at line 25 of file registry.h.

◆ ERROR_FILE_NOT_FOUND

#define ERROR_FILE_NOT_FOUND   2L

Definition at line 24 of file registry.h.

◆ ERROR_GEN_FAILURE

#define ERROR_GEN_FAILURE   31L

Definition at line 27 of file registry.h.

◆ ERROR_INVALID_FUNCTION

#define ERROR_INVALID_FUNCTION   1L

Definition at line 23 of file registry.h.

◆ ERROR_INVALID_PARAMETER

#define ERROR_INVALID_PARAMETER   87L

Definition at line 28 of file registry.h.

◆ ERROR_NO_LOG_SPACE

#define ERROR_NO_LOG_SPACE   1019L

Definition at line 31 of file registry.h.

◆ ERROR_NO_SYSTEM_RESOURCES

#define ERROR_NO_SYSTEM_RESOURCES   1450L

Definition at line 32 of file registry.h.

◆ ERROR_NOT_ENOUGH_MEMORY

#define ERROR_NOT_ENOUGH_MEMORY   8L

Definition at line 26 of file registry.h.

◆ ERROR_SUCCESS

#define ERROR_SUCCESS   0L

Definition at line 22 of file registry.h.

◆ MAX_NUMBER_OF_REGISTRY_HIVES

#define MAX_NUMBER_OF_REGISTRY_HIVES   7

Definition at line 19 of file registry.h.

◆ REG_BINARY

#define REG_BINARY   3

Definition at line 37 of file registry.h.

◆ REG_DWORD

#define REG_DWORD   4

Definition at line 38 of file registry.h.

◆ REG_DWORD_BIG_ENDIAN

#define REG_DWORD_BIG_ENDIAN   5

Definition at line 40 of file registry.h.

◆ REG_DWORD_LITTLE_ENDIAN

#define REG_DWORD_LITTLE_ENDIAN   4

Definition at line 39 of file registry.h.

◆ REG_EXPAND_SZ

#define REG_EXPAND_SZ   2

Definition at line 36 of file registry.h.

◆ REG_FULL_RESOURCE_DESCRIPTOR

#define REG_FULL_RESOURCE_DESCRIPTOR   9

Definition at line 44 of file registry.h.

◆ REG_LINK

#define REG_LINK   6

Definition at line 41 of file registry.h.

◆ REG_MULTI_SZ

#define REG_MULTI_SZ   7

Definition at line 42 of file registry.h.

◆ REG_NONE

#define REG_NONE   0

Definition at line 34 of file registry.h.

◆ REG_QWORD

#define REG_QWORD   11

Definition at line 46 of file registry.h.

◆ REG_QWORD_LITTLE_ENDIAN

#define REG_QWORD_LITTLE_ENDIAN   11

Definition at line 47 of file registry.h.

◆ REG_RESOURCE_LIST

#define REG_RESOURCE_LIST   8

Definition at line 43 of file registry.h.

◆ REG_RESOURCE_REQUIREMENTS_LIST

#define REG_RESOURCE_REQUIREMENTS_LIST   10

Definition at line 45 of file registry.h.

◆ REG_SZ

#define REG_SZ   1

Definition at line 35 of file registry.h.

Typedef Documentation

◆ HIVE_LIST_ENTRY

◆ PHIVE_LIST_ENTRY

Function Documentation

◆ RegInitializeRegistry()

VOID RegInitializeRegistry ( IN PCSTR  HiveList)

Definition at line 1134 of file registry.c.

1136{
1138 UINT i;
1139 HKEY ControlSetKey;
1140
1143
1145 if (!NT_SUCCESS(Status))
1146 {
1147 DPRINT1("CmiInitializeHive() failed with status 0x%08x\n", Status);
1148 return;
1149 }
1150
1153
1154 for (i = 0; i < _countof(RegistryHives); ++i)
1155 {
1156 /* Skip this registry hive if it's not in the list */
1157 if (!strstr(HiveList, RegistryHives[i].HiveName))
1158 continue;
1159
1160 /* Create the registry key */
1162 RegistryHives[i].HiveRegistryPath,
1163 RegistryHives[i].CmHive,
1166
1167 /* If we happen to deal with the special setup registry hive, stop there */
1168 // if (strcmp(RegistryHives[i].HiveName, "SETUPREG") == 0)
1169 if (i == 0)
1170 break;
1171 }
1172
1173 /* Create the 'ControlSet001' key */
1175 L"Registry\\Machine\\SYSTEM\\ControlSet001",
1176 &ControlSetKey);
1177
1178 /* Create the 'CurrentControlSet' key as a symlink to 'ControlSet001' */
1179 CreateSymLink(L"Registry\\Machine\\SYSTEM\\CurrentControlSet",
1180 NULL, ControlSetKey);
1181
1182 RegCloseKey(ControlSetKey);
1183
1184#if 0
1185 /* Link SECURITY to SAM */
1186 CmpLinkKeyToHive(L"\\Registry\\Machine\\Security\\SAM", L"\\Registry\\Machine\\SAM\\SAM");
1187 /* Link S-1-5-18 to .Default */
1188 CmpLinkKeyToHive(L"\\Registry\\User\\S-1-5-18", L"\\Registry\\User\\.Default");
1189#endif
1190}
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
HIVE_LIST_ENTRY RegistryHives[]
Definition: registry.c:581
#define RegCloseKey(hKey)
Definition: registry.h:49
NTSTATUS CmiInitializeHive(IN OUT PCMHIVE Hive, IN PCWSTR Name)
Definition: cmi.c:114
BOOLEAN NTAPI CmpLinkKeyToHive(_In_z_ PCWSTR LinkKeyName, _In_z_ PCWSTR TargetKeyName)
Definition: cmsysini.c:45
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
_In_ ULONG SecurityDescriptorLength
Definition: rtlfuncs.h:1714
#define L(x)
Definition: ntvdm.h:50
NTSTATUS ConnectRegistry(IN HANDLE RootKey OPTIONAL, IN PCWSTR RegMountPoint, IN PUNICODE_STRING NtSystemRoot, IN PCWSTR RegistryKey)
Definition: regutil.c:391
LIST_ENTRY CmiHiveListHead
Definition: registry.c:385
static PMEMKEY RootKey
Definition: registry.c:55
static CMHIVE RootHive
Definition: registry.c:54
LIST_ENTRY CmiReparsePointsHead
Definition: registry.c:386
static BOOL CreateSymLink(IN PCWSTR LinkKeyPath OPTIONAL, IN OUT PHKEY LinkKeyHandle OPTIONAL, IN HKEY TargetKeyHandle)
Definition: registry.c:1081
static PMEMKEY CreateInMemoryStructure(IN PCMHIVE RegistryHive, IN HCELL_INDEX KeyCellOffset)
Definition: registry.c:370
LONG WINAPI RegCreateKeyW(IN HKEY hKey, IN LPCWSTR lpSubKey, OUT PHKEY phkResult)
Definition: registry.c:524
#define _countof(array)
Definition: sndvol32.h:70
HHIVE Hive
Definition: cmlib.h:317
HCELL_INDEX RootCell
Definition: hivedata.h:168
PHBASE_BLOCK BaseBlock
Definition: hivedata.h:328
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:191

◆ RegShutdownRegistry()

VOID RegShutdownRegistry ( VOID  )

Definition at line 1193 of file registry.c.

1194{
1196 PREPARSE_POINT ReparsePoint;
1197
1198 /* Clean up the reparse points list */
1200 {
1202 ReparsePoint = CONTAINING_RECORD(Entry, REPARSE_POINT, ListEntry);
1203 free(ReparsePoint);
1204 }
1205
1206 /* FIXME: clean up the complete hive */
1207
1208 free(RootKey);
1209}
#define free
Definition: debug_ros.c:5
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
base of all file and directory entries
Definition: entries.h:83
Definition: typedefs.h:120
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by main().

Variable Documentation

◆ RegistryHives

HIVE_LIST_ENTRY RegistryHives[]
extern