Module: wine Branch: master Commit: 80d53026bf22a11aafaf3c4ba8fab6b1fe3b6cb0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=80d53026bf22a11aafaf3c4ba...
Author: Jacek Caban jacek@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@codeweavers.com Signed-off-by: Alexandre Julliard julliard@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; }