Microsoft KB Archive/153384

{|
 * width="100%"|

VCOMM Port Drivers EscapeCommFunction and DeviceIOControl

 * }

Q153384

-

The information in this article applies to:


 * Microsoft Win32 Device Driver Kit (DDK) 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.