PortEscapeFunction

cCall   [pPortEscapeFunction], <hPort, lFunc, InData, <OFFSET32 OutData>>
or      eax, eax
jz      error_handler
 

Called by _VCOMM_EscapeCommFunction to carry out an extended function. Uses the C calling convention. Must be callable at interrupt time.

hPort
Address of a _PORTINFORMATION structure returned by the PortOpen function.
lFunc
Value identifying the extended function to carry out, or DUMMY to perform no action. Common extended functions are defined in VCOMM.INC. For more information, see the _VCOMM_EscapeCommFunction service. Port drivers can define additional extended functions.
InData
Function-specific 32-bit parameter.
OutData
Address to receive function-specific data.

A port driver that is designed specifically to emulate a common port type should return success for extended functions that apply to the emulated port type, even if the function does not apply to the hardware used for emulation.

There are several predefined extended functions. Microsoft reserves the first 200 non-negative extended function values (0 through 199). Developers who create new extended functions should enumerate their values beginning with STARTNONSTESCAPES defined in VCOMM.INC. The following escapes are currently defined:

Escape Description
DUMMY This value is never used and a port driver should never receive this escape.
SETXOFF Sets the XOFFReceived flag. This puts the serial driver in the XOFF state.
SETXON Resets the XOFFReceived flag. This puts the serial driver in the XON state.
SETRTS Sets the Ready To Send (RTS) bit in the Modem Control Register.
CLRRTS Resets the Ready To Send bit in the Modem Control Register.
SETDTR Sets the Data Terminal Ready (DTR) bit in the Modem Control Register.
CLRDTR Resets the Data Terminal Ready (DTR) bit in the Modem Control Register.
RESETDEV Asserts the RESET line on an LPT port.
GETLPTMAX Returns the maximum LPT port identifier supported by the system. This value ranges from 0x80 to 0xFF, such that 0x80 corresponds to LPT1, 0x81 corresponds to LPT2, 0x82 corresponds to LPT3, and so on.
GETCOMMAX Returns the maximum COM port identifier supported by the system. This value ranges from 0x00 to 0x7F, such that 0x00 corresponds to COM1, 0x01 corresponds to COM2, 0x02 corresponds to COM3, and so on.
GETCOMBASEIRQ Returns the IRQ and base I/O address of the port. The IRQ value is in the upper-word of the 32-bit value and the base I/O address is in the lower-word.
GETCOMBASEIRQ1 This escape is equivalent to GETCOMBASEIRQ.
SETBREAK Sets the break condition. Suspends character transmission and places the data transmission line in a break state until the CLEARBREAK escape is received.
CLEARBREAK Clears the break condition. Releases any BREAK clamp on the data transmission line.
GETPORTHANDLE Returns the 32-bit Ring 0 handle of the port.
GETEXTENDEDFNADDR .
CLRTIMERLOGIC Disables the periodic notification checks. VCOMM sends this escape when it opens a port for a Win32 application.
GETDEVICEID Gets the IEEE P1284 device ID for the connected peripheral device.
SETECPADDRESS Sets the IEEE P1284 channel address. The IEEE P1284 specification uses a channel addressing scheme that provides 128 forward and reverse channel addresses. Channel addresses are device-specific and are defined in the specification.
SETUPDATETIMEADDR VCOMM uses this escape to set a pointer to a DWORD that the port driver uses to store the most recently updated system time each time new character(s) arrive at the port.
IGNOREERRORONREADS Normally the PortRead function returns an error if an error condition normally exists. This escape sets the IgnoreCommError miscellaneous flag so the PortRead function on the serial port does not check for an existing error condition before transferring characters.
ENABLETIMERLOGIC Enables periodic notification checks. This escape is useful when notification is enabled and non-zero trigger level is implemented. Checking for notifications periodically allows an application to be notified of incoming characters in a timely manner even when the number of received characters is below the trigger level.
IGNORESELECT Sets the IgnoreSelect bit in the LPT driver flags. The select bit is not set under normal circumstances, but the select bit is incorrectly implemented on some parallel devices. This escape allows an LPT port driver to be consistent with the DOS/BIOS on some machines.
STARTNONSTDESCAPES Developer-assigned port escapes should begin with this value.
PEEKCHAR Returns the current character in the input queue if the queue is non-empty; returns zero otherwise.

The port drivers Microsoft supplies with Windows 95 (Serial.vxd and Lpt.vxd) each support a subset of the escapes listed in the preceding text.

Port Driver Supported Escapes
Serial.vxd SETXOFF, SETXON, SETRTS, CLRRTS, SETDTR, CLRDTR, GETCOMBASEIRQ, GETCOMBASEIRQ1, SETBREAK, CLEARBREAK, GETPORTHANDLE, CLRTIMERLOGIC, ENABLETIMERLOGIC, SETUPDATETIMEADDR, IGNOREERRORONREADS, PEEKCHAR.
Lpt.vxd RESETDEV, GETDEVICEID, SETECPADDRESS.

See Also

_PORTDATA, _PORTINFORMATION, _VCOMM_EscapeCommFunction