Jacek Caban : ntoskrnl.exe: Don' t add device to the list if IoCreateDevice fails.
Alexandre Julliard
julliard at winehq.org
Mon Apr 8 15:12:01 CDT 2019
Module: wine
Branch: master
Commit: 80d53026bf22a11aafaf3c4ba8fab6b1fe3b6cb0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=80d53026bf22a11aafaf3c4ba8fab6b1fe3b6cb0
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Apr 8 14:03:27 2019 +0200
ntoskrnl.exe: Don't add device to the list if IoCreateDevice fails.
Spotted by Zebediah Figura.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntoskrnl.exe/ntoskrnl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index c1a74f1..804c7f6 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -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;
}
More information about the wine-cvs
mailing list