Display the error message only in case of... error

svn path=/trunk/; revision=20738
This commit is contained in:
Hervé Poussineau
2006-01-08 22:50:11 +00:00
parent b6b7f582ba
commit c193b1f709
+8 -6
View File
@@ -533,18 +533,20 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
InitializeObjectAttributes(&ObjectAttributes, &KeyName,
OBJ_CASE_INSENSITIVE, NULL, NULL);
Status = ZwOpenKey(DevInstRegKey, DesiredAccess, &ObjectAttributes);
if (!NT_SUCCESS(Status))
{
DPRINT1("IoOpenDeviceRegistryKey(%wZ): Base key doesn't exist, exiting... (Status 0x%08lx)\n", &KeyName, Status);
ExFreePool(KeyNameBuffer);
return Status;
}
ExFreePool(KeyNameBuffer);
/*
* For driver key we're done now. Also if the base key doesn't
* exist we can bail out with error...
* For driver key we're done now.
*/
if ((DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) || !NT_SUCCESS(Status))
{
DPRINT1("IoOpenDeviceRegistryKey(): Base key doesn't exist, exiting...\n");
if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER)
return Status;
}
/*
* Let's go further. For device key we must open "Device Parameters"