- Implement GetCommProperties (Saveliy Tretiakov <saveliyt@mail.ru>)

- Remove a test in GetCommState that shouldn't exist

svn path=/trunk/; revision=14251
This commit is contained in:
Hervé Poussineau 2005-03-21 10:32:15 +00:00
parent e5d49d1493
commit 28a24e8079

View file

@ -946,14 +946,15 @@ GetCommModemStatus(HANDLE hFile, LPDWORD lpModemStat)
/*
* @unimplemented
* @implemented
*/
BOOL
STDCALL
GetCommProperties(HANDLE hFile, LPCOMMPROP lpCommProp)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
DWORD dwBytesReturned;
return DeviceIoControl(hFile, IOCTL_SERIAL_GET_PROPERTIES, 0, 0,
lpCommProp, sizeof(COMMPROP), &dwBytesReturned, 0);
}
@ -982,14 +983,15 @@ GetCommState(HANDLE hFile, LPDCB lpDCB)
DPRINT("ERROR: GetCommState() - NULL DCB pointer\n");
return FALSE;
}
if (lpDCB->DCBlength != sizeof(DCB)) {
DPRINT("ERROR: GetCommState() - Invalid DCB size\n");
return FALSE;
}
// DPRINT(" GetCommState() CALLING DeviceIoControl\n");
// result = DeviceIoControl(hFile, IOCTL_SERIAL_GET_COMMSTATUS, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
// DPRINT(" GetCommState() DeviceIoControl returned %d\n", result);
lpDCB->DCBlength = sizeof(DCB);
/* FIXME: need to fill following fields (1 bit):
* fBinary: binary mode, no EOF check
* fParity: enable parity checking
* fOutX : XON/XOFF out flow control
* fInX : XON/XOFF in flow control
*/
result = DeviceIoControl(hFile, IOCTL_SERIAL_GET_BAUD_RATE,
NULL, 0, &BaudRate, sizeof(BaudRate),&dwBytesReturned, NULL);