Readfile on a duplicated pipe hangs

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Fri Jan 10 14:31:11 CST 2003


Hallo,

Marcus sent me patches that made Altera quartus install. Thanks. 

Now running the package hangs in the way it communicates with created
processes. 

Here is what happens in my understanding:
M: Masterprocess C: Childprocess

M: CreatePipe -> handle_read + handle_write
M: DuplicateHandle handle_read -> handle_read_dup
M: CloseHandle (handle_read)
M: Call CreateProcessA with handle_write as hstderr
M: Return Createprocess
M: CloseHandle (handle_write)
M: Call Readfile (handle_read_dup)
C: initializes, executes and exit
M: Return Readfile retval=00000001
M: Endless loop of Call Readfile (handle_read_dup) retval=00000001

MSDN says, that ReadFile should fail on an anonymous pipe, if the othe end
has close.

With following patch, the application starts up. Feedback welcome.


Index: wine/server/pipe.c
===================================================================
RCS file: /home/wine/wine/server/pipe.c,v
retrieving revision 1.24
diff -u -r1.24 pipe.c
--- wine/server/pipe.c	30 May 2002 20:12:58 -0000	1.24
+++ wine/server/pipe.c	10 Jan 2003 20:28:43 -0000
@@ -141,6 +141,13 @@
 
 static int pipe_get_info( struct object *obj, struct get_file_info_reply *reply, int *flags )
 {
+    struct pipe *pipe = (struct pipe *)obj;
+    assert( obj->ops == &pipe_ops );
+    if (!pipe->other)
+    {
+        set_error( STATUS_PIPE_BROKEN );
+        return -1;
+    }
     if (reply)
     {
         reply->type        = FILE_TYPE_PIPE;

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the wine-devel mailing list