VCOMM Port Drivers EscapeCommFunction and DeviceIOControl

Last reviewed: July 10, 1996
Article ID: Q153384
The information in this article applies to:
  • Microsoft Windows Device Development Kit (DDK) for Windows 95

SUMMARY

EscapeCommFunction and DeviceIOControl calls to VCOMM are reflected to the port drivers registered with VCOMM. They have default behavior as well as being available to developers as general purpose I/O and control in custom port drivers.

MORE INFORMATION

Calls to port drivers are made by means of the port handle returned when the port was opened through VCOMM. VCOMM knows to take the port handle and use it to call the appropriate port function. From VCOMM.INC, they are listed as pPortEscapeFunction and pPortDeviceIOCtl. Parameter passing is similar and in fact, in LPT.VXD, the default parallel port driver, they both end up in the same extended function call. In the default SERIAL.VXD, the EscapeFunction provides the functions given below, but DeviceIOControl is NOT implemented. The table entry in the SERIAL sample code simply appears without comment as " dd 0 " instead of an address.

SERIAL.VXD default functions for Escape Function: (from sample comments)

0:   Dummy   - Ignored
1: SETXOFF - Exactly as if X-OFF character has been received. 2: SETXON - Exactly as if X-ON character has been received. 3: SETRTS - Set the RTS signal 4: CLRRTS - Clear the RTS signal 5: SETDTR - Set the DTR signal 6: CLRDTR - Clear the DTR signal 7: RESETDEV- Yank on reset line if available (LPT devices) 8: GETLPTMAX - ignored 9: GETCOMMAX - ignored 10: GETCOMBASEIRQ - return base and IRQ of COMM port 11: GETCOMBASEIRQ1 - -do- 12: SETBREAK - set break condition 13: CLEARBREAK - clear break condition

LPT.VXD default functions for Escape Function and DeviceIOControl:

18: SETECPADDRESS sends ECP address, as passed in the first byte of InBuffer 0x00..0x7F. Use GetLastError() to retrieve error code if function return is false. IE_INVALIDPARAM means address greater than 0x7F not allowed. IE_HARDWARE means not ECP port or not available in reverse transfer. Note that this does not imply that VCOMM will support more than one device on a port.

17: GETDEVICEID queries and returns Plug-and-Play string from an LPT port device. OutBuffer's first four bytes contain the size of the string while InBuffer will contain the returned string. This is nibble mode only. The Extensibility Byte is sent as 0x04 to start the process.

7: RESETDEV sends a 300ms+ reset pulse, nInit w/nSelectIn asserted.

REFERENCES

Windows 95 DDK, SERIAL.VXD sample, VCOMM.INC/VCOMM.H contains definitions MSDN Library CD-ROM.


Additional reference words:
KBCategory: kbprg
KBSubcategory: DdkComm



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 10, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.