mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[NTOS]: Addendums to r74491 and r74493:
- 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
This commit is contained in:
@@ -899,7 +899,10 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry)
|
||||
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;
|
||||
|
||||
@@ -892,6 +892,8 @@ IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode,
|
||||
&DeviceCaps->UINumber,
|
||||
sizeof(ULONG));
|
||||
}
|
||||
|
||||
ZwClose(InstanceKey);
|
||||
}
|
||||
|
||||
return Status;
|
||||
@@ -1086,7 +1088,6 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
|
||||
Status = IopCreateDeviceKeyPath(&Node->InstancePath, REG_OPTION_VOLATILE, &InstanceHandle);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ZwClose(InstanceHandle);
|
||||
ExFreePool(FullServiceName.Buffer);
|
||||
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
|
||||
return Status;
|
||||
|
||||
Reference in New Issue
Block a user