Jacek Caban : server: Remove no longer needed need_handle from queue_irp.

Alexandre Julliard julliard at winehq.org
Wed Jun 28 15:10:25 CDT 2017


Module: wine
Branch: master
Commit: 84bc9c3d56225d0bdd9f4bbc76986ef4ef83e22c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=84bc9c3d56225d0bdd9f4bbc76986ef4ef83e22c

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jun 26 12:20:27 2017 +0200

server: Remove no longer needed need_handle from queue_irp.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/device.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/server/device.c b/server/device.c
index cf405b8..fc5bcbe 100644
--- a/server/device.c
+++ b/server/device.c
@@ -462,22 +462,14 @@ static void set_file_user_ptr( struct device_file *file, client_ptr_t ptr )
 }
 
 /* queue an irp to the device */
-static obj_handle_t queue_irp( struct device_file *file, struct irp_call *irp, struct async *async, int need_handle )
+static int queue_irp( struct device_file *file, struct irp_call *irp, struct async *async )
 {
-    obj_handle_t handle = 0;
+    if (!fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT )) return 0;
 
-    if (!need_handle) handle = 1;
-    else if (async_is_blocking( async ) && !(handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ))) return 0;
-
-    if (!fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT ))
-    {
-        if (need_handle && handle) close_handle( current->process, handle );
-        return 0;
-    }
     irp->async = (struct async *)grab_object( async );
     add_irp_to_queue( file, irp, current );
     set_error( STATUS_PENDING );
-    return handle;
+    return 1;
 }
 
 static enum server_fd_type device_file_get_fd_type( struct fd *fd )
@@ -501,7 +493,7 @@ static int device_file_read( struct fd *fd, struct async *async, file_pos_t pos
     irp = create_irp( file, &params, async );
     if (!irp) return 0;
 
-    handle = queue_irp( file, irp, async, 0 );
+    handle = queue_irp( file, irp, async );
     release_object( irp );
     return handle;
 }
@@ -522,7 +514,7 @@ static int device_file_write( struct fd *fd, struct async *async, file_pos_t pos
     irp = create_irp( file, &params, async );
     if (!irp) return 0;
 
-    handle = queue_irp( file, irp, async, 0 );
+    handle = queue_irp( file, irp, async );
     release_object( irp );
     return handle;
 }
@@ -541,7 +533,7 @@ static int device_file_flush( struct fd *fd, struct async *async )
     irp = create_irp( file, &params, NULL );
     if (!irp) return 0;
 
-    handle = queue_irp( file, irp, async, 0 );
+    handle = queue_irp( file, irp, async );
     release_object( irp );
     return handle;
 }
@@ -561,7 +553,7 @@ static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
     irp = create_irp( file, &params, async );
     if (!irp) return 0;
 
-    handle = queue_irp( file, irp, async, 0 );
+    handle = queue_irp( file, irp, async );
     release_object( irp );
     return handle;
 }




More information about the wine-cvs mailing list