none
Filter driver to export 4 com ports on top a usb driver RRS feed

  • Question

  • Hi,

    I need to export 4 serial COM ports on which forward IRPs to underlying USB custom driver (WDM).

    Is it possible to develop a filter driver on top the WDM USB custom driver to export these COM interfaces.

    Please suggest any better solution.

    Thanks in Advance


    vidyasagar196

    Tuesday, September 13, 2016 10:35 AM

Answers

  • What exactly would you be filtering? Your proposed solution doesn't make any sense. The IRPs required by a serial port are well documented, and there is a virtual serial driver in the WDK samples. Writing such a driver in WDM would be pointless, and waste an enormous amount of time. Start with the WDF serial sample and extend it as necessary.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Tuesday, September 13, 2016 6:08 PM
    Moderator

All replies

  • What exactly would you be filtering? Your proposed solution doesn't make any sense. The IRPs required by a serial port are well documented, and there is a virtual serial driver in the WDK samples. Writing such a driver in WDM would be pointless, and waste an enormous amount of time. Start with the WDF serial sample and extend it as necessary.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Tuesday, September 13, 2016 6:08 PM
    Moderator
  • I think the OP wants to add the com port functionality in addition to whatever the custom usb driver is doing. if that is the case, you can write a device upper filter in KMDF that enumerates 4 raw PDOs and implement the logic to convert serial IRPs to your custom driver IRPs in the PDO code.

    If this is not the case and all you want to do is expose 4 serial ports, throw away your wdm driver and use KMDF to write the bus driver as the FDO and translate the serial requests into USB requests.

    As brian said, you can get all of the necessary serial io processing code from the serial sample


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, September 13, 2016 7:27 PM
  • Thank you Everyone for your replies.

    Let me explain, what am I trying to do.

    I have a printer connected to windows 8.1 using USB cable, I need to export 4 COM interfaces, which need to send the raw data to printer.

    I ll develop a test application, which talks to COM device and on sending some text data and print command to application. printer needs to print the text received via COM.

    Please suggest me better solution.

    Thanks in Advance.


    vidyasagar196


    Wednesday, September 14, 2016 3:08 PM
  • A few questions:

    1.  What is the requirement of using serial communications for the printer?  I.E. is there a program that is hard coded to use serial, or what caused this requirement?

    2.  When you say 4 COM ports, are these all to the same printer?


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, September 14, 2016 3:28 PM
  • 1.  What is the requirement of using serial communications for the printer?  I.E. is there a program that is hard coded to use serial, or what caused this requirement?

    Actually we dont have any app that caused requirement. Requirement is from customer. Instead of sending text data from file or 3rd party application, we need to send data directly to printer.

    2.  When you say 4 COM ports, are these all to the same printer?

    All COM ports talks to same printer. We have 4 kinds printers from same vendor, all of those printers need same kind of COM interfaces.


    vidyasagar196

    Wednesday, September 14, 2016 3:34 PM
  • using COM to talk to the printer is a bit outdated. there are more modern ways that don't require enumerating extra devices for direct printer communication


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, September 14, 2016 4:14 PM
  • Thank you Doron and Don,

    As customer requirement demands, we need to create a serial interface to USB driver.

    Is it possible to develop a virtual serial filter driver on top of MSFT inbox USB printer class driver, which ll  process the serial IRPs and send URB to the USB printer driver after formatting ?



    vidyasagar196

    Thursday, September 15, 2016 2:47 PM
  • The inbox class driver for usb printers does not accept URBs, it only sends them based on standard print commands. your driver would have to send standard printing commands to usbprint.sys.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, September 15, 2016 4:27 PM