diff --git a/reactos/boot.hiv b/reactos/boot.hiv deleted file mode 100644 index da41d09379d..00000000000 --- a/reactos/boot.hiv +++ /dev/null @@ -1,46 +0,0 @@ -REGEDIT4 - -[\Registry\Machine\HARDWARE] - -[\Registry\Machine\HARDWARE\DESCRIPTION] - -[\Registry\Machine\HARDWARE\DESCRIPTION\System] - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter] - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0] -"Component Information"=hex:00,00,00,00,00,00,00,00,00,00,00,00,ff,ff,ff,ff -"Identifier"="ISA" -"Configuration Data"=hex(9):01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\KeyboardController] - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\KeyboardController\0] -"Component Information"=hex:28,00,00,00,00,00,00,00,00,00,00,00,ff,ff,ff,ff -"Configuration Data"=hex(9):01,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,01,\ - 01,01,00,60,00,00,00,00,00,00,00,01,00,00,00,01,01,01,00,64,00,00,00,00,00,\ - 00,00,01,00,00,00,02,00,01,00,01,00,00,00,01,00,00,00,ff,ff,ff,ff - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\KeyboardController\0\KeyboardPeripheral] - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\KeyboardController\0\KeyboardPeripheral\0] -"Component Information"=hex:28,00,00,00,00,00,00,00,00,00,00,00,ff,ff,ff,ff -"Identifier"="PCAT_ENHANCED" -"Configuration Data"=hex(9):01,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,05,\ - 00,00,00,08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,00 - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\PointerController] - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\PointerController\0] -"Component Information"=hex:20,00,00,00,00,00,00,00,00,00,00,00,ff,ff,ff,ff -"Configuration Data"=hex(9):01,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,02,\ - 00,01,00,0c,00,00,00,0c,00,00,00,ff,ff,ff,ff - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\PointerController\0\PointerPeripheral] - -[\Registry\Machine\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\0\PointerController\0\PointerPeripheral\0] -"Component Information"=hex:20,00,00,00,00,00,00,00,00,00,00,00,ff,ff,ff,ff -"Identifier"="MICROSOFT PS2 MOUSE" -"Configuration Data"=hex(9):01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 - - diff --git a/reactos/ntoskrnl/cm/cm.h b/reactos/ntoskrnl/cm/cm.h index 69f6866583a..80443665766 100644 --- a/reactos/ntoskrnl/cm/cm.h +++ b/reactos/ntoskrnl/cm/cm.h @@ -393,6 +393,23 @@ CmiObjectSecurity(PVOID ObjectBody, PSECURITY_DESCRIPTOR SecurityDescriptor, PULONG BufferLength); +NTSTATUS +CmiImportHiveBins(PREGISTRY_HIVE Hive, + PUCHAR ChunkPtr); + +VOID +CmiFreeHiveBins(PREGISTRY_HIVE Hive); + +NTSTATUS +CmiCreateHiveFreeCellList(PREGISTRY_HIVE Hive); + +VOID +CmiFreeHiveFreeCellList(PREGISTRY_HIVE Hive); + +NTSTATUS +CmiCreateHiveBitmap(PREGISTRY_HIVE Hive); + + VOID CmiAddKeyToList(PKEY_OBJECT ParentKey, IN PKEY_OBJECT NewKey); diff --git a/reactos/ntoskrnl/cm/import.c b/reactos/ntoskrnl/cm/import.c index b273386d1d6..1e41d62c032 100644 --- a/reactos/ntoskrnl/cm/import.c +++ b/reactos/ntoskrnl/cm/import.c @@ -1,12 +1,14 @@ -/* $Id: import.c,v 1.18 2003/04/24 12:28:57 ekohl Exp $ +/* $Id: import.c,v 1.19 2003/05/24 13:18:32 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/cm/import.c - * PURPOSE: Registry functions - * PROGRAMMERS: Rex Jolliff + * PURPOSE: Registry-Hive import functions + * PROGRAMMERS: Eric Kohl */ +/* INCLUDES *****************************************************************/ + #include #include @@ -27,594 +29,9 @@ static BOOLEAN CmiHardwareHiveImported = FALSE; + /* FUNCTIONS ****************************************************************/ -static PCHAR -checkAndSkipMagic (PCHAR regChunk) -{ - if (strncmp (regChunk, - REGISTRY_FILE_MAGIC, - strlen (REGISTRY_FILE_MAGIC)) != 0) - { - CPRINT ("incorrect magic number in registry chunk. expected: %s got:%.*s\n", - REGISTRY_FILE_MAGIC, - strlen (REGISTRY_FILE_MAGIC), - regChunk); - return 0; - } - regChunk += strlen (REGISTRY_FILE_MAGIC); - DPRINT ("Found regsitry chunk magic value\n"); - - return regChunk; -} - -static PCHAR -skipWhitespaceInChunk (PCHAR regChunk) -{ - while (*regChunk && isspace (*regChunk)) - regChunk++; - - return *regChunk ? regChunk : 0; -} - -static int -computeKeyNameSize (PCHAR regChunk) -{ - int copyCount = 0; - - while (*regChunk != 0 && *regChunk != ']') - { - copyCount++; - regChunk++; - } - - return copyCount; -} - -static BOOLEAN -allocateKeyName (PUNICODE_STRING newKeyName, int newKeySize) -{ - if (newKeyName->MaximumLength < (newKeySize + 1) * sizeof (WCHAR)) - { - if (newKeyName->Buffer != 0) - ExFreePool (newKeyName->Buffer); - newKeyName->Length = 0; - newKeyName->MaximumLength = (newKeySize + 1) * sizeof (WCHAR); - newKeyName->Buffer = ExAllocatePool (NonPagedPool, newKeyName->MaximumLength); - if (newKeyName->Buffer == 0) - { - CPRINT ("Could not allocate space for key name\n"); - return FALSE; - } - newKeyName->Buffer [0] = 0; - } - else - { - newKeyName->Length = 0; - newKeyName->Buffer [0] = 0; - } - - return TRUE; -} - -static PCHAR -skipToNextKeyInChunk (PCHAR regChunk) -{ - while (*regChunk != 0 && *regChunk != '[') - { - while (*regChunk != 0 && *regChunk != '\n') - { - regChunk++; - } - regChunk++; - } - - return *regChunk ? regChunk : 0; -} - -static PCHAR -getKeyNameFromChunk (PCHAR regChunk, PUNICODE_STRING newKeyName) -{ - int index = 0; - - while (*regChunk != 0 && *regChunk != ']') - { - newKeyName->Buffer [index++] = *regChunk++; - } - newKeyName->Buffer [index] = '\0'; - newKeyName->Length = index * sizeof (WCHAR); - - return *regChunk ? regChunk : 0; -} - -static HANDLE -createNewKey (PUNICODE_STRING newKeyName) -{ - NTSTATUS status; - OBJECT_ATTRIBUTES attributes; - HANDLE handleToReturn; - - DPRINT ("Creating key (%wZ)\n", newKeyName); - InitializeObjectAttributes (&attributes, - newKeyName, - 0, - 0, - NULL); - status = NtCreateKey (&handleToReturn, - KEY_ALL_ACCESS, - &attributes, - 0, - NULL, - REG_OPTION_VOLATILE, - NULL); - if (!NT_SUCCESS(status)) - { - CPRINT ("Could not crete key (%wZ)\n", newKeyName); - return INVALID_HANDLE_VALUE; - } - - return handleToReturn; -} - -static PCHAR -skipToNextKeyValueInChunk (PCHAR regChunk) -{ - while (*regChunk != 0 && *regChunk != '\n') - regChunk++; - regChunk = skipWhitespaceInChunk (regChunk); - - return regChunk; -} - -static int -computeKeyValueNameSize (PCHAR regChunk) -{ - int size = 0; - - if (*regChunk != '\"') - return 0; - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - size++; - regChunk++; - } - - return regChunk ? size : 0; -} - -static PCHAR -getKeyValueNameFromChunk (PCHAR regChunk, PUNICODE_STRING newKeyName) -{ - int index = 0; - - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - newKeyName->Buffer [index++] = *regChunk++; - } - newKeyName->Buffer [index] = '\0'; - newKeyName->Length = index * sizeof (WCHAR); - regChunk++; - - return *regChunk ? regChunk : 0; -} - -static PCHAR -getKeyValueTypeFromChunk (PCHAR regChunk, PCHAR dataFormat, int *keyValueType) -{ - if (*regChunk == '\"') - { - strcpy (dataFormat, "string"); - *keyValueType = REG_SZ; - } - else if (strncmp (regChunk, "hex", 3) == 0) - { - strcpy (dataFormat, "hex"); - regChunk += 3; - if (*regChunk == '(') - { - regChunk++; - *keyValueType = atoi (regChunk); - while (*regChunk != 0 && *regChunk != ')') - regChunk++; - regChunk++; - } - else - *keyValueType = REG_BINARY; - if (*regChunk == ':') - regChunk++; - } - else if (strncmp (regChunk, "dword", 5) == 0) - { - strcpy (dataFormat, "dword"); - *keyValueType = REG_DWORD; - regChunk += 5; - if (*regChunk == ':') - regChunk++; - } - else if (strncmp (regChunk, "multi", 5) == 0) - { - strcpy (dataFormat, "multi"); - *keyValueType = REG_MULTI_SZ; - regChunk += 5; - if (*regChunk == ':') - regChunk++; - } - else if (strncmp (regChunk, "expand", 6) == 0) - { - strcpy (dataFormat, "expand"); - *keyValueType = REG_EXPAND_SZ; - regChunk += 6; - if (*regChunk == ':') - regChunk++; - } - else - { - UNIMPLEMENTED; - } - - return *regChunk ? regChunk : 0; -} - -static int -computeKeyValueDataSize (PCHAR regChunk, PCHAR dataFormat) -{ - int dataSize = 0; - - if (strcmp (dataFormat, "string") == 0) - { - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - dataSize++; - dataSize++; - regChunk++; - } - dataSize++; - dataSize++; - } - else if (strcmp (dataFormat, "hex") == 0) - { - while (*regChunk != 0 && isxdigit(*regChunk)) - { - regChunk++; - regChunk++; - dataSize++; - if (*regChunk == ',') - { - regChunk++; - if (*regChunk == '\\') - { - regChunk++; - regChunk = skipWhitespaceInChunk (regChunk); - } - } - } - } - else if (strcmp (dataFormat, "dword") == 0) - { - dataSize = sizeof(DWORD); - while (*regChunk != 0 && isxdigit(*regChunk)) - { - regChunk++; - } - } - else if (strcmp (dataFormat, "multi") == 0) - { - while (*regChunk == '\"') - { - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - dataSize++; - dataSize++; - regChunk++; - } - regChunk++; - dataSize++; - dataSize++; - if (*regChunk == ',') - { - regChunk++; - regChunk = skipWhitespaceInChunk (regChunk); - if (*regChunk == '\\') - { - regChunk++; - regChunk = skipWhitespaceInChunk (regChunk); - } - } - else - break; - } - dataSize++; - dataSize++; - } - else if (strcmp (dataFormat, "expand") == 0) - { - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - dataSize++; - dataSize++; - regChunk++; - } - dataSize++; - dataSize++; - } - else - { - UNIMPLEMENTED; - } - - return dataSize; -} - -static BOOLEAN -allocateDataBuffer (PVOID * data, int * dataBufferSize, int dataSize) -{ - if (*dataBufferSize < dataSize) - { - if (*dataBufferSize > 0) - ExFreePool (*data); - *data = ExAllocatePool (NonPagedPool, dataSize); - *dataBufferSize = dataSize; - } - - return TRUE; -} - -static PCHAR -getKeyValueDataFromChunk (PCHAR regChunk, PCHAR dataFormat, PCHAR data) -{ - char dataValue; - ULONG ulValue; - PWCHAR ptr; - - if (strcmp (dataFormat, "string") == 0) - { - /* convert quoted string to zero-terminated Unicode string */ - ptr = (PWCHAR)data; - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - *ptr++ = (WCHAR)*regChunk++; - } - *ptr = 0; - regChunk++; - } - else if (strcmp (dataFormat, "hex") == 0) - { - while (*regChunk != 0 && isxdigit (*regChunk)) - { - dataValue = (isdigit (*regChunk) ? *regChunk - '0' : - tolower(*regChunk) - 'a' + 10) << 4; - regChunk++; - dataValue += (isdigit (*regChunk) ? *regChunk - '0' : - tolower(*regChunk) - 'a' + 10); - regChunk++; - *data++ = dataValue; - if (*regChunk == ',') - { - regChunk++; - if (*regChunk == '\\') - { - regChunk++; - regChunk = skipWhitespaceInChunk (regChunk); - } - } - } - } - else if (strcmp (dataFormat, "dword") == 0) - { - ulValue = 0; - while (*regChunk != 0 && isxdigit(*regChunk)) - { - dataValue = (isdigit (*regChunk) ? *regChunk - '0' : - tolower(*regChunk) - 'a' + 10); - ulValue = (ulValue << 4) + dataValue; - regChunk++; - } - memcpy(data, &ulValue, sizeof(ULONG)); - } - else if (strcmp (dataFormat, "multi") == 0) - { - ptr = (PWCHAR)data; - while (*regChunk == '\"') - { - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - *ptr++ = (WCHAR)*regChunk++; - } - regChunk++; - *ptr++ = 0; - if (*regChunk == ',') - { - regChunk++; - regChunk = skipWhitespaceInChunk (regChunk); - if (*regChunk == '\\') - { - regChunk++; - regChunk = skipWhitespaceInChunk (regChunk); - } - } - else - break; - } - *ptr = 0; - } - else if (strcmp (dataFormat, "expand") == 0) - { - /* convert quoted string to zero-terminated Unicode string */ - ptr = (PWCHAR)data; - regChunk++; - while (*regChunk != 0 && *regChunk != '\"') - { - *ptr++ = (WCHAR)*regChunk++; - } - *ptr = 0; - regChunk++; - } - else - { - UNIMPLEMENTED; - } - - return *regChunk ? regChunk : 0; -} - -static BOOLEAN -setKeyValue (HANDLE currentKey, - PUNICODE_STRING newValueName, - ULONG keyValueType, - PVOID data, - ULONG dataSize) -{ - NTSTATUS status; - - DPRINT ("Adding value (%wZ) to current key, with data type %d size %d\n", - newValueName, - keyValueType, - dataSize); - status = NtSetValueKey (currentKey, - newValueName, - 0, - keyValueType, - data, - dataSize); - if (!NT_SUCCESS(status)) - { - CPRINT ("could not set key value, rc:%08x\n", status); - return FALSE; - } - - return TRUE; -} - -VOID -CmImportTextHive(PCHAR ChunkBase, - ULONG ChunkSize) -{ - HANDLE currentKey = INVALID_HANDLE_VALUE; - int newKeySize; - UNICODE_STRING newKeyName = {0, 0, 0}; - char dataFormat [10]; - int keyValueType; - int dataSize = 0; - int dataBufferSize = 0; - PVOID data = 0; - PCHAR regChunk; - - DPRINT("ChunkBase %p ChunkSize %lx\n", ChunkBase, ChunkSize); - - regChunk = checkAndSkipMagic (ChunkBase); - if (regChunk == 0) - return; - - while (regChunk != 0 && *regChunk != 0 && (((ULONG)regChunk-(ULONG)ChunkBase) < ChunkSize)) - { - regChunk = skipWhitespaceInChunk (regChunk); - if (regChunk == 0) - continue; - - if (*regChunk == '[') - { - if (currentKey != INVALID_HANDLE_VALUE) - { - DPRINT("Closing current key: 0x%lx\n", currentKey); - NtClose (currentKey); - currentKey = INVALID_HANDLE_VALUE; - } - - regChunk++; - - newKeySize = computeKeyNameSize (regChunk); - if (!allocateKeyName (&newKeyName, newKeySize)) - { - regChunk = 0; - continue; - } - - regChunk = getKeyNameFromChunk (regChunk, &newKeyName); - if (regChunk == 0) - continue; - - currentKey = createNewKey (&newKeyName); - if (currentKey == INVALID_HANDLE_VALUE) - { - regChunk = skipToNextKeyInChunk (regChunk); - continue; - } - - regChunk++; - } - else - { - if (currentKey == INVALID_HANDLE_VALUE) - { - regChunk = skipToNextKeyInChunk (regChunk); - continue; - } - - newKeySize = computeKeyValueNameSize (regChunk); - if (!allocateKeyName (&newKeyName, newKeySize)) - { - regChunk = 0; - continue; - } - - regChunk = getKeyValueNameFromChunk (regChunk, &newKeyName); - if (regChunk == 0) - continue; - - if (*regChunk != '=') - { - regChunk = skipToNextKeyValueInChunk (regChunk); - continue; - } - regChunk++; - - regChunk = getKeyValueTypeFromChunk (regChunk, dataFormat, &keyValueType); - if (regChunk == 0) - continue; - - dataSize = computeKeyValueDataSize (regChunk, dataFormat); - if (!allocateDataBuffer (&data, &dataBufferSize, dataSize)) - { - regChunk = 0; - continue; - } - - regChunk = getKeyValueDataFromChunk (regChunk, dataFormat, data); - if (regChunk == 0) - continue; - - if (!setKeyValue (currentKey, &newKeyName, keyValueType, data, dataSize)) - { - regChunk = 0; - continue; - } - } - } - - if (currentKey != INVALID_HANDLE_VALUE) - { - NtClose (currentKey); - } - if (newKeyName.Buffer != 0) - { - ExFreePool (newKeyName.Buffer); - } - if (data != 0) - { - ExFreePool (data); - } - - return; -} - - static BOOLEAN CmImportBinaryHive (PCHAR ChunkBase, ULONG ChunkSize, @@ -622,17 +39,11 @@ CmImportBinaryHive (PCHAR ChunkBase, PREGISTRY_HIVE *RegistryHive) { PREGISTRY_HIVE Hive; - PCELL_HEADER FreeBlock; - BLOCK_OFFSET BlockOffset; - PHBIN Bin; - ULONG i, j; - ULONG FreeOffset; NTSTATUS Status; - ULONG BitmapSize; *RegistryHive = NULL; - if (strncmp (ChunkBase, "regf", 4) != 0) + if (strncmp (ChunkBase, "regf", 4)) { DPRINT1 ("Found invalid '%*s' magic\n", 4, ChunkBase); return FALSE; @@ -677,9 +88,9 @@ CmImportBinaryHive (PCHAR ChunkBase, /* Allocate block list */ DPRINT("Space needed for block list describing hive: 0x%x\n", - sizeof(PHBIN *) * Hive->BlockListSize); + Hive->BlockListSize * sizeof(PHBIN *)); Hive->BlockList = ExAllocatePool (NonPagedPool, - sizeof(PHBIN *) * Hive->BlockListSize); + Hive->BlockListSize * sizeof(PHBIN *)); if (Hive->BlockList == NULL) { DPRINT1 ("Allocating block list failed\n"); @@ -687,106 +98,50 @@ CmImportBinaryHive (PCHAR ChunkBase, ExFreePool (Hive); return FALSE; } + RtlZeroMemory (Hive->BlockList, + Hive->BlockListSize * sizeof(PHBIN *)); - /* Allocate the hive block */ - Hive->BlockList[0] = ExAllocatePool (PagedPool, - Hive->FileSize - 4096); - if (Hive->BlockList[0] == NULL) + /* Import the bins */ + Status = CmiImportHiveBins(Hive, + (PUCHAR)((ULONG_PTR)ChunkBase + 4096)); + if (!NT_SUCCESS(Status)) { - DPRINT1 ("Allocating the first hive block failed\n"); + DPRINT1 ("CmiImportHiveBins() failed (Status %lx)\n", Status); + CmiFreeHiveBins (Hive); ExFreePool (Hive->BlockList); ExFreePool (Hive->HiveHeader); ExFreePool (Hive); - return FALSE; + return Status; } - /* Import the hive block */ - RtlCopyMemory (Hive->BlockList[0], - ChunkBase + 4096, - Hive->FileSize - 4096); - - /* Initialize the free block list */ - Hive->FreeListSize = 0; - Hive->FreeListMax = 0; - Hive->FreeList = NULL; - - BlockOffset = 0; - for (i = 0; i < Hive->BlockListSize; i++) + /* Initialize the free cell list */ + Status = CmiCreateHiveFreeCellList (Hive); + if (!NT_SUCCESS(Status)) { - Hive->BlockList[i] = (PHBIN) (((ULONG_PTR)Hive->BlockList[0]) + BlockOffset); - Bin = (PHBIN) (((ULONG_PTR)Hive->BlockList[i])); - if (Bin->BlockId != REG_BIN_ID) - { - DPRINT1 ("Bad BlockId %x, offset %x\n", Bin->BlockId, BlockOffset); - /* FIXME: */ - assert(FALSE); -// return STATUS_INSUFFICIENT_RESOURCES; - } + DPRINT1 ("CmiCreateHiveFreeCellList() failed (Status %lx)\n", Status); + CmiFreeHiveBins (Hive); + ExFreePool (Hive->BlockList); + ExFreePool (Hive->HiveHeader); + ExFreePool (Hive); - assertmsg((Bin->BlockSize % 4096) == 0, ("BlockSize (0x%.08x) must be multiplum of 4K\n", Bin->BlockSize)); - - if (Bin->BlockSize > 4096) - { - for (j = 1; j < Bin->BlockSize / 4096; j++) - { - Hive->BlockList[i + j] = Hive->BlockList[i]; - } - i = i + j - 1; - } - - /* Search free blocks and add to list */ - FreeOffset = REG_HBIN_DATA_OFFSET; - while (FreeOffset < Bin->BlockSize) - { - FreeBlock = (PCELL_HEADER) ((ULONG_PTR)Hive->BlockList[i] + FreeOffset); - if (FreeBlock->CellSize > 0) - { - Status = CmiAddFree(Hive, - FreeBlock, - Hive->BlockList[i]->BlockOffset + FreeOffset, - FALSE); - if (!NT_SUCCESS(Status)) - { - /* FIXME: */ - assert(FALSE); - } - - FreeOffset += FreeBlock->CellSize; - } - else - { - FreeOffset -= FreeBlock->CellSize; - } - } - BlockOffset += Bin->BlockSize; + return Status; } if (!(Hive->Flags & HIVE_VOLATILE)) { - /* Calculate bitmap size in bytes (always a multiple of 32 bits) */ - BitmapSize = ROUND_UP (Hive->BlockListSize, sizeof(ULONG) * 8) / 8; - DPRINT ("Hive->BlockListSize: %lu\n", Hive->BlockListSize); - DPRINT ("BitmapSize: %lu Bytes %lu Bits\n", BitmapSize, BitmapSize * 8); - - /* Allocate bitmap */ - Hive->BitmapBuffer = (PULONG)ExAllocatePool (PagedPool, - BitmapSize); - if (Hive->BitmapBuffer == NULL) + /* Create the block bitmap */ + Status = CmiCreateHiveBitmap (Hive); + if (!NT_SUCCESS(Status)) { - DPRINT1 ("Allocating the hive bitmap failed\n"); - ExFreePool (Hive->BlockList[0]); + DPRINT1 ("CmiCreateHiveBitmap() failed (Status %lx)\n", Status); + CmiFreeHiveFreeCellList (Hive); + CmiFreeHiveBins (Hive); ExFreePool (Hive->BlockList); ExFreePool (Hive->HiveHeader); ExFreePool (Hive); - return FALSE; - } - /* Initialize bitmap */ - RtlInitializeBitMap (&Hive->DirtyBitMap, - Hive->BitmapBuffer, - BitmapSize * 8); - RtlClearAllBits (&Hive->DirtyBitMap); - Hive->HiveDirty = FALSE; + return Status; + } } /* Initialize the hive's executive resource */ @@ -817,13 +172,7 @@ CmImportSystemHive(PCHAR ChunkBase, DPRINT ("CmImportSystemHive() called\n"); - if (strncmp (ChunkBase, "REGEDIT4", 8) == 0) - { - DPRINT ("Found 'REGEDIT4' magic\n"); - CmImportTextHive (ChunkBase, ChunkSize); - return TRUE; - } - else if (strncmp (ChunkBase, "regf", 4) != 0) + if (strncmp (ChunkBase, "regf", 4)) { DPRINT1 ("Found invalid '%.*s' magic\n", 4, ChunkBase); return FALSE; @@ -882,8 +231,8 @@ CmImportHardwareHive(PCHAR ChunkBase, ChunkSize == 0) { /* Create '\Registry\Machine\HARDWARE' key. */ - RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\HARDWARE"); + RtlInitUnicodeString (&KeyName, + L"\\Registry\\Machine\\HARDWARE"); InitializeObjectAttributes (&ObjectAttributes, &KeyName, 0, @@ -924,8 +273,8 @@ CmImportHardwareHive(PCHAR ChunkBase, NtClose (HardwareKey); /* Create '\Registry\Machine\HARDWARE\DEVICEMAP' key. */ - RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\HARDWARE\\DEVICEMAP"); + RtlInitUnicodeString (&KeyName, + L"\\Registry\\Machine\\HARDWARE\\DEVICEMAP"); InitializeObjectAttributes (&ObjectAttributes, &KeyName, 0, @@ -968,7 +317,8 @@ CmImportHardwareHive(PCHAR ChunkBase, return TRUE; } - if (strncmp (ChunkBase, "regf", 4) != 0) + /* Check the hive magic */ + if (strncmp (ChunkBase, "regf", 4)) { DPRINT1 ("Found invalid '%.*s' magic\n", 4, ChunkBase); return FALSE; diff --git a/reactos/ntoskrnl/cm/ntfunc.c b/reactos/ntoskrnl/cm/ntfunc.c index 91a3f95c042..6d4f7b5fb37 100644 --- a/reactos/ntoskrnl/cm/ntfunc.c +++ b/reactos/ntoskrnl/cm/ntfunc.c @@ -1343,8 +1343,8 @@ NtSetValueKey(IN HANDLE KeyHandle, NTSTATUS STDCALL -NtDeleteValueKey(IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName) +NtDeleteValueKey (IN HANDLE KeyHandle, + IN PUNICODE_STRING ValueName) { PKEY_OBJECT KeyObject; NTSTATUS Status; @@ -1381,16 +1381,17 @@ NtDeleteValueKey(IN HANDLE KeyHandle, return Status; } + /* * NOTE: * KeyObjectAttributes->RootDirectory specifies the handle to the parent key and * KeyObjectAttributes->Name specifies the name of the key to load. */ NTSTATUS STDCALL -NtLoadKey(IN POBJECT_ATTRIBUTES KeyObjectAttributes, - IN POBJECT_ATTRIBUTES FileObjectAttributes) +NtLoadKey (IN POBJECT_ATTRIBUTES KeyObjectAttributes, + IN POBJECT_ATTRIBUTES FileObjectAttributes) { - return NtLoadKey2(KeyObjectAttributes, FileObjectAttributes, 0); + return NtLoadKey2 (KeyObjectAttributes, FileObjectAttributes, 0); } @@ -1400,9 +1401,9 @@ NtLoadKey(IN POBJECT_ATTRIBUTES KeyObjectAttributes, * KeyObjectAttributes->Name specifies the name of the key to load. */ NTSTATUS STDCALL -NtLoadKey2(IN POBJECT_ATTRIBUTES KeyObjectAttributes, - IN POBJECT_ATTRIBUTES FileObjectAttributes, - IN ULONG Flags) +NtLoadKey2 (IN POBJECT_ATTRIBUTES KeyObjectAttributes, + IN POBJECT_ATTRIBUTES FileObjectAttributes, + IN ULONG Flags) { UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; @@ -1410,29 +1411,28 @@ NtLoadKey2(IN POBJECT_ATTRIBUTES KeyObjectAttributes, NTSTATUS STDCALL -NtNotifyChangeKey( - IN HANDLE KeyHandle, - IN HANDLE Event, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG CompletionFilter, - IN BOOLEAN Asynchroneous, - OUT PVOID ChangeBuffer, - IN ULONG Length, - IN BOOLEAN WatchSubtree) +NtNotifyChangeKey (IN HANDLE KeyHandle, + IN HANDLE Event, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG CompletionFilter, + IN BOOLEAN Asynchroneous, + OUT PVOID ChangeBuffer, + IN ULONG Length, + IN BOOLEAN WatchSubtree) { - UNIMPLEMENTED; + UNIMPLEMENTED; } NTSTATUS STDCALL -NtQueryMultipleValueKey(IN HANDLE KeyHandle, - IN OUT PKEY_VALUE_ENTRY ValueList, - IN ULONG NumberOfValues, - OUT PVOID Buffer, - IN OUT PULONG Length, - OUT PULONG ReturnLength) +NtQueryMultipleValueKey (IN HANDLE KeyHandle, + IN OUT PKEY_VALUE_ENTRY ValueList, + IN ULONG NumberOfValues, + OUT PVOID Buffer, + IN OUT PULONG Length, + OUT PULONG ReturnLength) { PREGISTRY_HIVE RegistryHive; PVALUE_CELL ValueCell; @@ -1543,10 +1543,9 @@ NtQueryMultipleValueKey(IN HANDLE KeyHandle, NTSTATUS STDCALL -NtReplaceKey( - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes +NtReplaceKey (IN POBJECT_ATTRIBUTES ObjectAttributes, + IN HANDLE Key, + IN POBJECT_ATTRIBUTES ReplacedObjectAttributes ) { UNIMPLEMENTED; @@ -1554,31 +1553,27 @@ NtReplaceKey( NTSTATUS STDCALL -NtRestoreKey( - IN HANDLE KeyHandle, - IN HANDLE FileHandle, - IN ULONG RestoreFlags - ) +NtRestoreKey (IN HANDLE KeyHandle, + IN HANDLE FileHandle, + IN ULONG RestoreFlags) { UNIMPLEMENTED; } NTSTATUS STDCALL -NtSaveKey( - IN HANDLE KeyHandle, - IN HANDLE FileHandle) +NtSaveKey (IN HANDLE KeyHandle, + IN HANDLE FileHandle) { UNIMPLEMENTED; } NTSTATUS STDCALL -NtSetInformationKey( - IN HANDLE KeyHandle, - IN CINT KeyInformationClass, - IN PVOID KeyInformation, - IN ULONG KeyInformationLength) +NtSetInformationKey (IN HANDLE KeyHandle, + IN CINT KeyInformationClass, + IN PVOID KeyInformation, + IN ULONG KeyInformationLength) { UNIMPLEMENTED; } @@ -1590,14 +1585,14 @@ NtSetInformationKey( * KeyObjectAttributes->Name specifies the name of the key to unload. */ NTSTATUS STDCALL -NtUnloadKey(IN POBJECT_ATTRIBUTES KeyObjectAttributes) +NtUnloadKey (IN POBJECT_ATTRIBUTES KeyObjectAttributes) { UNIMPLEMENTED; } NTSTATUS STDCALL -NtInitializeRegistry(IN BOOLEAN SetUpBoot) +NtInitializeRegistry (IN BOOLEAN SetUpBoot) { NTSTATUS Status = STATUS_ACCESS_DENIED; diff --git a/reactos/ntoskrnl/cm/regfile.c b/reactos/ntoskrnl/cm/regfile.c index a03290afd97..720e7848933 100644 --- a/reactos/ntoskrnl/cm/regfile.c +++ b/reactos/ntoskrnl/cm/regfile.c @@ -364,64 +364,6 @@ CmiVerifyRegistryHive(PREGISTRY_HIVE RegistryHive) } -#if 0 -static NTSTATUS -CmiPopulateHive(HANDLE FileHandle) -{ - IO_STATUS_BLOCK IoStatusBlock; - LARGE_INTEGER FileOffset; - PCELL_HEADER FreeCell; - NTSTATUS Status; - PHBIN BinCell; - PCHAR tBuf; - ULONG i; - - tBuf = (PCHAR) ExAllocatePool(NonPagedPool, REG_BLOCK_SIZE); - if (tBuf == NULL) - return STATUS_INSUFFICIENT_RESOURCES; - - BinCell = (PHBIN) tBuf; - FreeCell = (PCELL_HEADER) (tBuf + REG_HBIN_DATA_OFFSET); - - CmiCreateDefaultBinCell(BinCell); - - // The whole block is free - FreeCell->CellSize = REG_BLOCK_SIZE - REG_HBIN_DATA_OFFSET; - - // Add free blocks so we don't need to expand - // the file for a while - for (i = 1; i < 50; i++) - { - // Block offset of this bin - BinCell->BlockOffset = i * REG_BLOCK_SIZE; - - FileOffset.u.HighPart = 0; - FileOffset.u.LowPart = (i + 1) * REG_BLOCK_SIZE; - - Status = NtWriteFile(FileHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - tBuf, - REG_BLOCK_SIZE, - &FileOffset, - NULL); - assertmsg(NT_SUCCESS(Status), ("Status: 0x%X\n", Status)); - if (!NT_SUCCESS(Status)) - { - ExFreePool(tBuf); - return Status; - } - } - - ExFreePool(tBuf); - - return Status; -} -#endif - - static NTSTATUS CmiCreateNewRegFile(HANDLE FileHandle) { @@ -474,13 +416,6 @@ CmiCreateNewRegFile(HANDLE FileHandle) return(Status); } -#if 0 - if (NT_SUCCESS(Status)) - { - CmiPopulateHive(FileHandle); - } -#endif - Status = NtFlushBuffersFile(FileHandle, &IoStatusBlock); @@ -743,6 +678,183 @@ ByeBye: #endif +NTSTATUS +CmiImportHiveBins(PREGISTRY_HIVE Hive, + PUCHAR ChunkPtr) +{ + BLOCK_OFFSET BlockOffset; + ULONG BlockIndex; + PHBIN Bin; + ULONG j; + + BlockIndex = 0; + BlockOffset = 0; + while (BlockIndex < Hive->BlockListSize) + { + Bin = (PHBIN)((ULONG_PTR)ChunkPtr + BlockOffset); + + if (Bin->BlockId != REG_BIN_ID) + { + DPRINT1 ("Bad BlockId %x, offset %x\n", Bin->BlockId, BlockOffset); + /* FIXME: */ + assert(FALSE); +// return STATUS_INSUFFICIENT_RESOURCES; + } + + assertmsg((Bin->BlockSize % 4096) == 0, + ("BlockSize (0x%.08x) must be multiple of 4K\n", + Bin->BlockSize)); + + /* Allocate the hive block */ + Hive->BlockList[BlockIndex] = ExAllocatePool (PagedPool, + Bin->BlockSize); + if (Hive->BlockList[BlockIndex] == NULL) + { + DPRINT1 ("ExAllocatePool() failed\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Import the Bin */ + RtlCopyMemory (Hive->BlockList[BlockIndex], + Bin, + Bin->BlockSize); + + if (Bin->BlockSize > 4096) + { + for (j = 1; j < Bin->BlockSize / 4096; j++) + { + Hive->BlockList[BlockIndex + j] = Hive->BlockList[BlockIndex]; + } + } + + BlockIndex += Bin->BlockSize / 4096; + BlockOffset += Bin->BlockSize; + } + + return STATUS_SUCCESS; +} + + +VOID +CmiFreeHiveBins (PREGISTRY_HIVE Hive) +{ + ULONG i; + PHBIN Bin; + + Bin = NULL; + for (i = 0; i < Hive->BlockListSize; i++) + { + if (Hive->BlockList[i] == NULL) + continue; + + if (Hive->BlockList[i] != Bin) + { + Bin = Hive->BlockList[i]; + ExFreePool (Hive->BlockList[i]); + } + Hive->BlockList[i] = NULL; + } +} + + +NTSTATUS +CmiCreateHiveFreeCellList(PREGISTRY_HIVE Hive) +{ + BLOCK_OFFSET BlockOffset; + PCELL_HEADER FreeBlock; + ULONG BlockIndex; + ULONG FreeOffset; + PHBIN Bin; + NTSTATUS Status; + + /* Initialize the free cell list */ + Hive->FreeListSize = 0; + Hive->FreeListMax = 0; + Hive->FreeList = NULL; + Hive->FreeListOffset = NULL; + + BlockOffset = 0; + BlockIndex = 0; + while (BlockIndex < Hive->BlockListSize) + { + Bin = Hive->BlockList[BlockIndex]; + + /* Search free blocks and add to list */ + FreeOffset = REG_HBIN_DATA_OFFSET; + while (FreeOffset < Bin->BlockSize) + { + FreeBlock = (PCELL_HEADER) ((ULONG_PTR) Bin + FreeOffset); + if (FreeBlock->CellSize > 0) + { + Status = CmiAddFree(Hive, + FreeBlock, + Bin->BlockOffset + FreeOffset, + FALSE); + + if (!NT_SUCCESS(Status)) + { + return Status; + } + + FreeOffset += FreeBlock->CellSize; + } + else + { + FreeOffset -= FreeBlock->CellSize; + } + } + + BlockIndex += Bin->BlockSize / 4096; + BlockOffset += Bin->BlockSize; + } + + return STATUS_SUCCESS; +} + + +VOID +CmiFreeHiveFreeCellList(PREGISTRY_HIVE Hive) +{ + ExFreePool (Hive->FreeList); + ExFreePool (Hive->FreeListOffset); + + Hive->FreeListSize = 0; + Hive->FreeListMax = 0; + Hive->FreeList = NULL; + Hive->FreeListOffset = NULL; +} + + +NTSTATUS +CmiCreateHiveBitmap(PREGISTRY_HIVE Hive) +{ + ULONG BitmapSize; + + /* Calculate bitmap size in bytes (always a multiple of 32 bits) */ + BitmapSize = ROUND_UP(Hive->BlockListSize, sizeof(ULONG) * 8) / 8; + DPRINT("Hive->BlockListSize: %lu\n", Hive->BlockListSize); + DPRINT("BitmapSize: %lu Bytes %lu Bits\n", BitmapSize, BitmapSize * 8); + + /* Allocate bitmap */ + Hive->BitmapBuffer = (PULONG)ExAllocatePool(PagedPool, + BitmapSize); + if (Hive->BitmapBuffer == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlInitializeBitMap(&Hive->DirtyBitMap, + Hive->BitmapBuffer, + BitmapSize * 8); + + /* Initialize bitmap */ + RtlClearAllBits(&Hive->DirtyBitMap); + Hive->HiveDirty = FALSE; + + return STATUS_SUCCESS; +} + + static NTSTATUS CmiInitNonVolatileRegistryHive(PREGISTRY_HIVE RegistryHive, PWSTR Filename, @@ -750,17 +862,14 @@ CmiInitNonVolatileRegistryHive(PREGISTRY_HIVE RegistryHive, { OBJECT_ATTRIBUTES ObjectAttributes; FILE_STANDARD_INFORMATION fsi; - PCELL_HEADER FreeBlock; LARGE_INTEGER FileOffset; BLOCK_OFFSET BlockOffset; ULONG CreateDisposition; IO_STATUS_BLOCK IoSB; HANDLE FileHandle; - ULONG FreeOffset; NTSTATUS Status; PHBIN tmpBin; ULONG i, j; - ULONG BitmapSize; DPRINT("CmiInitNonVolatileRegistryHive(%p, %S, %d) called\n", RegistryHive, Filename, CreateNew); @@ -862,7 +971,7 @@ CmiInitNonVolatileRegistryHive(PREGISTRY_HIVE RegistryHive, /* Read hive header */ FileOffset.u.HighPart = 0; FileOffset.u.LowPart = 0; - DPRINT(" Attempting to ZwReadFile(%d) for %d bytes into %p\n", FileHandle, sizeof(HIVE_HEADER), RegistryHive->HiveHeader); + DPRINT(" Attempting to NtReadFile(%d) for %d bytes into %p\n", FileHandle, sizeof(HIVE_HEADER), RegistryHive->HiveHeader); Status = NtReadFile(FileHandle, 0, 0, @@ -950,10 +1059,6 @@ CmiInitNonVolatileRegistryHive(PREGISTRY_HIVE RegistryHive, NtClose(FileHandle); - RegistryHive->FreeListSize = 0; - RegistryHive->FreeListMax = 0; - RegistryHive->FreeList = NULL; - BlockOffset = 0; for (i = 0; i < RegistryHive->BlockListSize; i++) { @@ -977,52 +1082,28 @@ CmiInitNonVolatileRegistryHive(PREGISTRY_HIVE RegistryHive, i = i + j - 1; } - /* Search free blocks and add to list */ - FreeOffset = REG_HBIN_DATA_OFFSET; - while (FreeOffset < tmpBin->BlockSize) - { - FreeBlock = (PCELL_HEADER) ((ULONG_PTR) RegistryHive->BlockList[i] + FreeOffset); - if (FreeBlock->CellSize > 0) - { - Status = CmiAddFree(RegistryHive, - FreeBlock, - RegistryHive->BlockList[i]->BlockOffset + FreeOffset, - FALSE); - - if (!NT_SUCCESS(Status)) - { - /* FIXME: */ - assert(FALSE); - } - - FreeOffset += FreeBlock->CellSize; - } - else - { - FreeOffset -= FreeBlock->CellSize; - } - } +// BlockIndex += Bin->BlockSize / 4096; BlockOffset += tmpBin->BlockSize; } + + /* Initialize the free cell list */ + Status = CmiCreateHiveFreeCellList (RegistryHive); + if (!NT_SUCCESS(Status)) + { + /* FIXME: */ + assert (FALSE); + } + /* * Create block bitmap and clear all bits */ - /* Calculate bitmap size in bytes (always a multiple of 32 bits) */ - BitmapSize = ROUND_UP(RegistryHive->BlockListSize, sizeof(ULONG) * 8) / 8; - DPRINT("RegistryHive->BlockListSize: %lu\n", RegistryHive->BlockListSize); - DPRINT("BitmapSize: %lu Bytes %lu Bits\n", BitmapSize, BitmapSize * 8); - - /* Allocate bitmap */ - RegistryHive->BitmapBuffer = (PULONG)ExAllocatePool(PagedPool, - BitmapSize); - RtlInitializeBitMap(&RegistryHive->DirtyBitMap, - RegistryHive->BitmapBuffer, - BitmapSize * 8); - - /* Initialize bitmap */ - RtlClearAllBits(&RegistryHive->DirtyBitMap); - RegistryHive->HiveDirty = FALSE; + Status = CmiCreateHiveBitmap (RegistryHive); + if (!NT_SUCCESS(Status)) + { + /* FIXME: */ + assert (FALSE); + } DPRINT("CmiInitNonVolatileRegistryHive(%p, %S, %d) - Finished.\n", RegistryHive, Filename, CreateNew); diff --git a/reactos/system.hiv b/reactos/system.hiv deleted file mode 100644 index 4eaab5293a3..00000000000 --- a/reactos/system.hiv +++ /dev/null @@ -1,343 +0,0 @@ -REGEDIT4 - -[\Registry\Machine\SYSTEM] - -[\Registry\Machine\SYSTEM\ControlSet001] - -[\Registry\Machine\SYSTEM\ControlSet001\Control] - -[\Registry\Machine\SYSTEM\ControlSet001\Control\NLS] - -[\Registry\Machine\SYSTEM\ControlSet001\Control\NLS\CodePage] -"10000"="c_10000.nls" -"1252"="c_1252.nls" -"437"="c_437.nls" -"850"="c_850.nls" -"ACP"="1252" -"OEMCP"="437" -"MACCP"="10000" - -[\Registry\Machine\SYSTEM\ControlSet001\Control\NLS\Language] -"0401"="l_intl.nls" -"0402"="l_intl.nls" -"0403"="l_intl.nls" -"0404"="l_intl.nls" -"0405"="l_intl.nls" -"0406"="l_intl.nls" -"0407"="l_intl.nls" -"0408"="l_intl.nls" -"0409"="l_intl.nls" -"040a"="l_intl.nls" -"040b"="l_intl.nls" -"040c"="l_intl.nls" -"040d"="l_intl.nls" -"040e"="l_intl.nls" -"040f"="l_intl.nls" -"0410"="l_intl.nls" -"Default"="0409" -"InstallLanguage"="0409" - -[\Registry\Machine\SYSTEM\ControlSet001\Control\ServiceGroupOrder] -"List"=multi:"SCSI Port", "SCSI Miniport", "Primary Disk", "SCSI Class Helper", \ - "SCSI Class", "Boot File System", "Base", "Pointer Port", \ - "Keyboard Port", "Pointer Class", "Keyboard Class", "Debug", \ - "Video Init", "Video", "File System", "Event log", "NDIS", \ - "PNP_TDI", "TDI", "Extended Base" - -[\Registry\Machine\SYSTEM\ControlSet001\Control\Session Manager] -"BootExecute"=multi:"autocheck autochk *" -"ObjectDirectories"=multi:"\Windows", "\RPC Control" - -[\Registry\Machine\SYSTEM\ControlSet001\Control\Session Manager\DOS Devices] -"AUX"="\DosDevices\COM1" -"MAILSLOT"="\Device\MailSlot" -"NUL"="\Device\Null" -"PIPE"="\Device\NamedPipe" -"PRN"="\DosDevices\LPT1" -"UNC"="\Device\Mup" - -[\Registry\Machine\SYSTEM\ControlSet001\Control\Session Manager\Environment] -"ComSpec"=expand:"%SystemRoot%\system32\cmd.exe" -"OS"=expand:"ReactOS" -"Path"=expand:"%SystemRoot%\system32;%SystemRoot%" -"windir"=expand:"%SystemRoot%" - -[\Registry\Machine\SYSTEM\ControlSet001\Control\Session Manager\Memory Management] -"PagingFiles"=multi:"C:\reactos\pagefile.sys" - -[\Registry\Machine\SYSTEM\ControlSet001\Services] - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Afd] -"ErrorControl"=dword:00000001 -"Group"="TDI" -"ImagePath"=expand:"system32\drivers\afd.sys" -"Start"=dword:00000002 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Atapi] -"ErrorControl"=dword:00000000 -"Group"="SCSI Miniport" -"ImagePath"=expand:"system32\drivers\atapi.sys" -"Start"=dword:00000000 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Beep] -"ErrorControl"=dword:00000000 -"Group"="Base" -"ImagePath"=expand:"system32\drivers\beep.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Blue] -"ErrorControl"=dword:00000000 -"Group"="Video Init" -"ImagePath"=expand:"system32\drivers\blue.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Cdfs] -"ErrorControl"=dword:00000000 -"Group"="File System" -"ImagePath"=expand:"system32\drivers\cdfs.sys" -"Start"=dword:00000003 -"Type"=dword:00000002 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Cdrom] -"ErrorControl"=dword:00000000 -"Group"="SCSI Class" -"ImagePath"=expand:"system32\drivers\cdrom.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Class2] -"ErrorControl"=dword:00000000 -"Group"="SCSI Class Helper" -"ImagePath"=expand:"system32\drivers\class2.sys" -"Start"=dword:00000000 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Disk] -"ErrorControl"=dword:00000000 -"Group"="SCSI Class" -"ImagePath"=expand:"system32\drivers\disk.sys" -"Start"=dword:00000000 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\EventLog] -"ErrorControl"=dword:00000000 -"Group"="Event log" -"ImagePath"=expand:"%SystemRoot%\system32\eventlog.exe" -"Start"=dword:00000002 -"Type"=dword:00000010 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Floppy] -"ErrorControl"=dword:00000000 -"Group"="Primary Disk" -"ImagePath"=expand:"system32\drivers\floppy.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Fs_Rec] -"ErrorControl"=dword:00000000 -"Group"="Boot file system" -"ImagePath"=expand:"system32\drivers\fs_rec.sys" -"Start"=dword:00000001 -"Type"=dword:00000008 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Ide] -"ErrorControl"=dword:00000000 -"Group"="Primary Disk" -"ImagePath"=expand:"system32\drivers\ide.sys" -"Start"=dword:00000004 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Keyboard] -"ErrorControl"=dword:00000000 -"Group"="Keyboard Port" -"ImagePath"=expand:"system32\drivers\keyboard.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Mouse] -"ErrorControl"=dword:00000000 -"Group"="Pointer Class" -"ImagePath"=expand:"system32\drivers\mouclass.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Msfs] -"ErrorControl"=dword:00000000 -"Group"="File System" -"ImagePath"=expand:"system32\drivers\msfs.sys" -"Start"=dword:00000001 -"Type"=dword:00000002 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Ndis] -"ErrorControl"=dword:00000001 -"Group"="NDIS" -"ImagePath"=expand:"system32\drivers\ndis.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Ne2000] -"ErrorControl"=dword:00000001 -"Group"="NDIS" -"ImagePath"=expand:"system32\drivers\ne2000.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Npfs] -"ErrorControl"=dword:00000000 -"Group"="File System" -"ImagePath"=expand:"system32\drivers\npfs.sys" -"Start"=dword:00000001 -"Type"=dword:00000002 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Ntfs] -"ErrorControl"=dword:00000000 -"Group"="File System" -"ImagePath"=expand:"system32\drivers\ntfs.sys" -"Start"=dword:00000003 -"Type"=dword:00000002 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Null] -"ErrorControl"=dword:00000000 -"Group"="Base" -"ImagePath"=expand:"system32\drivers\null.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Serial] -"ErrorControl"=dword:00000000 -"Group"="Base" -"ImagePath"=expand:"system32\drivers\serial.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Packet] -"ErrorControl"=dword:00000001 -"Group"="PNP_TDI" -"ImagePath"=expand:"system32\drivers\packet.sys" -"Start"=dword:00000004 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Packet\Linkage] -"Bind"=expand:"\Device\ne2000" -"Export"=expand:"\Device\packet" - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Pice] -"ErrorControl"=dword:00000000 -"Group"="Debug" -"ImagePath"=expand:"system32\drivers\pice.sys" -"Start"=dword:00000004 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Psaux] -"ErrorControl"=dword:00000000 -"Group"="Pointer Port" -"ImagePath"=expand:"system32\drivers\psaux.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\RpcSs] -"ErrorControl"=dword:00000001 -"ImagePath"=expand:"%SystemRoot%\system32\rpcss.exe" -"Start"=dword:00000004 -"Type"=dword:00000010 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Scsiport] -"ErrorControl"=dword:00000000 -"Group"="SCSI Port" -"ImagePath"=expand:"system32\drivers\scsiport.sys" -"Start"=dword:00000000 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Tcpip] -"ErrorControl"=dword:00000001 -"Group"="PNP_TDI" -"ImagePath"=expand:"system32\drivers\tcpip.sys" -"Start"=dword:00000002 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Tcpip\Linkage] -"Bind"=expand:"\Device\ne2000" -"Export"=expand:"\Device\tcpip" -"Route"=expand:"" - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Tcpip\Parameters] -"DataBasePath"="DataBasePath" -"Domain"="" -"Hostname"="ROSHost" -"NameServer"="203.13.174.1" -"ForwardBroadcasts"=dword:00000000 -"IPEnableRouter"=dword:00000000 -"SearchList"="" -"EnableSecurityFilters"=dword:00000000 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Tcpip\Parameters\PersistentRoutes] - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Vfatfs] -"ErrorControl"=dword:00000000 -"Group"="Boot File System" -"ImagePath"=expand:"system32\drivers\vfatfs.sys" -"Start"=dword:00000000 -"Type"=dword:00000002 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Vga] -"ErrorControl"=dword:00000000 -"Group"="Video" -"ImagePath"=expand:"system32\drivers\vgamp.sys" -"Start"=dword:00000001 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\Vga\Device0] -"InstalledDisplayDrivers"=multi:"vgaddi" - -[\Registry\Machine\SYSTEM\ControlSet001\Services\vmx_svga] -"ErrorControl"=dword:00000000 -"Group"="Video" -"ImagePath"=expand:"system32\drivers\vmx_svga.sys" -"Start"=dword:00000004 -"Type"=dword:00000001 - -[\Registry\Machine\SYSTEM\ControlSet001\Services\vmx_svga\Device0] -"InstalledDisplayDrivers"=multi:"vmx_fb" - -[\Registry\Machine\SYSTEM\ControlSet002] - -[\Registry\Machine\SYSTEM\Select] -"Current"=dword:00000001 -"Default"=dword:00000001 -"Failed"=dword:00000000 -"LastKnownGood"=dword:00000000 - -[\Registry\Machine\SYSTEM\Setup] -"CmdLine"="setup -newsetup" -"OsLoaderPath"="\" -"SetupType"=dword:00000000 -"SystemPartition"="\Device\Harddisk0\Partition1" -"SystemSetupInProgress"=dword:00000000 - -[\Registry\Machine\SOFTWARE] - -[\Registry\Machine\SOFTWARE\Classes] - -[\Registry\Machine\SOFTWARE\Classes\WinNT] - -[\Registry\Machine\SOFTWARE\Classes\WinNT\Clsid] -"Default" = "{8b20cd60-0f29-11cf-abc4-02608c9e7553}" - -[\Registry\Machine\SOFTWARE\Classes\NDS] - -[\Registry\Machine\SOFTWARE\Classes\NDS\Clsid] -"Default" = "{323991f0-7bad-11cf-b03d-00aa006e0975}" - -[\Registry\Machine\SOFTWARE\ReactOS] - -[\Registry\Machine\SOFTWARE\ReactOS\Windows NT] - -[\Registry\Machine\SOFTWARE\ReactOS\Windows NT\CurrentVersion] - -[\Registry\Machine\SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon] -"Shell"=expand:"%SystemRoot%\System32\cmd.exe" -"StartServices"=dword:00000001