Hi all,
I’ve modified genprint print processor and installed it on winxp sp3 client. Modified genprint PP is simply editing postscript output, such as adding a bar-code to the lower right corner of the document. If I select a local printer then bar-code is shown at the print output correctly. But if i select a shared network printer then i just get unmodified output. The point is, sharing print server is also winxp and printer is using modified PP. So what am i missing from this setup. which print processors should be processing this job? At my scenario both client and print server machines have modified PPs. But i don’t get modified output.
Thanks
Hayati
Hi again,
I have a serious problem on using modified print processor(later may be called PP) with shared printers. I’m using latest WDK 7.1.0. I only modified genprint to change first character of the related buffer in raw output at file raw.cpp. Such as;
ReadPrinter(…&buffer…)
buffer[0] = ‘x’; // only this line is changed
WritePrinter(…&buffer…)
only shown line is added to sample code. And i installed modified print processor to winxp sp3 machine. Result was as expected. First character of generated file is changed to ‘x’. This means print processor is working current setup at least (current printed file, current windows configuration, and current print processor). I must mention that printer used is a network printer. And print out was generated with standard TCP/IP port. But i also tested the result with ‘print to file’ port. Result was the same. File’s first character was changed to ‘x’.
Assume that printer is locally connected to machine A and machine A shares the printer to machine B. (A is print server, B is client).
Although I can see that printer uses modified print processor from settings dialog at the client(B) i was unable to generate modified output. But if I add the same printer locally i could get modified output. So question becomes which print processor modifies the buffer. Then test steps applied as following:
-
Install modified print processor to both client and server: Result was same, no changes happened in the output.
-
Install modified print processor only to client not to server. Result: at this scenario shared printer’s print processor list does not contain our modified print processor. So result is as expected. No changes happened in the output.
Then I sniffed network over client and server. Unfortunately i was unable to detect any print processor name at the flow. But i notified that NT based operating systems may exchange print jobs in EMF format which can be detected from the network flow.
Another interesting observation is if I change printer port to ‘print to file’ then no data will be called from client through server. But the printer is located at server. So print processor of server is not called at all.
Anyway could anybody explain what is happening, which print processor is responsible to process print job. And why am i not be able to print with modified PP.
Best Regards
Hayati Gonultas
Hi to all again,
I discovered the problem. Docs says that:
EMF
Data type used between print clients running Windows XP Professional and print servers running Windows Server 2003. With an enhanced metafile (EMF), the Graphics Device Interface (GDI) releases console control after generating the EMF. The EMF data is then interpreted in the background on a spooler thread and sent to the printer driver. Splitting the rendering of a print job in this way is especially useful for very large documents because the application is not tied up for the entire rendering time.
Even thought your target output is set to raw (ex. postscript) spooler file is created as EMF. Then genprint (sample print processor from WDK) simple process EMF and generate output using EMF in assistance with GDI. As a result there is two way to modify the context of a print job before port monitor if printer is shared.
a) Add appropriate code into emf.
b) Do no spool files. This time spooler will also operate but spooler file will not be created. Directly write to printer option can be set at printer settings dialog.
As a result I’m writing code for both cases.
Thanks.
Hayati