[NTOSKRNL]

- add some debug prints

svn path=/trunk/; revision=54444
This commit is contained in:
Jérôme Gardou 2011-11-19 17:20:39 +00:00
parent 9e8dbbaa34
commit a1c0d36034
2 changed files with 24 additions and 13 deletions

View file

@ -1787,6 +1787,7 @@ CmLoadKey(IN POBJECT_ATTRIBUTES TargetKey,
} }
else else
{ {
DPRINT1("CmpLinkHiveToMaster failed, Status %lx\n", Status);
/* FIXME: TODO */ /* FIXME: TODO */
ASSERT(FALSE); ASSERT(FALSE);
} }

View file

@ -343,7 +343,19 @@ CmpOpenHiveFiles(IN PCUNICODE_STRING BaseName,
FILE_SYNCHRONOUS_IO_NONALERT | IoFlags, FILE_SYNCHRONOUS_IO_NONALERT | IoFlags,
NULL, NULL,
0); 0);
if ((NT_SUCCESS(Status)) && (MarkAsSystemHive)) /* Check if anything failed until now */
if (!NT_SUCCESS(Status))
{
/* Close handles and free buffers */
if (NameBuffer) ExFreePool(NameBuffer);
ObDereferenceObject(Event);
ZwClose(EventHandle);
DPRINT1("ZwCreateFile failed : %lx.\n", Status);
*Primary = NULL;
return Status;
}
if (MarkAsSystemHive)
{ {
/* We opened it, mark it as a system hive */ /* We opened it, mark it as a system hive */
Status = ZwFsControlFile(*Primary, Status = ZwFsControlFile(*Primary,
@ -370,18 +382,16 @@ CmpOpenHiveFiles(IN PCUNICODE_STRING BaseName,
/* If we don't support it, ignore the failure */ /* If we don't support it, ignore the failure */
if (Status == STATUS_INVALID_DEVICE_REQUEST) Status = STATUS_SUCCESS; if (Status == STATUS_INVALID_DEVICE_REQUEST) Status = STATUS_SUCCESS;
/* If we failed, close the handle */ if (!NT_SUCCESS(Status))
if (!NT_SUCCESS(Status)) ZwClose(*Primary); {
} /* Close handles and free buffers */
if (NameBuffer) ExFreePool(NameBuffer);
/* Check if anything failed until now */ ObDereferenceObject(Event);
if (!NT_SUCCESS(Status)) ZwClose(EventHandle);
{ ZwClose(*Primary);
/* Close handles and free buffers */ *Primary = NULL;
if (NameBuffer) ExFreePool(NameBuffer); return Status;
ObDereferenceObject(Event); }
ZwClose(EventHandle);
return Status;
} }
/* Disable compression */ /* Disable compression */