Re: Print Processor: Determining Spool File Name (XP/2K)
From: Ashwin [MS] (ashwinn_at_online.microsoft.com)
Date: 02/19/04
- Next message: Calvin Guan: "Re: S3 QUERY IRP completion problem"
- Previous message: Ashwin [MS]: "Re: Stretching the unidriver output"
- In reply to: Jim Jacobson: "Print Processor: Determining Spool File Name (XP/2K)"
- Next in thread: Carey Gregory: "Re: Print Processor: Determining Spool File Name (XP/2K)"
- Reply: Carey Gregory: "Re: Print Processor: Determining Spool File Name (XP/2K)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Feb 2004 17:46:48 -0800
Your print processor architecture is broken because it relies so much on the
spool file name. There should be no necessity for the print processor to
have access to the spool file name. I strongly suggest that you consider
re-architecting your print processor to eliminate this tight coupling.
In any case, considering that you need a workaround for this issue now, you
can change the spool file naming mechanism on XP to revert to the W2K scheme
that is based on the job id. In order to do this, you need to change the
default spool directory to something other than the default. You can supply
any directory you want...it just can't be the default. The reg key to change
is HKLM\Software\Microsoft\Windows NT\CurrentVersion\Print\SpoolDirectory.
Hope this helps.
-- - Ashwin Microsoft Printing, Imaging and Fax Team This posting is provided "AS IS" with no warranties, and confers no rights. "Jim Jacobson" <anonymous@discussions.microsoft.com> wrote in message news:4EF9D6A1-4445-48AC-9DDF-36C4C0E44243@microsoft.com... > I have a print processor that worked great in Windows 2000, but broke in Windows XP, and I am trying to get it working. The print processor depends on knowing the name of the spool file that is created (I am using EMF, not raw), because I process the EMF data directly from the spool file. > > When I first wrote the print processor I saw the PRINTPROCESSOROPENDATA parameter of OpenPrintProcessor() and said, "Great! I'll use the pOutputFile value in that structure to get the file name." The problem is, it is never supplied. Anytime I checked the value in the structure that was pointed to by the input parameter, it was empty. > > In Windows 2000 (and NT), though, I noticed that the spool file (located in the spool file directory, which I can get from the registry) had the form XXXXX.spl where XXXXX is a zero padded number that always corresponded to the JobId, which I COULD get from PRINTPROCESSOROPENDATA. Obviously it was not a robust solution, but it was a solution that worked fine. > > So along comes Windows XP and the print processor broke, because XP doesn't use the same form for the spool file name. It uses FPXXXXX.spl, which is the same form with a prepended literal string "FP". I figured I could deal with that just fine in one print processor, by just looking for either the file with the FP in front or not. So I tried it, and to my dismay found out that the number XXXXX in Windows XP does not correspond to the JobId anymore! > > I thought perhaps I could use the spool file handle returned by GdiGetSpoolFileHandle() along with GetFileInformationByHandle() to find unique information about the file (the file index, creation date, etc.) and search for the matching file in the spool file directory. Unfortunately, the spool file handle is not a file handle. > > So, does anybody know a way I can reliably retrieve the spool file name from a print processor (preferably in OpenPrintProcessor) that will work for NT, 2000 and XP? > > And yes, I do need access to the actual spool file, or the whole architecture that this print processor is a part of breaks.
- Next message: Calvin Guan: "Re: S3 QUERY IRP completion problem"
- Previous message: Ashwin [MS]: "Re: Stretching the unidriver output"
- In reply to: Jim Jacobson: "Print Processor: Determining Spool File Name (XP/2K)"
- Next in thread: Carey Gregory: "Re: Print Processor: Determining Spool File Name (XP/2K)"
- Reply: Carey Gregory: "Re: Print Processor: Determining Spool File Name (XP/2K)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|