comm.c: TransmitCommChar

Mike McCormack mikem at codeweavers.com
Tue Apr 23 18:26:51 CDT 2002


Hi Marcelo,

Does this help things? It's not perfect, but it should be better than 
nothing...

Mike

Marcelo Welter wrote:
> Greatings
> 
> I have some application qhen use the comm.c:TransmitCommChar function, but this function are not implemented.
> 
> anybody have one ideia to me go around this problem...?
> 
> 
> thaks and sorry per my litle english
> 
> 
> Marcelo Welter
> 
> 


-------------- next part --------------
Index: dlls/kernel/comm.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/comm.c,v
retrieving revision 1.57
diff -u -r1.57 comm.c
--- dlls/kernel/comm.c	22 Apr 2002 22:32:13 -0000	1.57
+++ dlls/kernel/comm.c	23 Apr 2002 23:24:45 -0000
@@ -1435,9 +1435,23 @@
     HANDLE hComm,      /* [in] The communication device in need of a command character. */
     CHAR   chTransmit) /* [in] The character to transmit. */
 {
-    	FIXME("(%x,'%c'), stub ! Use win32 handle!\n",hComm,chTransmit);
-	return TRUE;
+    BOOL r = FALSE;
+    int fd;
+
+    WARN("(%x,'%c') not perfect!\n",hComm,chTransmit);
+
+    fd = FILE_GetUnixHandle( hComm, GENERIC_READ );
+    if ( fd < 0 )
+        SetLastError ( ERROR_INVALID_PARAMETER );
+    else
+    {
+        r = (1 == write(fd, &chTransmit, 1));
+        close(fd);
+    }
+
+    return r;
 }
+
 
 /*****************************************************************************
  *	GetCommTimeouts		(KERNEL32.@)


More information about the wine-patches mailing list