KERNEL32: implement TransactNamedPipe for the non-overlapped case

Mike McCormack mike at codeweavers.com
Wed Jan 19 00:35:15 CST 2005


ChangeLog:
* implement TransactNamedPipe for the non-overlapped case
-------------- next part --------------
Index: dlls/kernel/sync.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/sync.c,v
retrieving revision 1.67
diff -u -p -r1.67 sync.c
--- dlls/kernel/sync.c	7 Jan 2005 15:40:09 -0000	1.67
+++ dlls/kernel/sync.c	19 Jan 2005 06:35:04 -0000
@@ -1342,17 +1342,32 @@ BOOL WINAPI DisconnectNamedPipe(HANDLE h
 
 /***********************************************************************
  *           TransactNamedPipe   (KERNEL32.@)
+ *
+ * BUGS
+ *  should be done as a single operation in the wineserver or kernel
  */
 BOOL WINAPI TransactNamedPipe(
-    HANDLE hPipe, LPVOID lpInput, DWORD dwInputSize, LPVOID lpOutput,
+    HANDLE handle, LPVOID lpInput, DWORD dwInputSize, LPVOID lpOutput,
     DWORD dwOutputSize, LPDWORD lpBytesRead, LPOVERLAPPED lpOverlapped)
 {
-    FIXME("%p %p %ld %p %ld %p %p\n",
-          hPipe, lpInput, dwInputSize, lpOutput,
+    BOOL r;
+    DWORD count;
+
+    TRACE("%p %p %ld %p %ld %p %p\n",
+          handle, lpInput, dwInputSize, lpOutput,
           dwOutputSize, lpBytesRead, lpOverlapped);
-    if(lpBytesRead)
-        *lpBytesRead=0;
-    return FALSE;
+
+    if (lpOverlapped)
+    {
+        FIXME("Doesn't support overlapped operation as yet\n");
+        return FALSE;
+    }
+
+    r = WriteFile(handle, lpOutput, dwOutputSize, &count, NULL);
+    if (r)
+        r = ReadFile(handle, lpInput, dwInputSize, lpBytesRead, NULL);
+
+    return r;
 }
 
 /***********************************************************************


More information about the wine-patches mailing list