From: Stefan on
Hi everyone,

our small application which is a slightly modified Windows GENPRINT print
processor devlivered with the DDK (7600.16385.0 is currently used) works
since many years starting from XP, Vista, 2003, 2008 (either 32 and 64 bit).

But in Win7 (and most likely also Win2008 R2), the windows spooler system
crashes (PrintIsolationHost, see below for more details explanation) while
processing a print job in the function: EnumPrinters. To be more precise,
the job is sent to "nowhere" and the queue seems to be ready for the next
job.

For test purposes we downsized to the original genprint from the DDK. In the
file raw.cpp we added just one more function to write a debug file, which
works perfectly.


Then right at the beginning of the function PrintRawJob() a the simple
EnumPrinters() call for get back the needed amount of output bytes for
calling the function with PRINTER_INFO_2 is added like this:

....

DocInfo.pDatatype = pData->pDatatype; /* Document data type */
{ /* new for testing */
DWORD chNeeded=0, chReturned=0;
WriteAppendDebugFile("Debug in file before EnumPrinters \n");
EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &chNeeded,
&chReturned);
WriteAppendDebugFile("Debug in file after EnumPrinters \n");
} /* new for testing */



/** Let the printer know we are starting a new document **/

if (!StartDocPrinter(pData->hPrinter, 1, (LPBYTE)&DocInfo)) {

....


The result is unfortunately a crash. I posted th first log file entry, the
second never shows up. As only one more additional line (EumFunction) was
added, the trouble maker must be it. Of course we used a standard Win7 inbox
printer driver.

What I try to find out with EnumPrinters is, which locally installed queue
does use which print processor. Is there another reliable way to get this
information, which runs in a print processor without using the EnumPrinters
Function?

Thank you so much for helping me!



The two error messages in the windows log are:

Log Name: Microsoft-Windows-PrintService/Admin

Source: Microsoft-Windows-PrintService

Date: 05.01.2010 12:41:41

Event ID: 372

Task Category: Printing a document

Level: Error

Keywords: Classic Spooler Event,Document Print Job

User: WIN-6NI37C1A22M\Stefan7

Computer: WIN-6NI37C1A22M

Description:

The document Test Page, owned by Stefan7, failed to print on printer HP
LaserJet 5200 Series PCL 5. Try to print the document again, or restart the
print spooler.

Data type: RAW. Size of the spool file in bytes: 96647. Number of bytes
printed: 0. Total number of pages in the document: 0. Number of pages
printed: 0. Client computer: \\WIN-6NI37C1A22M. Win32 error code returned by
the print processor: 1726. The remote procedure call failed.



Event Xml:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

<System>

<Provider Name="Microsoft-Windows-PrintService"
Guid="{747EF6FD-E535-4D16-B510-42C90F6873A1}" />

<EventID>372</EventID>

<Version>0</Version>

<Level>2</Level>

<Task>26</Task>

<Opcode>12</Opcode>

<Keywords>0x8000000000000840</Keywords>

<TimeCreated SystemTime="2010-01-05T11:41:41.980468700Z" />

<EventRecordID>72</EventRecordID>

<Correlation />

<Execution ProcessID="1756" ThreadID="1528" />

<Channel>Microsoft-Windows-PrintService/Admin</Channel>

<Computer>WIN-6NI37C1A22M</Computer>

<Security UserID="S-1-5-21-1894841640-2252905872-4102573372-1000" />

</System>

<UserData>

<PrintOnProcFailedEd
xmlns:auto-ns3="http://schemas.microsoft.com/win/2004/08/events"
xmlns="http://manifests.microsoft.com/win/2005/08/windows/printing/spooler/core/events">

<Param1>Test Page</Param1>

<Param2>Stefan7</Param2>

<Param3>HP LaserJet 5200 Series PCL 5</Param3>

<Param4>RAW</Param4>

<Param5>96647</Param5>

<Param6>0</Param6>

<Param7>0</Param7>

<Param8>0</Param8>

<Param9>\\WIN-6NI37C1A22M</Param9>

<Param10>1726</Param10>

<Param11>The remote procedure call failed.

</Param11>

</PrintOnProcFailedEd>

</UserData>

</Event>









Log Name: Application

Source: Application Error

Date: 05.01.2010 12:41:41

Event ID: 1000

Task Category: (100)

Level: Error

Keywords: Classic

User: N/A

Computer: WIN-6NI37C1A22M

Description:

Faulting application name: PrintIsolationHost.exe, version: 6.1.7600.16385,
time stamp: 0x4a5bcebc

Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp:
0x4a5bdaae

Exception code: 0x80000003

Fault offset: 0x0003194b

Faulting process id: 0xbc4

Faulting application start time: 0x01ca8dfc0c661a3d

Faulting application path: C:\Windows\system32\PrintIsolationHost.exe

Faulting module path: C:\Windows\system32\KERNELBASE.dll

Report Id: 4a4719d3-f9ef-11de-a0a1-000c29d3b313

Event Xml:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

<System>

<Provider Name="Application Error" />

<EventID Qualifiers="0">1000</EventID>

<Level>2</Level>

<Task>100</Task>

<Keywords>0x80000000000000</Keywords>

<TimeCreated SystemTime="2010-01-05T11:41:41.000000000Z" />

<EventRecordID>1807</EventRecordID>

<Channel>Application</Channel>

<Computer>WIN-6NI37C1A22M</Computer>

<Security />

</System>

<EventData>

<Data>PrintIsolationHost.exe</Data>

<Data>6.1.7600.16385</Data>

<Data>4a5bcebc</Data>

<Data>KERNELBASE.dll</Data>

<Data>6.1.7600.16385</Data>

<Data>4a5bdaae</Data>

<Data>80000003</Data>

<Data>0003194b</Data>

<Data>bc4</Data>

<Data>01ca8dfc0c661a3d</Data>

<Data>C:\Windows\system32\PrintIsolationHost.exe</Data>

<Data>C:\Windows\system32\KERNELBASE.dll</Data>

<Data>4a4719d3-f9ef-11de-a0a1-000c29d3b313</Data>

</EventData>

</Event>