[PATCH] server: Use queue_irp() also for synchronous IRPs.

Zebediah Figura z.figura12 at gmail.com
Sat Aug 5 19:11:50 CDT 2017


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 server/device.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/server/device.c b/server/device.c
index 192395dcc7..ccd4c42e08 100644
--- a/server/device.c
+++ b/server/device.c
@@ -378,11 +378,7 @@ static struct object *device_open_file( struct object *obj, unsigned int access,
         params.create.options = options;
         params.create.device  = file->device->user_ptr;
 
-        if ((irp = create_irp( file, &params, NULL )))
-        {
-            add_irp_to_queue( file, irp, NULL );
-            release_object( irp );
-        }
+        queue_irp( file, &params, NULL );
     }
     return &file->obj;
 }
@@ -414,11 +410,7 @@ static int device_file_close_handle( struct object *obj, struct process *process
         params.close.major = IRP_MJ_CLOSE;
         params.close.file  = file->user_ptr;
 
-        if ((irp = create_irp( file, &params, NULL )))
-        {
-            add_irp_to_queue( file, irp, NULL );
-            release_object( irp );
-        }
+        queue_irp( file, &params, NULL );
     }
     return 1;
 }
@@ -467,11 +459,15 @@ static int queue_irp( struct device_file *file, const irp_params_t *params, stru
     struct irp_call *irp = create_irp( file, params, async );
     if (!irp) return 0;
 
-    fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT );
-    irp->async = (struct async *)grab_object( async );
+    if (async)
+    {
+        fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT );
+        irp->async = (struct async *)grab_object( async );
+    }
     add_irp_to_queue( file, irp, current );
     release_object( irp );
-    set_error( STATUS_PENDING );
+    if (async)
+        set_error( STATUS_PENDING );
     return 1;
 }
 
-- 
2.13.3




More information about the wine-patches mailing list