mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Better handle of wrong arguments in IoRegisterDeviceInterface
svn path=/trunk/; revision=15002
This commit is contained in:
parent
0f4b0fd412
commit
9961bb7d69
1 changed files with 7 additions and 0 deletions
|
@ -585,6 +585,12 @@ IoRegisterDeviceInterface(
|
||||||
ULONG i;
|
ULONG i;
|
||||||
NTSTATUS Status;
|
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);
|
Status = RtlStringFromGUID(InterfaceClassGuid, &GuidString);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -606,6 +612,7 @@ IoRegisterDeviceInterface(
|
||||||
ASSERT(PdoNameInfo->Name.Length);
|
ASSERT(PdoNameInfo->Name.Length);
|
||||||
|
|
||||||
/* Create base key name for this interface: HKLM\SYSTEM\CurrentControlSet\DeviceClasses\{GUID}\##?#ACPI#PNP0501#1#{GUID} */
|
/* 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;
|
InstancePath = &PhysicalDeviceObject->DeviceObjectExtension->DeviceNode->InstancePath;
|
||||||
BaseKeyName.Length = wcslen(BaseKeyString) * sizeof(WCHAR);
|
BaseKeyName.Length = wcslen(BaseKeyString) * sizeof(WCHAR);
|
||||||
BaseKeyName.MaximumLength = BaseKeyName.Length
|
BaseKeyName.MaximumLength = BaseKeyName.Length
|
||||||
|
|
Loading…
Reference in a new issue