/* We imported, no need to create a new hive */
Allocate = FALSE;
- /* Manually set the hive as volatile, if in Live CD mode */
+ /* Manually set the hive as volatile, if in LiveCD mode */
if (CmpShareSystemHives) SystemHive->Hive.HiveFlags = HIVE_VOLATILE;
}
else
/* Loop every hive we care about */
for (i = 0; i < CM_NUMBER_OF_MACHINE_HIVES; i++)
{
- /* Make sure the list is setup */
+ /* Make sure the list is set up */
ASSERT(CmpMachineHiveList[i].Name != NULL);
+ /* Load the hive as volatile, if in LiveCD mode */
+ if (CmpShareSystemHives)
+ CmpMachineHiveList[i].HHiveFlags |= HIVE_VOLATILE;
+
/* Create a thread to handle this hive */
Status = PsCreateSystemThread(&Thread,
THREAD_ALL_ACCESS,
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
_FileOffset.QuadPart = *FileOffset;
Status = ZwReadFile(HiveHandle, NULL, NULL, NULL, &IoStatusBlock,
Buffer, (ULONG)BufferLength, &_FileOffset, NULL);
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
+ /* Don't do anything if we're not supposed to */
+ if (CmpNoWrite)
+ return TRUE;
+
_FileOffset.QuadPart = *FileOffset;
Status = ZwWriteFile(HiveHandle, NULL, NULL, NULL, &IoStatusBlock,
Buffer, (ULONG)BufferLength, &_FileOffset, NULL);
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
EndOfFileInfo.EndOfFile.QuadPart = FileSize;
Status = ZwSetInformationFile(HiveHandle,
&IoStatusBlock,
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
+ /* Don't do anything if we're not supposed to */
+ if (CmpNoWrite)
+ return TRUE;
+
Status = ZwFlushBuffersFile(HiveHandle, &IoStatusBlock);
return NT_SUCCESS(Status) ? TRUE : FALSE;
}