diff --git a/reactos/ntoskrnl/io/deviface.c b/reactos/ntoskrnl/io/deviface.c index 0c60f9c8b41..17966b22e41 100644 --- a/reactos/ntoskrnl/io/deviface.c +++ b/reactos/ntoskrnl/io/deviface.c @@ -585,6 +585,12 @@ IoRegisterDeviceInterface( ULONG i; NTSTATUS Status; + if (!(PhysicalDeviceObject->Flags & DO_BUS_ENUMERATED_DEVICE)) + { + DPRINT("PhysicalDeviceObject 0x%p is not a valid Pdo\n", PhysicalDeviceObject); + return STATUS_INVALID_PARAMETER_1; + } + Status = RtlStringFromGUID(InterfaceClassGuid, &GuidString); if (!NT_SUCCESS(Status)) { @@ -606,6 +612,7 @@ IoRegisterDeviceInterface( ASSERT(PdoNameInfo->Name.Length); /* Create base key name for this interface: HKLM\SYSTEM\CurrentControlSet\DeviceClasses\{GUID}\##?#ACPI#PNP0501#1#{GUID} */ + ASSERT(PhysicalDeviceObject->DeviceObjectExtension->DeviceNode); InstancePath = &PhysicalDeviceObject->DeviceObjectExtension->DeviceNode->InstancePath; BaseKeyName.Length = wcslen(BaseKeyString) * sizeof(WCHAR); BaseKeyName.MaximumLength = BaseKeyName.Length