Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Redirected serial port returns error when accessed using DotNet App


Symptoms

Redirected serial port returns error when accessed through DotNet application. Win32 application(custom app or the standard Hyperterm )  works ok with this same redirected serial port

↑ Back to the top


Cause

DotNet application fails on IOCTL_SERIAL_SET_QUEUE_SIZE while communicating to a redirected serial port. This IOCTL sets queue size for communication devices. DotNet(managed application) requests queue size to be set at 4096 bytes. However Windows Embedded CE 6.0 R3 does not support IOCTL_SERIAL_SET_QUEUE_SIZE and returns ERROR_NOT_SUPPORTED, it maintains a fixed queue size (receive buffer) of 2048. Since this IOCTL is unsupported on Windows CE, the application will see an error when initializing the serial port.

↑ Back to the top


Resolution

Modifying the serial driver’s return value for IOCTL_SERIAL_SET_QUEUE_SIZE in COM_IOControl() will resolve this issue, the change should be similar to the code below.

case IOCTL_SERIAL_SET_QUEUE_SIZE :

        SetLastError(ERROR_NOT_SUPPORTED);

        RetVal = TRUE;                                       

        break;

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2436129
Revision : 1
Created on : 1/7/2017
Published on : 10/12/2010
Exists online : False
Views : 236