+23
-34
lines changedFilter options
+23
-34
lines changed Original file line number Diff line number Diff line change
@@ -54,11 +54,14 @@ UNICODE_STRING CmSymbolicLinkValueName =
54
54
55
55
UNICODE_STRING CmpLoadOptions;
56
56
57
+
/* TRUE if the system hives must be loaded in shared mode */
57
58
BOOLEAN CmpShareSystemHives;
58
-
BOOLEAN CmSelfHeal = TRUE;
59
-
BOOLEAN CmpSelfHeal = TRUE;
59
+
/* TRUE when the registry is in PE mode */
60
60
BOOLEAN CmpMiniNTBoot;
61
+
61
62
ULONG CmpBootType;
63
+
BOOLEAN CmSelfHeal = TRUE;
64
+
BOOLEAN CmpSelfHeal = TRUE;
62
65
63
66
USHORT CmpUnknownBusCount;
64
67
ULONG CmpTypeCount[MaximumType + 1];
Original file line number Diff line number Diff line change
@@ -261,9 +261,14 @@ CmpCmdInit(IN BOOLEAN SetupBoot)
261
261
/* Testing: Force Lazy Flushing */
262
262
CmpHoldLazyFlush = FALSE;
263
263
264
-
/* Setup the hive list if this is not a Setup boot */
264
+
/* Setup the system hives list if this is not a Setup boot */
265
265
if (!SetupBoot)
266
266
CmpInitializeHiveList();
267
+
268
+
/* Now that the system hives are loaded, if we are in PE mode,
269
+
* all other hives will be loaded with full access */
270
+
if (CmpMiniNTBoot)
271
+
CmpShareSystemHives = FALSE;
267
272
}
268
273
269
274
NTSTATUS
Original file line number Diff line number Diff line change
@@ -332,7 +332,7 @@ CmpInitHiveFromFile(IN PCUNICODE_STRING HiveName,
332
332
*New = FALSE;
333
333
}
334
334
335
-
/* Check if we're sharing hives */
335
+
/* Check if the system hives are opened in shared mode */
336
336
if (CmpShareSystemHives)
337
337
{
338
338
/* Then force using the primary hive */
@@ -928,11 +928,9 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
928
928
if (!RtlCreateUnicodeString(&SystemHive->FileFullPath, L"\\SystemRoot\\System32\\Config\\SYSTEM"))
929
929
return FALSE;
930
930
931
-
/* Manually set the hive as volatile, if in Live CD mode */
931
+
/* Load the system hive as volatile, if opened in shared mode */
932
932
if (HiveBase && CmpShareSystemHives)
933
-
{
934
933
SystemHive->Hive.HiveFlags = HIVE_VOLATILE;
935
-
}
936
934
937
935
/* Save the boot type */
938
936
CmpBootType = SystemHive->Hive.BaseBlock->BootType;
@@ -1508,7 +1506,7 @@ CmpInitializeHiveList(VOID)
1508
1506
/* Make sure the list is set up */
1509
1507
ASSERT(CmpMachineHiveList[i].Name != NULL);
1510
1508
1511
-
/* Load the hive as volatile, if in LiveCD mode */
1509
+
/* Load this root hive as volatile, if opened in shared mode */
1512
1510
if (CmpShareSystemHives)
1513
1511
CmpMachineHiveList[i].HHiveFlags |= HIVE_VOLATILE;
1514
1512
@@ -1630,7 +1628,7 @@ CmInitSystem1(VOID)
1630
1628
/* Check if this is PE-boot */
1631
1629
if (InitIsWinPEMode)
1632
1630
{
1633
-
/* Set registry to PE mode */
1631
+
/* Set the registry in PE mode and load the system hives in shared mode */
1634
1632
CmpMiniNTBoot = TRUE;
1635
1633
CmpShareSystemHives = TRUE;
1636
1634
}
Original file line number Diff line number Diff line change
@@ -21,11 +21,7 @@ IoSetThreadHardErrorMode(
21
21
_In_ BOOLEAN HardErrorEnabled);
22
22
#endif
23
23
24
-
/* GLOBALS *****************************************************************/
25
-
26
-
#if !defined(CMLIB_HOST) && !defined(_BLDR_)
27
-
extern BOOLEAN CmpMiniNTBoot;
28
-
#endif
24
+
/* GLOBALS ******************************************************************/
29
25
30
26
/* PRIVATE FUNCTIONS ********************************************************/
31
27
@@ -477,6 +473,13 @@ HvSyncHive(
477
473
ASSERT(!RegistryHive->ReadOnly);
478
474
ASSERT(RegistryHive->Signature == HV_HHIVE_SIGNATURE);
479
475
476
+
/* Avoid any write operations on volatile hives */
477
+
if (RegistryHive->HiveFlags & HIVE_VOLATILE)
478
+
{
479
+
DPRINT("Hive 0x%p is volatile\n", RegistryHive);
480
+
return TRUE;
481
+
}
482
+
480
483
/*
481
484
* Check if there's any dirty data in the vector.
482
485
* A space with clean blocks would be pointless for
@@ -490,26 +493,6 @@ HvSyncHive(
490
493
return TRUE;
491
494
}
492
495
493
-
/*
494
-
* We are either in Live CD or we are sharing hives.
495
-
* In either of the cases, hives can only be read
496
-
* so don't do any writing operations on them.
497
-
*/
498
-
#if !defined(CMLIB_HOST) && !defined(_BLDR_)
499
-
if (CmpMiniNTBoot)
500
-
{
501
-
DPRINT("We are sharing hives or in Live CD mode, abort syncing\n");
502
-
return TRUE;
503
-
}
504
-
#endif
505
-
506
-
/* Avoid any writing operations on volatile hives */
507
-
if (RegistryHive->HiveFlags & HIVE_VOLATILE)
508
-
{
509
-
DPRINT("The hive is volatile (hive 0x%p)\n", RegistryHive);
510
-
return TRUE;
511
-
}
512
-
513
496
#if !defined(CMLIB_HOST) && !defined(_BLDR_)
514
497
/* Disable hard errors before syncing the hive */
515
498
HardErrors = IoSetThreadHardErrorMode(FALSE);
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4