ntdll: Implemented IOCTL for char transmission: IMMEDIATE_CHAR.
This commit is contained in:
parent
5973955e4e
commit
3c2abaf45e
@ -1652,23 +1652,20 @@ BOOL WINAPI GetCommState(
|
|||||||
* Transmits a single character in front of any pending characters in the
|
* Transmits a single character in front of any pending characters in the
|
||||||
* output buffer. Usually used to send an interrupt character to a host.
|
* output buffer. Usually used to send an interrupt character to a host.
|
||||||
*
|
*
|
||||||
|
* PARAMS
|
||||||
|
* hComm [in] The communication device in need of a command character
|
||||||
|
* chTransmit [in] The character to transmit
|
||||||
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
*
|
*
|
||||||
* True if the call succeeded, false if the previous command character to the
|
* True if the call succeeded, false if the previous command character to the
|
||||||
* same device has not been sent yet the handle is bad etc.
|
* same device has not been sent yet the handle is bad etc.
|
||||||
*
|
*
|
||||||
* BUGS
|
|
||||||
*
|
|
||||||
* Stub.
|
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI TransmitCommChar(
|
BOOL WINAPI TransmitCommChar(HANDLE hComm, CHAR chTransmit)
|
||||||
HANDLE hComm, /* [in] The communication device in need of a command character. */
|
|
||||||
CHAR chTransmit) /* [in] The character to transmit. */
|
|
||||||
{
|
{
|
||||||
DWORD w;
|
return DeviceIoControl(hComm, IOCTL_SERIAL_IMMEDIATE_CHAR,
|
||||||
WARN("(%p,'%c') not perfect!\n",hComm,chTransmit);
|
&chTransmit, sizeof(chTransmit), NULL, 0, NULL, NULL);
|
||||||
|
|
||||||
return WriteFile( hComm, &chTransmit, 1, &w, NULL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,6 +211,15 @@ static NTSTATUS set_wait_mask(HANDLE hDevice, DWORD mask)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static NTSTATUS xmit_immediate(HANDLE hDevice, int fd, char* ptr)
|
||||||
|
{
|
||||||
|
/* FIXME: not perfect as it should bypass the in-queue */
|
||||||
|
WARN("(%p,'%c') not perfect!\n", hDevice, *ptr);
|
||||||
|
if (write(fd, ptr, 1) != 1)
|
||||||
|
return FILE_GetNtStatus();
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* COMM_DeviceIoControl
|
* COMM_DeviceIoControl
|
||||||
*
|
*
|
||||||
@ -255,6 +264,12 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
|
|||||||
else
|
else
|
||||||
status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
|
case IOCTL_SERIAL_IMMEDIATE_CHAR:
|
||||||
|
if (lpInBuffer && nInBufferSize == sizeof(CHAR))
|
||||||
|
status = xmit_immediate(hDevice, fd, lpInBuffer);
|
||||||
|
else
|
||||||
|
status = STATUS_INVALID_PARAMETER;
|
||||||
|
break;
|
||||||
case IOCTL_SERIAL_PURGE:
|
case IOCTL_SERIAL_PURGE:
|
||||||
if (lpInBuffer && nInBufferSize == sizeof(DWORD))
|
if (lpInBuffer && nInBufferSize == sizeof(DWORD))
|
||||||
status = purge(fd, *(DWORD*)lpInBuffer);
|
status = purge(fd, *(DWORD*)lpInBuffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user