How to Set the ECP Mode Addressing on LPT Ports

ID: Q138432


The information in this article applies to:


SUMMARY

The built-in Lpt.vxd port provider in Windows 95 implements the IEEE Parallel interface P1284. One of the interesting features of the ECP mode is the ability to address up to 128 separate I/O devices. This can be accomplished at the application level with the DeviceIoControl function or from a VxD with _VCOMM_EscapeCommFunction.


MORE INFORMATION

How to Address Up to 128 Separate I/O Devices from a VxD

The standard call for EscapeCommFunction is given as:

include vcomm.inc

VxDcall _VCOMM_EscapeCommFunction, <hPort, lFunc, \ 
   InData, <OFFSET32 OutData>>
or      eax, eax
jz      error_handler 

Set hPort to the handle passed back from OpenComm, set lfunc to SETECPADDRESS, and set InData to a pointer to a buffer the first byte of which is the address to be set 0x00..0x7F.

How to Address Up to 128 Separate I/O Devices from a 32-bit Application

Please refer to the MSDN Library compact disc for the standard DeviceIoContol() function. Set hDevice to the device handle, set dwIoControlCode to SETECPADDRESS, and set lpInBuffer to a pointer to a buffer the first byte of which is the address 0x00..0x7F. Use GetLastError() to retrieve the error code if the function returns false.

Notes

The IEEE specification defines values 0x80..0xFF as pertaining to compression. You cannot use that from here. Values exceeding 0x7F will return error code IE_INVALIDPARAM.

If the port will support ECP mode, it will be set to that and the address transmitted.

If the port does not support ECP mode or is in reverse transfer currently, the error code IE_HARDWARE will be sent back.


REFERENCES

SETECPADDRESS, IE_INVALIDPARAM, and IE_HARDWARE are defined in both Vcomm.h and Vcomm.inc in the Windows 95 DDK.

Vcomm.doc in the Windows 95 DDK.

MSDN Library Compact Disc July 1995.

IEEE specification for hardware "IEEE P1284 D2.00" 1993 research was done on internal Microsoft documents and source code 1994-1995.

Additional query words: LPT ECP win95


Keywords          : 
Version           : 4.00
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 2, 1999