次の方法で共有


IOCTL_SERIAL_GET_COMMSTATUS (Compact 2013)

3/26/2014

This I/O control message clears pending communications errors and returns the current communication status. Send this message with DeviceIoControl.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,           // handle to device
    DWORD dwIoControlCode,    // use IOCTL_SERIAL_GET_COMMSTATUS
    LPVOID lpInBuffer,        // pointer to input buffer
    DWORD nInBufferSize,      // input buffer size
    LPVOID lpOutBuffer,       // pointer to output buffer
    DWORD nOutBufferSize,     // output buffer size
    LPDWORD lpBytesReturned,  // number of bytes returned
    OVERLAPPED lpOverlapped   // pointer to OVERLAPPED structure
);

Parameters

  • hDevice
    [in] Handle to the device.
  • dwIoControlCode
    [in] The control code for the operation. Use IOCTL_SERIAL_GET_COMMSTATUS for this operation.
  • lpInBuffer
    Ignored.
  • nInBufferSize
    Ignored.
  • lpOutBuffer
    [in][out] A pointer to a SERIAL_DEV_STATUS structure to contain the returned status information.
  • lpBytesReturned
    [out] Pointer to a DWORD variable to return the length of the returned data. Set to sizeof(SERIAL_DEV_STATUS) if there is no error.
  • lpOverlapped
    [in] Set to NULL.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

To get extended error information, call GetLastError. GetLastError may return other standard error messages as appropriate.

Requirements

Header

pegdser.h

See Also

Reference

Serial Port Driver IOCTLs
COM_Open
DeviceIoControl
SERIAL_DEV_STATUS