mirror of https://github.com/FreeRDP/FreeRDP
winpr-comm: implemented IOCTL_SERIAL_CONFIG_SIZE
This commit is contained in:
parent
0db3d9dbb0
commit
34c3654faf
|
@ -441,7 +441,7 @@ WINPR_API HANDLE CommCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD
|
|||
#define IOCTL_SERIAL_GET_PROPERTIES 0x001B0074
|
||||
/* IOCTL_SERIAL_XOFF_COUNTER 0x001B0070 */
|
||||
/* IOCTL_SERIAL_LSRMST_INSERT 0x001B007C */
|
||||
/* IOCTL_SERIAL_CONFIG_SIZE 0x001B0080 */
|
||||
#define IOCTL_SERIAL_CONFIG_SIZE 0x001B0080
|
||||
/* IOCTL_SERIAL_GET_STATS 0x001B008C */
|
||||
/* IOCTL_SERIAL_CLEAR_STATS 0x001B0090 */
|
||||
/* IOCTL_SERIAL_GET_MODEM_CONTROL 0x001B0094 */
|
||||
|
@ -504,7 +504,7 @@ static const _SERIAL_IOCTL_NAME _SERIAL_IOCTL_NAMES[] =
|
|||
{IOCTL_SERIAL_GET_PROPERTIES, "IOCTL_SERIAL_GET_PROPERTIES"},
|
||||
// {IOCTL_SERIAL_XOFF_COUNTER, "IOCTL_SERIAL_XOFF_COUNTER"},
|
||||
// {IOCTL_SERIAL_LSRMST_INSERT, "IOCTL_SERIAL_LSRMST_INSERT"},
|
||||
// {IOCTL_SERIAL_CONFIG_SIZE, "IOCTL_SERIAL_CONFIG_SIZE"},
|
||||
{IOCTL_SERIAL_CONFIG_SIZE, "IOCTL_SERIAL_CONFIG_SIZE"},
|
||||
// {IOCTL_SERIAL_GET_STATS, "IOCTL_SERIAL_GET_STATS"},
|
||||
// {IOCTL_SERIAL_CLEAR_STATS, "IOCTL_SERIAL_CLEAR_STATS"},
|
||||
// {IOCTL_SERIAL_GET_MODEM_CONTROL,"IOCTL_SERIAL_GET_MODEM_CONTROL"},
|
||||
|
|
|
@ -580,6 +580,28 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l
|
|||
break;
|
||||
|
||||
}
|
||||
case IOCTL_SERIAL_CONFIG_SIZE:
|
||||
{
|
||||
if (pRemoteSerialDriver->config_size)
|
||||
{
|
||||
ULONG *pSize = (ULONG*)lpOutBuffer;
|
||||
|
||||
assert(nOutBufferSize >= sizeof(ULONG));
|
||||
if (nOutBufferSize < sizeof(ULONG))
|
||||
{
|
||||
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!pRemoteSerialDriver->config_size(pComm, pSize))
|
||||
return FALSE;
|
||||
|
||||
*lpBytesReturned = sizeof(ULONG);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_WARN(_T("unsupported IoControlCode=[0x%lX] %s (remote serial driver: %s)"),
|
||||
|
|
|
@ -241,6 +241,7 @@ typedef struct _REMOTE_SERIAL_DRIVER
|
|||
BOOL (*set_xoff)(WINPR_COMM *pComm);
|
||||
BOOL (*set_xon)(WINPR_COMM *pComm);
|
||||
BOOL (*get_dtrrts)(WINPR_COMM *pComm, ULONG *pMask);
|
||||
BOOL (*config_size)(WINPR_COMM *pComm, ULONG *pSize);
|
||||
|
||||
} REMOTE_SERIAL_DRIVER;
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ static REMOTE_SERIAL_DRIVER _SerCx2Sys =
|
|||
.set_xoff = NULL, /* not supported by SerCx2.sys */
|
||||
.set_xon = NULL, /* not supported by SerCx2.sys */
|
||||
.get_dtrrts = NULL,
|
||||
.config_size = NULL, /* not supported by SerCx2.sys */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -400,6 +400,7 @@ static REMOTE_SERIAL_DRIVER _SerCxSys =
|
|||
.set_xoff = NULL,
|
||||
.set_xon = NULL,
|
||||
.get_dtrrts = NULL,
|
||||
.config_size = NULL, /* not supported by SerCx.sys */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1483,6 +1483,14 @@ BOOL _get_dtrrts(WINPR_COMM *pComm, ULONG *pMask)
|
|||
}
|
||||
|
||||
|
||||
BOOL _config_size(WINPR_COMM *pComm, ULONG *pSize)
|
||||
{
|
||||
/* http://msdn.microsoft.com/en-us/library/ff546548%28v=vs.85%29.aspx */
|
||||
pSize = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static REMOTE_SERIAL_DRIVER _SerialSys =
|
||||
{
|
||||
.id = RemoteSerialDriverSerialSys,
|
||||
|
@ -1514,6 +1522,7 @@ static REMOTE_SERIAL_DRIVER _SerialSys =
|
|||
.set_xoff = _set_xoff,
|
||||
.set_xon = _set_xon,
|
||||
.get_dtrrts = _get_dtrrts,
|
||||
.config_size = _config_size,
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue