can serial.sys create a PDO when a nonPNP serial device is insered?

Discussion in 'Windows Vista Drivers' started by peng, Nov 19, 2003.

  1. peng

    peng Guest

    in win 2000,a nonPNP device,such as a serial printer ,is inserted,can the
    serial bus create a PDO for the serial port?
    if I want to develop a driver for the printer(nonPNP),then this may be a
    layered driver.the lower one is serial.sys,the higher one is printer.sys.
    what does the serial bus do in this course?
    what does serial.sys do ?Is serial bus equal to serial.sys??
    I know the pdo created by usb .sys( I am not sure of the name) is passed as
    a parametre to Adddevice() in a WDM driver.
    however,I have no idea about whether the serial.sys can create a pdo and
    pass it to
    AddDevice(),does serial.sys create a pdo and pass it to AddDevice()????
    peng, Nov 19, 2003
    1. Advertisements

  2. No, serial.sys wouldn't create a PDO if you plug in non-enumerable serial
    device. In fact, serial.sys is not a bus driver and it doesn't enumerate any
    devices. That job is done by an upper device filter of serial.sys called
    serenum.sys. If you have non-enumerable serial device then the only option
    you have is to manually install the driver (root-enumerate) and have the
    driver open the com port in kernel-mode and talk to it. They are some PNP
    rules to be followed when you talk to a device in kernel-mode. Take a look
    at the src\general\toaster\toastmon sample.

    Eliyas Yakub [MSFT], Nov 19, 2003
    1. Advertisements

  3. peng

    Walter Oney Guest

    Also check out,
    which explains how to write drivers for PnP or non-PnP devices attached
    to a serial port.
    Walter Oney, Nov 19, 2003
  4. IIRC the standard print monitor allows serial-attached printers.
    So, white only the graphics driver for your printer. Then install it to
    "COM1", and the Windows spooler will write the stream generated by your
    graphics driver directly to your serial wire.
    Maxim S. Shatskih, Nov 19, 2003
  5. devices. That job is done by an upper device filter of serial.sys called
    Suggestion for MS:

    - maybe advance SerEnum to use the "default PnP ID" from the registry. If the
    device is attached but not PnP-capable - then SerEnum will enumerate this
    registry ID and create a PDO.

    Is it a bad idea?
    Maxim S. Shatskih, Nov 19, 2003
  6. peng

    peng Guest

    I did what you told,and progressed much.But I got a new problem after Getdiviceobjectpointer() ,IOAttachdevicetodevicestack(),the IRP_MJ_CREATE is sent,but while opening the serial port ,a nonpage error happened.
    what is the reason? I wrote a function called SerialOpen() to open the port.
    and also ,do I have to open a serial port in order to communicate with the serial device by serial port?
    This is what Walter Wony says:
    "The root enumerator acts as the bus driver for your device. The PnP Manager loads your driver and calls DriverEntry and AddDevice in the normal way for a WDM driver. In your StartDevice function, you would normally read the registry to get the name of the attachment port, and then you'd call IoGetDeviceObjectPointer to open a handle to SERIAL.SYS and to obtain a DEVICE_OBJECT pointer to which you can submit IRPs. < Thereafter, you send IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_DEVICE_CONTROL requests to SERIAL. > You use these requests to control the RS-232 signal lines and and to send and receive data from your widget."

    the words between <> confused me a little.I shall first open a serial port in order to communicate. Am I right?

    Also ,when is IRP_MJ_CREATE sent by IOManager?
    peng, Nov 20, 2003
    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.