How to Set the ECP Mode Addressing on LPT Ports

Last reviewed: August 5, 1996
Article ID: Q138432
The information in this article applies to:
  • Microsoft Win32 Device Development Kit (DDK) version 4.0

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 reference words: LPT ECP win95
KBCategory: kbprg kbwebcontent
KBSubcategory:


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: August 5, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.