mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-03 02:03:32 +00:00
ntoskrnl.exe: Don't add device to the list if IoCreateDevice fails.
Spotted by Zebediah Figura. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
061f65f9aa
commit
80d53026bf
|
@ -1502,9 +1502,6 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
|
|||
device->DeviceType = type;
|
||||
device->StackSize = 1;
|
||||
|
||||
device->NextDevice = driver->DeviceObject;
|
||||
driver->DeviceObject = device;
|
||||
|
||||
SERVER_START_REQ( create_device )
|
||||
{
|
||||
req->rootdir = 0;
|
||||
|
@ -1521,6 +1518,9 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
|
|||
return status;
|
||||
}
|
||||
|
||||
device->NextDevice = driver->DeviceObject;
|
||||
driver->DeviceObject = device;
|
||||
|
||||
*ret_device = device;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue