Hi,
I am writing the UI Plugin for the system driver for the 64 bit
operating system so that i could have watermark on the printed pages.
A printer UI-interface DLL's DrvDocumentEvent function can handle
certain events associated with printing a document. e.g
DOCUMENTEVENT_QUERYFILTER, DOCUMENTEVENT_ESCAPE,
DOCUMENTEVENT_STARTPAGE, DOCUMENTEVENT_ENDPAGE etc.
I have put the watermark rendering function on the
DOCUMENTEVENT_ENDPAGE event handler, which is the obvious choice.
HRESULT DocumentEvent(HANDLE hPrinter,HDC hDC,INT iEsc,ULONG cbIn,PVOID
pvIn,ULONG cbOut,PVOID pvOut,PINT piResult)
{
switch (iEsc)
{
case DOCUMENTEVENT_QUERYFILTER:{break;}
case DOCUMENTEVENT_ESCAPE:{break;}
case DOCUMENTEVENT_FIRST:{break;}
case DOCUMENTEVENT_ENDPAGE: {RenderWatermark(); break;}
return S_OK
}
The funtion DocumentEvent()( function in the UI-Plugin) is getting the
events to be handled from the DrvDocumentEvent() function of
winspool.drv
On the 32 bit operating system following sequence of events are called:
DOCUMENTEVENT_QUERYFILTER
DOCUMENTEVENT_FIRST
DOCUMENTEVENT_ESCAPE
DOCUMENTEVENT_ESCAPE
DOCUMENTEVENT_ESCAPE
DOCUMENTEVENT_ESCAPE
DOCUMENTEVENT_ENDPAGE
On the 64 bit system in am getting the events in the sequence:
DOCUMENTEVENT_QUERYFILTER
DOCUMENTEVENT_FIRST
DOCUMENTEVENT_QUERYFILTER
DOCUMENTEVENT_FIRST
since no DOCUMENTEVENT_ENDPAGE is called, the watermark is not printed.
My question is, why DOCUMENTEVENT_ESCAPE and DOCUMENTEVENT_ENDPAGE
events are not called on the 64bit system?
Who is invoking these events in winspool.drv? My guess is SPOOLSS.DLL.
Regards,
Saurabh Aggrawal