[ros-diffs] [cwittich] 38891: fix kernel32 comm crash If lpOverlapped is NULL, lpBytesReturned cannot be NULL.

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Jan 18 14:56:10 CET 2009


Author: cwittich
Date: Sun Jan 18 07:56:09 2009
New Revision: 38891

URL: http://svn.reactos.org/svn/reactos?rev=38891&view=rev
Log:
fix kernel32 comm crash
If lpOverlapped is NULL, lpBytesReturned cannot be NULL.

Modified:
    trunk/reactos/dll/win32/kernel32/misc/comm.c

Modified: trunk/reactos/dll/win32/kernel32/misc/comm.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/comm.c?rev=38891&r1=38890&r2=38891&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/comm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/comm.c [iso-8859-1] Sun Jan 18 07:56:09 2009
@@ -354,13 +354,13 @@
 	}
 
     if (!DeviceIoControl(hFile, IOCTL_SERIAL_GET_BAUD_RATE,
-                         NULL, 0, &BaudRate, sizeof(BaudRate), NULL, NULL) ||
+                         NULL, 0, &BaudRate, sizeof(BaudRate), &dwBytesReturned, NULL) ||
         !DeviceIoControl(hFile, IOCTL_SERIAL_GET_LINE_CONTROL,
-                         NULL, 0, &LineControl, sizeof(LineControl), NULL, NULL) ||
+                         NULL, 0, &LineControl, sizeof(LineControl), &dwBytesReturned, NULL) ||
         !DeviceIoControl(hFile, IOCTL_SERIAL_GET_HANDFLOW,
-                         NULL, 0, &HandFlow, sizeof(HandFlow), NULL, NULL) ||
+                         NULL, 0, &HandFlow, sizeof(HandFlow), &dwBytesReturned, NULL) ||
         !DeviceIoControl(hFile, IOCTL_SERIAL_GET_CHARS,
-                         NULL, 0, &SpecialChars, sizeof(SpecialChars), NULL, NULL))
+                         NULL, 0, &SpecialChars, sizeof(SpecialChars), &dwBytesReturned, NULL))
         return FALSE;
 
     memset(lpDCB, 0, sizeof(*lpDCB));



More information about the Ros-diffs mailing list