0

Finally, I managed to build XPSDrv Sample project successfully . But still there is a problem . I need to execute a function ( to start an exe file ) after the xps file has been sent to the printer (in my case to local port). So , where and how can I add the function ?

And regarding the filters , how would I know the sequence in which the filters executed .

I really need a help in this matter because I am a beginner in Windows Driver Development , specially in Printer Drivers ...

Any Idea is highly appreciated.

Thanks in Advance

1 Answers1

0

Which filters are included, and the order in which they execute, is controlled by the PipelineConfig.xml.

I'm not sure that launching an external executable after the document has cleared the pipeline is a particularly good idea, but if you must do so, you will need to add that functionality to the last filter in the pipeline.

Jon
  • 3,065
  • 1
  • 19
  • 29
  • thank you very much for your answer , 1- why would be executing of an external exe file is a bad idea ? 2- this is the sequence of filters in PipelineConfig.xml file : – Nael Al Zuhairi Dec 01 '18 at 21:24
  • this is a link to the file in Githab: https://github.com/Microsoft/Windows-driver-samples/blob/master/print/XPSDrvSmpl/install/xdsmpl-PipelineConfig.xml – Nael Al Zuhairi Dec 01 '18 at 21:26
  • From [msdn](https://learn.microsoft.com/en-us/windows-hardware/drivers/print/implementing-xps-filters) **Filters should not create separate processes or threads.** This is at least partly due to the fact that the print driver does not run as the logged in user. – Jon Dec 03 '18 at 03:26
  • Thanks again for the answer , and sorry for keeping disturbing you . before I mark it as an answer. If I have to open another process ( execute external exe file ) where would be then the best place for that task and how ? thanks – Nael Al Zuhairi Dec 03 '18 at 17:40
  • It really depends on what that new process is doing. – Jon Dec 03 '18 at 18:30
  • It is just an execution for an external exe file – Nael Al Zuhairi Dec 03 '18 at 18:38
  • @NaelAlZuhairi: Have you figured this out? Would you be intereseted in sharing some knowledge with me about xpsdrv? What is the entry point and where did you place the cdoe for exe. I am given this project with no idea of driver development. https://stackoverflow.com/questions/64757588/ibm-hp5si-print-stream-to-xps-print-driver – user575219 Nov 09 '20 at 20:54