/* Get job storage space */
if (!EnumJobsW(hPrinter,
0,
1, //NoJobs [in] The total number of print jobs to enumerate.
2, // Job Info level 2
NULL,
0,
(LPDWORD)&cByteNeeded,
(LPDWORD)&nReturned))
{
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
DebugPrint("Fail to enum print jobs!");//goto Fail;
}
/* get the list of jobs */
if (!EnumJobsW(hPrinter,
0,
1, //NoJobs [in] The total number of print jobs to enumerate.
2,
(LPBYTE)pJobStorage,
cByteNeeded,
(LPDWORD)&cByteUsed,
(LPDWORD)&nReturned))
{
DebugPrint("Fail to enum print jobs!");//goto Fail;
}
DebugPrint("%ws",L"调试取文件名:");
DebugPrint("pDocument = %ws",pJobStorage[0].pDocument);