Link between setup classes and interface classes.

Discussion in 'Windows Vista Drivers' started by Guillaume, Apr 22, 2005.

  1. Guillaume

    Guillaume Guest

    Dear All,

    I would like to communicate directly with USB and parallel local
    printers using CreateFile, WriteFile and ReadFile functions from the
    Windows API.

    To retrieve local printers connected to a PC, I used the setupapi with
    the printer setup class as follow :


    Then I could enumerate the printers using SetupDiEnumDeviceInfo ().

    To communicate with the printers using CreateFile, WriteFile and
    ReadFile functions, I figured out I had to retrieve the "symbolic name"
    of the printers using SetupDiGetDeviceInterfaceDetail ().

    How can I get the device interfaces of the printers I retrieved using
    SetupDiEnumDeviceInfo () ? What is the link between setup class and
    interface class ?

    Best regards,

    Guillaume, Apr 22, 2005
    1. Advertisements

  2. I'm not sure this is possible for USB printers. The kernel mode driver for
    USB printer can assume that its only user-mode client is USBMON.DLL, which can
    have some set of undocumented IOCTLs to communicate to the kernel mode part.
    Maxim S. Shatskih, Apr 22, 2005
    1. Advertisements

  3. Guillaume

    Guillaume Guest

    Thanks a lot for your help!

    I managed to retrieve the symbolic name of a specific printer. (The
    link is the device id.)
    I then used CreateFile to open the USB printer.

    I tested this method with 2 printers: Lexmark E321 and HP Laserjet 1320
    PCL 6.

    It works well with the USB Lexmark E321 printer but CreateFile fails
    with the HP Laserjet 1320 PCL 6. (Error code ERROR_GEN_FAILURE "A
    device attached to the system is not functioning.").

    What is that error from?
    Is that possible that, for some reasons, the device be locked?
    Guillaume, Apr 27, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.