Christoph von Wittich wrote:
> dlls/kernel32/comm.c | 55
> +++++++++++++++++++++++++++++++------------------
> 1 files changed, 35 insertions(+), 20 deletions(-)
>
> diff --git a/dlls/kernel32/comm.c b/dlls/kernel32/comm.c
> index d83eacb..11cfda0 100644
> --- a/dlls/kernel32/comm.c
> +++ b/dlls/kernel32/comm.c
> @@ -551,7 +551,8 @@ BOOL WINAPI BuildCommDCBW(
> */
> BOOL WINAPI SetCommBreak(HANDLE handle)
> {
> - return DeviceIoControl(handle, IOCTL_SERIAL_SET_BREAK_ON, NULL, 0,
> NULL, 0, NULL, NULL);
> + DWORD dwBytesReturned;
> + return DeviceIoControl(handle, IOCTL_SERIAL_SET_BREAK_ON, NULL, 0,
> NULL, 0, &dwBytesReturned, NULL);
> }
>
> /*****************************************************************************
> @@ -573,7 +574,8 @@ BOOL WINAPI SetCommBreak(HANDLE handle)
> */
> BOOL WINAPI ClearCommBreak(HANDLE handle)
> {
> - return DeviceIoControl(handle, IOCTL_SERIAL_SET_BREAK_OFF, NULL, 0,
> NULL, 0, NULL, NULL);
> + DWORD dwBytesReturned;
> + return DeviceIoControl(handle, IOCTL_SERIAL_SET_BREAK_OFF, NULL, 0,
> NULL, 0, &dwBytesReturned, NULL);
> }
>
> /*****************************************************************************
> @@ -595,6 +597,7 @@ BOOL WINAPI ClearCommBreak(HANDLE handle)
> BOOL WINAPI EscapeCommFunction(HANDLE handle, UINT func)
> {
> DWORD ioc;
> + DWORD dwBytesReturned;
>
> switch (func)
> {
> @@ -612,7 +615,7 @@ BOOL WINAPI EscapeCommFunction(HANDLE handle, UINT func)
> SetLastError(ERROR_INVALID_PARAMETER);
> return FALSE;
> }
> - return DeviceIoControl(handle, ioc, NULL, 0, NULL, 0, NULL, NULL);
> + return DeviceIoControl(handle, ioc, NULL, 0, NULL, 0,
> &dwBytesReturned, NULL);
> }
>
> /********************************************************************
> @@ -632,8 +635,9 @@ BOOL WINAPI EscapeCommFunction(HANDLE handle, UINT func)
> */
> BOOL WINAPI PurgeComm(HANDLE handle, DWORD flags)
> {
> + DWORD dwBytesReturned;
> return DeviceIoControl(handle, IOCTL_SERIAL_PURGE, &flags,
> sizeof(flags),
> - NULL, 0, NULL, NULL);
> + NULL, 0, &dwBytesReturned, NULL);
> }
>
> /*****************************************************************************
> @@ -654,9 +658,10 @@ BOOL WINAPI PurgeComm(HANDLE handle, DWORD flags)
> BOOL WINAPI ClearCommError(HANDLE handle, LPDWORD errors, LPCOMSTAT lpStat)
> {
> SERIAL_STATUS ss;
> + DWORD dwBytesReturned;
>
> if (!DeviceIoControl(handle, IOCTL_SERIAL_GET_COMMSTATUS, NULL, 0,
> - &ss, sizeof(ss), NULL, NULL))
> + &ss, sizeof(ss), &dwBytesReturned, NULL))
> return FALSE;
>
> if (errors)
> @@ -708,11 +713,12 @@ BOOL WINAPI ClearCommError(HANDLE handle, LPDWORD
> errors, LPCOMSTAT lpStat)
> BOOL WINAPI SetupComm(HANDLE handle, DWORD insize, DWORD outsize)
> {
> SERIAL_QUEUE_SIZE sqs;
> + DWORD dwBytesReturned;
>
> sqs.InSize = insize;
> sqs.OutSize = outsize;
> return DeviceIoControl(handle, IOCTL_SERIAL_SET_QUEUE_SIZE,
> - &sqs, sizeof(sqs), NULL, 0, NULL, NULL);
> + &sqs, sizeof(sqs), NULL, 0,
> &dwBytesReturned, NULL);
> }
>
> /*****************************************************************************
> @@ -732,9 +738,10 @@ BOOL WINAPI SetupComm(HANDLE handle, DWORD insize,
> DWORD outsize)
> */
> BOOL WINAPI GetCommMask(HANDLE handle, LPDWORD evtmask)
> {
> + DWORD dwBytesReturned;
> TRACE("handle %p, mask %p\n", handle, evtmask);
> return DeviceIoControl(handle, IOCTL_SERIAL_GET_WAIT_MASK,
> - NULL, 0, evtmask, sizeof(*evtmask), NULL, NULL);
> + NULL, 0, evtmask, sizeof(*evtmask),
> &dwBytesReturned, NULL);
> }
>
> /*****************************************************************************
> @@ -755,9 +762,11 @@ BOOL WINAPI GetCommMask(HANDLE handle, LPDWORD evtmask)
> */
> BOOL WINAPI SetCommMask(HANDLE handle, DWORD evtmask)
> {
> + DWORD dwBytesReturned;
> +
> TRACE("handle %p, mask %x\n", handle, evtmask);
> return DeviceIoControl(handle, IOCTL_SERIAL_SET_WAIT_MASK,
> - &evtmask, sizeof(evtmask), NULL, 0, NULL, NULL);
> + &evtmask, sizeof(evtmask), NULL, 0,
> &dwBytesReturned, NULL);
> }
>
> static void dump_dcb(const DCB* lpdcb)
> @@ -797,6 +806,7 @@ BOOL WINAPI SetCommState( HANDLE handle, LPDCB lpdcb)
> SERIAL_LINE_CONTROL slc;
> SERIAL_HANDFLOW shf;
> SERIAL_CHARS sc;
> + DWORD dwBytesReturned;
>
> if (lpdcb == NULL)
> {
> @@ -858,13 +868,13 @@ BOOL WINAPI SetCommState( HANDLE handle, LPDCB lpdcb)
> * so flow control does not interfere.
> */
> return (DeviceIoControl(handle, IOCTL_SERIAL_SET_BAUD_RATE,
> - &sbr, sizeof(sbr), NULL, 0, NULL, NULL) &&
> + &sbr, sizeof(sbr), NULL, 0,
> &dwBytesReturned, NULL) &&
> DeviceIoControl(handle, IOCTL_SERIAL_SET_LINE_CONTROL,
> - &slc, sizeof(slc), NULL, 0, NULL, NULL) &&
> + &slc, sizeof(slc), NULL, 0,
> &dwBytesReturned, NULL) &&
> DeviceIoControl(handle, IOCTL_SERIAL_SET_HANDFLOW,
> - &shf, sizeof(shf), NULL, 0, NULL, NULL) &&
> + &shf, sizeof(shf), NULL, 0,
> &dwBytesReturned, NULL) &&
> DeviceIoControl(handle, IOCTL_SERIAL_SET_CHARS,
> - &sc, sizeof(sc), NULL, 0, NULL, NULL));
> + &sc, sizeof(sc), NULL, 0, &dwBytesReturned,
> NULL));
> }
>
>
> @@ -891,6 +901,7 @@ BOOL WINAPI GetCommState(HANDLE handle, LPDCB lpdcb)
> SERIAL_LINE_CONTROL slc;
> SERIAL_HANDFLOW shf;
> SERIAL_CHARS sc;
> + DWORD dwBytesReturned;
>
> TRACE("handle %p, ptr %p\n", handle, lpdcb);
>
> @@ -901,13 +912,13 @@ BOOL WINAPI GetCommState(HANDLE handle, LPDCB lpdcb)
> }
>
> if (!DeviceIoControl(handle, IOCTL_SERIAL_GET_BAUD_RATE,
> - NULL, 0, &sbr, sizeof(sbr), NULL, NULL) ||
> + NULL, 0, &sbr, sizeof(sbr), &dwBytesReturned,
> NULL) ||
> !DeviceIoControl(handle, IOCTL_SERIAL_GET_LINE_CONTROL,
> - NULL, 0, &slc, sizeof(slc), NULL, NULL) ||
> + NULL, 0, &slc, sizeof(slc), &dwBytesReturned,
> NULL) ||
> !DeviceIoControl(handle, IOCTL_SERIAL_GET_HANDFLOW,
> - NULL, 0, &shf, sizeof(shf), NULL, NULL) ||
> + NULL, 0, &shf, sizeof(shf), &dwBytesReturned,
> NULL) ||
> !DeviceIoControl(handle, IOCTL_SERIAL_GET_CHARS,
> - NULL, 0, &sc, sizeof(sc), NULL, NULL))
> + NULL, 0, &sc, sizeof(sc), &dwBytesReturned, NULL))
> return FALSE;
>
> memset(lpdcb, 0, sizeof(*lpdcb));
> @@ -980,8 +991,9 @@ BOOL WINAPI GetCommState(HANDLE handle, LPDCB lpdcb)
> */
> BOOL WINAPI TransmitCommChar(HANDLE hComm, CHAR chTransmit)
> {
> + DWORD dwBytesReturned;
> return DeviceIoControl(hComm, IOCTL_SERIAL_IMMEDIATE_CHAR,
> - &chTransmit, sizeof(chTransmit), NULL, 0,
> NULL, NULL);
> + &chTransmit, sizeof(chTransmit), NULL, 0,
> &dwBytesReturned, NULL);
> }
>
>
> @@ -1002,6 +1014,7 @@ BOOL WINAPI TransmitCommChar(HANDLE hComm, CHAR
> chTransmit)
> BOOL WINAPI GetCommTimeouts(HANDLE hComm, LPCOMMTIMEOUTS lptimeouts)
> {
> SERIAL_TIMEOUTS st;
> + DWORD dwBytesReturned;
>
> TRACE("(%p, %p)\n", hComm, lptimeouts);
> if (!lptimeouts)
> @@ -1010,7 +1023,7 @@ BOOL WINAPI GetCommTimeouts(HANDLE hComm,
> LPCOMMTIMEOUTS lptimeouts)
> return FALSE;
> }
> if (!DeviceIoControl(hComm, IOCTL_SERIAL_GET_TIMEOUTS,
> - NULL, 0, &st, sizeof(st), NULL, NULL))
> + NULL, 0, &st, sizeof(st), &dwBytesReturned, NULL))
> return FALSE;
> lptimeouts->ReadIntervalTimeout = st.ReadIntervalTimeout;
> lptimeouts->ReadTotalTimeoutMultiplier =
> st.ReadTotalTimeoutMultiplier;
> @@ -1043,6 +1056,7 @@ BOOL WINAPI GetCommTimeouts(HANDLE hComm,
> LPCOMMTIMEOUTS lptimeouts)
> BOOL WINAPI SetCommTimeouts(HANDLE hComm, LPCOMMTIMEOUTS lptimeouts)
> {
> SERIAL_TIMEOUTS st;
> + DWORD dwBytesReturned;
>
> TRACE("(%p, %p)\n", hComm, lptimeouts);
>
> @@ -1058,7 +1072,7 @@ BOOL WINAPI SetCommTimeouts(HANDLE hComm,
> LPCOMMTIMEOUTS lptimeouts)
> st.WriteTotalTimeoutConstant = lptimeouts->WriteTotalTimeoutConstant;
>
> return DeviceIoControl(hComm, IOCTL_SERIAL_SET_TIMEOUTS,
> - &st, sizeof(st), NULL, 0, NULL, NULL);
> + &st, sizeof(st), NULL, 0, &dwBytesReturned,
> NULL);
> }
>
> /***********************************************************************
> @@ -1078,8 +1092,9 @@ BOOL WINAPI SetCommTimeouts(HANDLE hComm,
> LPCOMMTIMEOUTS lptimeouts)
> */
> BOOL WINAPI GetCommModemStatus(HANDLE hFile, LPDWORD lpModemStat)
> {
> + DWORD dwBytesReturned;
> return DeviceIoControl(hFile, IOCTL_SERIAL_GET_MODEMSTATUS,
> - NULL, 0, lpModemStat, sizeof(DWORD), NULL,
> NULL);
> + NULL, 0, lpModemStat, sizeof(DWORD),
> &dwBytesReturned, NULL);
> }
>
> /***********************************************************************
>
>
>
Hi, your patches are corrupted by line wrapping.