Modified WinDDK Bitmap Driver DrvStartPage does not get invoked.


For the development of printer driver i took the base of the Bitmap driver provided with WinDDK sample codes .(WinDDK\7600.16385.1\src\print\oemdll\bitmap)

What i need to do is to just generate a .bmp file from the given printed file at a desired location (user should not be prompted to provide the output file name).

I have the logic to create the .bmp file at a defined location under DrvStartPage handler function.

So for this i just hooked callbacks INDEX_DrvStartPage to a custom handler function.
static const DRVFN s_aOemHookFuncs =
{ {INDEX_DrvStartPage, (PFN) DrvStartPage}, {INDEX_DrvEndDoc, (PFN)DrvEndDoc}

I build the project all’s good till here. I install the driver on LPT1 (not on FILE port as i dont want the user to be prompted for an output file path)

But if the driver is installed on LPT1 DrvStartPage does not get invoked (I could not see the OutputDebugString messages i wrote in DebugView) thus not generating the .bmp file at the location, but if i change the port to FILE then the driver works perfectly generating the debug messages and the output file.

I need to insall the printer on LPT1 and silently create the bmp file without knowing the user that it did create an image file.

Thus i was wondering why is this behavior ? Am i missing some understanding about something ?

Could anyone please guide me on this.