[LOCALSPL]
authorColin Finck <colin@reactos.org>
Wed, 22 Jul 2015 09:21:20 +0000 (09:21 +0000)
committerColin Finck <colin@reactos.org>
Wed, 22 Jul 2015 09:21:20 +0000 (09:21 +0000)
Stalling execution of the Print Processor under Windows reveals that the status flag JOB_STATUS_PRINTING is only set right before calling PrintDocumentOnPrintProcessor.

svn path=/branches/colins-printing-for-freedom/; revision=68549

reactos/win32ss/printing/providers/localspl/jobs.c
reactos/win32ss/printing/providers/localspl/printingthread.c

index facf298..2479b77 100644 (file)
@@ -1155,9 +1155,8 @@ LocalScheduleJob(HANDLE hPrinter, DWORD dwJobID)
         goto Cleanup;
     }
 
-    // Switch from spooling to printing.
+    // Spooling is finished at this point.
     pJob->dwStatus &= ~JOB_STATUS_SPOOLING;
-    pJob->dwStatus |= JOB_STATUS_PRINTING;
 
     // Write the job data into the shadow file.
     wcscpy(wcsrchr(wszFullPath, L'.'), L".SHD");
index 7771d73..68ec46d 100644 (file)
@@ -74,6 +74,9 @@ PrintingThreadProc(PLOCAL_JOB pJob)
     CopyMemory(&pwszPrinterAndJob[cchPrinterName], wszJobAppendix, cchJobAppendix * sizeof(WCHAR));
     _ultow(OpenData.JobId, &pwszPrinterAndJob[cchPrinterName + cchJobAppendix], 10);
 
+    // Printing starts here.
+    pJob->dwStatus |= JOB_STATUS_PRINTING;
+
     // Print the document.
     // Note that pJob is freed after this function, so we may not access it anymore.
     if (!pPrintProcessor->pfnPrintDocumentOnPrintProcessor(hPrintProcessor, pwszPrinterAndJob))