locked
PrintProcessor crashed in EnumPrinters() function in Windows 7 RRS feed

  • Question

  • Hello,


    Happy new year! I hope someone can help us. We do have since over 10 years a small application running in the more or less standard windows genprint prinprocessor, which is delivered with the DDK:

     

    But in   Windows 7, and most possibly with Windows 2008 R2, the windows spooler system crashes while processing a print job in the function: EnumPrinters. To be more precise, the job is sent to the nirvana and the queue seem 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 windows 7 crash. Our first log file entry is there, 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 Windows 7 provided driver.

     

    What we 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 us:

     

    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\Thomas7

    Computer:      WIN-6NI37C1A22M

    Description:

    The document Test Page, owned by Thomas7, 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>Thomas7</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>

     

    Best regards
    Thomas

    Wednesday, January 6, 2010 7:43 AM

Answers

  • Hi Thomas,

     

    Regarding this function, I would like to share the following with you:

     

    EnumPrinters Function

     

    It appears that this is a coding and developing related issue, it is recommended that you go to our MSDN forum for help:

     

    MSDN forum

     

    Thanks. Hope the issue will be resolved soon!


    Nicholas Li - MSFT
    • Marked as answer by Nicholas Li Monday, January 25, 2010 6:09 AM
    Thursday, January 7, 2010 7:39 AM