mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 18:05:46 +00:00
[NTOS]: Code formatting + free the memory in the reverse order from how it was allocated.
svn path=/trunk/; revision=74494
This commit is contained in:
parent
837c766030
commit
32b595761c
1 changed files with 10 additions and 9 deletions
|
@ -878,7 +878,7 @@ IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode,
|
||||||
&ValueName,
|
&ValueName,
|
||||||
0,
|
0,
|
||||||
REG_DWORD,
|
REG_DWORD,
|
||||||
(PVOID)&DeviceNode->CapabilityFlags,
|
&DeviceNode->CapabilityFlags,
|
||||||
sizeof(ULONG));
|
sizeof(ULONG));
|
||||||
|
|
||||||
/* Set 'UINumber' value */
|
/* Set 'UINumber' value */
|
||||||
|
@ -1077,6 +1077,7 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("PnpRootCreateDevice() failed with status 0x%08X\n", Status);
|
DPRINT1("PnpRootCreateDevice() failed with status 0x%08X\n", Status);
|
||||||
|
ExFreePool(FullServiceName.Buffer);
|
||||||
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
|
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -1086,8 +1087,8 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ZwClose(InstanceHandle);
|
ZwClose(InstanceHandle);
|
||||||
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
|
|
||||||
ExFreePool(FullServiceName.Buffer);
|
ExFreePool(FullServiceName.Buffer);
|
||||||
|
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1095,8 +1096,8 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
|
||||||
if (!Node->ServiceName.Buffer)
|
if (!Node->ServiceName.Buffer)
|
||||||
{
|
{
|
||||||
ZwClose(InstanceHandle);
|
ZwClose(InstanceHandle);
|
||||||
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
|
|
||||||
ExFreePool(FullServiceName.Buffer);
|
ExFreePool(FullServiceName.Buffer);
|
||||||
|
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1738,7 +1739,7 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode,
|
||||||
&ValueName,
|
&ValueName,
|
||||||
0,
|
0,
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
(PVOID)KeyValue.Buffer,
|
KeyValue.Buffer,
|
||||||
((ULONG)wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR));
|
((ULONG)wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -1859,11 +1860,11 @@ IopQueryCompatibleIds(PDEVICE_NODE DeviceNode,
|
||||||
|
|
||||||
RtlInitUnicodeString(&ValueName, L"CompatibleIDs");
|
RtlInitUnicodeString(&ValueName, L"CompatibleIDs");
|
||||||
Status = ZwSetValueKey(InstanceKey,
|
Status = ZwSetValueKey(InstanceKey,
|
||||||
&ValueName,
|
&ValueName,
|
||||||
0,
|
0,
|
||||||
REG_MULTI_SZ,
|
REG_MULTI_SZ,
|
||||||
(PVOID)IoStatusBlock.Information,
|
(PVOID)IoStatusBlock.Information,
|
||||||
(TotalLength + 1) * sizeof(WCHAR));
|
(TotalLength + 1) * sizeof(WCHAR));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("ZwSetValueKey() failed (Status %lx) or no Compatible ID returned\n", Status);
|
DPRINT1("ZwSetValueKey() failed (Status %lx) or no Compatible ID returned\n", Status);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue