Legacy serial mouse for Win2000

Discussion in 'Windows Vista Drivers' started by Reilly, Nov 4, 2004.

  1. Reilly

    Reilly Guest

    I have seriously managed to confuse myself. I have what I think is a
    simple task. I have a non-PnP serial mouse, which is NOT supported by
    serenum. All I want to do is install it on COM1.

    Reading this, and the OSR, groups, I have not been able to get my head
    around the right approach. I have successfully written 3 PCI WDM
    drivers. I have spent some time with Toaster and Serenum.

    Since my mouse does NOT respond to the serial PnP protocol, am I right
    that I cannot use serenum or sermouse?

    My mouse won't return the 'M' or 'B' when sermouse asks for; does that
    mean that sermouse won't work as-is for my device?

    Other than the durn 'M' stuff, shouldn't sermouse work, assuming that
    my mouse behaves "like" a mouse? If I could modify sermouse to create
    MySermouse.sys, could I somehow attach MySermouse.sys to the serial
    port device stack and then be in business?

    I have read Mr Oney's "Driver's for Serial-Attached Devices". I keep
    trapping myself in thinking that my situation doesn't fit because my
    device is just a mouse that won't PnP, and not some new thing. I keep
    waffling on whether I should create a root-enumerated driver that
    attaches to the serial.sys device stack, or a root-enumerated driver
    that somehow opens and uses the serial port, or a bus driver that
    creates some sort of PDO that is associated with my mouse and its
    serial port some way.

    I must say, this has forced me to look more closely at the W2k driver
    architecture. The OSR class, Mr Oney's book, the DDK docs, and the
    web have provided me with MUCH entertainment. I, however, have
    managed to confuse myself...

    Thanks for any advice.

    John Reilly.
    Northrop Grumman/Sperry Marine.
    Reilly, Nov 4, 2004
    1. Advertisements

  2. Reilly

    Ray Trent Guest

    The fundamental problem is that without any enumeration at all (even
    including the "M" response), it's really hard for the PnP system to know
    what driver to load on what port.

    I would suggest that rather than trying to muck with sermouse, it would
    be easier to write a user-mode program that just opens that COM port,
    reads out the mouse data, and calls SendInput. This will get somewhat
    more complicated if you care about supporting logon and
    fast-user-switching, though. In that case, it's probably a toss-up
    between modding the sermouse sources and writing your own service.

    If you decide to mod sermouse, you'll probably want to have it
    auto-start and connect to serial manually. There might be a way to
    "install" statically on a non-enumerated serial port, but I don't happen
    to know what that would be.

    Of course, much depends on *how* similar your device is to a serial
    mouse. Does it come up at 1200 baud? Some mouse drivers (like ours)
    switch to a different baud rate after configuration to get higher report
    rates. I don't happen to remember whether sermouse is one of those.
    Ray Trent, Nov 4, 2004
    1. Advertisements

  3. Reilly

    Dave August Guest


    I hate to sound like I'm being a smart alec but geez, unless this thing is
    hardwired intot he Space Shuttle or TSO'd in an F-16 wouldn't it just be
    cheeper and easier to replace the damn things... mice at the OEM level can
    be had in quantity for under $5

    Dave (yeah I know )...
    Dave August, Nov 4, 2004
  4. sermouse requires enumeration b/c it relies on its PDO to be the port it is
    attached to. sermouse won't work even if that weren't the case b/c it
    expects the M back. oney's sample is correct, you should create root
    enumerated device and open the serial port. attaching to the serial port is
    not the way to go.

    Doron Holan [MS], Nov 5, 2004
  5. Reilly

    Reilly Guest


    Well, I didn't tell you the WHOLE sordid story, I just gave you enough
    info to explain my problem. I have to use this legacy device. **I**
    think it would be easier and cheaper to buy a replacement. But my
    company is paying me $$ to play with drivers. Is this a great
    country, or what?

    Reilly, Nov 5, 2004
  6. Reilly

    Reilly Guest


    Thanks. This seems like a lot of work for a simple thing.

    Two final questions. First, can you briefly explain why attaching to
    the serial port is not the way to go? Second, Mr Oney's sample
    concludes by telling me to "call IoGetDeviceObjectPointer for PortName
    from hardware key" to get my serial port reference. Can you elaborate
    just a bit? Who's hardware key?

    Thanks again.
    Reilly, Nov 5, 2004
  7. the HW key of the port, not your HW key. attaching to the stack buys you
    nothing and is not supported once the port has been started by pnp. you
    also have to create another device object to attach to the stack, further
    complicating your driver. what if the mouse is unplugged? will then
    detach? much easier to just close the port.


    Please do not send e-mail directly to this alias. this alias is for
    newsgroup purposes only.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Doron Holan [MS], Nov 5, 2004
    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.