13 const DWORD cchMaxJobIdDigits = 5;
14 const WCHAR wszJobAppendix[] =
L", Job ";
16 const WCHAR wszPortAppendix[] =
L", Port";
28 TRACE(
"PrintingThreadProc(%p)\n", pJob);
37 ERR(
"DllAllocSplMem failed!\n");
42 CopyMemory(&pwszPrinterPort[cchPortName], wszPortAppendix,
sizeof(wszPortAppendix));
63 ERR(
"OpenPrintProcessor failed with error %lu!\n", dwErrorCode);
72 pwszPrinterAndJob =
DllAllocSplMem((cchPrinterName + cchJobAppendix + cchMaxJobIdDigits + 1) *
sizeof(
WCHAR));
73 if (!pwszPrinterAndJob)
76 ERR(
"DllAllocSplMem failed!\n");
81 CopyMemory(&pwszPrinterAndJob[cchPrinterName], wszJobAppendix, cchJobAppendix *
sizeof(
WCHAR));
82 _ultow(OpenData.
JobId, &pwszPrinterAndJob[cchPrinterName + cchJobAppendix], 10);
92 ERR(
"PrintDocumentOnPrintProcessor failed with error %lu!\n", dwErrorCode);
98 hPrintProcessor =
NULL;
105 ERR(
"DllAllocSplMem failed!\n");
122 if (pwszPrinterAndJob)
#define ERROR_NOT_ENOUGH_MEMORY
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
static const WCHAR Cleanup[]
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
DWORD WINAPI PrintingThreadProc(PLOCAL_JOB pJob)
DWORD GetJobFilePath(PCWSTR pwszExtension, DWORD dwJobID, PWSTR pwszOutput)
PLOCAL_PRINT_PROCESSOR pPrintProcessor
PWSTR pwszPrintProcessorParameters
PLOCAL_JOB pNextJobToProcess
PPrintDocumentOnPrintProcessor pfnPrintDocumentOnPrintProcessor
PClosePrintProcessor pfnClosePrintProcessor
POpenPrintProcessor pfnOpenPrintProcessor
BOOL WINAPI DllFreeSplMem(PVOID pMem)
PVOID WINAPI DllAllocSplMem(DWORD dwBytes)
DWORD WINAPI GetLastError(void)
#define JOB_STATUS_PRINTING