- Free the FullServiceName buffer if PnpRootCreateDevice failed (erroneously committed in r74494, see pnpmgr.c line 1080);
- No need to close InstanceHandle if the IopCreateDeviceKeyPath call failed, since in this case the registry handle wasn't opened. CORE-13207
- Don't assert on Buffer allocation but return a proper failure code in case of failure. CORE-13208
These are suggestions from Serge Gautherie + Lesan Ilie.
- Add a forgotten ZwClose call in the success code path of IopCreateDeviceKeyPath in IopQueryDeviceCapabilities (by me).
svn path=/trunk/; revision=74495
InbvIndicateProgress();
Buffer = ExAllocatePool(PagedPool, ModuleName->Length + sizeof(UNICODE_NULL));
- ASSERT(Buffer);
+ if (Buffer == NULL)
+ {
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
RtlCopyMemory(Buffer, ModuleName->Buffer, ModuleName->Length);
Buffer[ModuleName->Length / sizeof(WCHAR)] = UNICODE_NULL;
&DeviceCaps->UINumber,
sizeof(ULONG));
}
+
+ ZwClose(InstanceKey);
}
return Status;
Status = IopCreateDeviceKeyPath(&Node->InstancePath, REG_OPTION_VOLATILE, &InstanceHandle);
if (!NT_SUCCESS(Status))
{
- ZwClose(InstanceHandle);
ExFreePool(FullServiceName.Buffer);
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
return Status;