Porting Win95 printer driver & port monitor to NT 4.0

Porting Win95 printer driver & port monitor to NT 4.0

Post by Scott Hil » Tue, 03 Nov 1998 04:00:00



Hi all,

        I've written a Windows 95 printer driver, port monitor and VxD to drive a
card printer. Now, the printer uses a slightly odd communication method -
it uses a combination of a COM port and direct I/O mapped port I/O, so
under the approach I followed under win95 was as below :

        1. Created minidriver with unitool.
        2. Hooked into STARTDOC, NEXTBAND, ENDDOC and ABORTDOC.
        3. Wrote port monitor & VxD to handle communication COM port and I/O
ports.

        I hooked into STARTDOC, NEXTBAND, etc because I needed to do some
pre-processing (convert to CMYK, dithering and so on) on the image data.

        Now I need to write an NT version of the drivers and I'm a little unsure
as to how to proceed, well, from the relevant section in NT DDK Docs I've
come up with the following 2 possibilities :

        1. Write FULL driver and port monitor (I'd rather not).
        2. Create minidriver, using RasDD, and write a port monitor.

        ATM, option 2 seems the best, but there's a few things I'm not sure about:

        1. Is CBFilterGraphics the only way I can hook into the minidriver ?
        2. Is CBFilterGraphics described in more detail anywhere (I need to know
things like how much of the image will lpBuf point to when CBFilterGraphics
is called (do I get bands or the full image) and exactly what should this
function actually do (do I need to copy the block of memory before changing
it, etc, etc)) ?
        3. Can I just use the port monitor from my '95 driver ?
        4. Where, if needed, can I find more info on NT port monitor development ?
        5. Is there a better source of documentation than the DDK Docs ?

TIA,
--
Scott Hill

Software Engineer (and all round nice guy)
Author of Pandora's Box
Company homepage : http://www.ddlinks.demon.co.uk

"The best trick the devil ever pulled was convincing people he didn't
exist..."
                                                                - Verbal Kint.

"the Internet is here so we can waste time talking about nothing in
 particular when we should be working" - Marcus Hill.

 
 
 

1. How do I use memory mapped I/O ports from within a printer port monitor?

Hi all,

        Subject says almost all. Basically, I need to be able to write to and read
from memory-mapped I/O ports from within my Win95 printer port monitor dll.
Previously I had all the comms for my driver actually within the 16-bit
driver code and I was using _inp, _outp, etc. to talk to the I/O port and
that worked perfectly. Now that I've moved all the comms, in to a 32-bit
port monitor dll, it's suddenly stopped working ! I haven't changed
anything within that part of the code but it appears that either _inp or
_outp or, more likely, both aren't working. So, can I use _inp, etc, from
within a win95 printer port monitor and if not, how can I talk to the I/O
ports ?

--
Scott Hill

Software Engineer (and all round nice guy)
Company homepage : http://www.ddlinks.demon.co.uk

"The best trick the devil ever pulled was convincing people he didn't
exist..."
                                                                - Verbal Kint.

"the Internet is here so we can waste time talking about nothing in
 particular when we should be working" - Marcus Hill.

2. MSDN & Vstudio 6.0

3. WinNT 4.0 printer port monitor installation

4. Backup Subsystem

5. Problem reading Com port in NT 4.0 when port in use by another application

6. Connecting to ethernet

7. Monitor a printer port under win95.

8. Help with Orphans

9. Q: How to delete a printer driver / port monitor completly?

10. Windows NT Printer Port Monitor (lpr)

11. Getting true printer status (Print Monitor and Port Monitor)

12. Getting printer ports and monitor from a printer name.

13. Problem porting NT3.1 driver to NT 4.0