Hello.
I am writing a program that enumerates all local ant network printers.
I want to check if the printer is ready / busy / error and therefore need to
check
PRINTER_INFO_2::Status. I enumerate the printers as follows:

DWORD dwFlags = PRINTER_ENUM_CONNECTIONS | PRINTER_ENUM_LOCAL ;
DWORD dwLevel = 2 ;
DWORD cbBuf ;
DWORD pcReturned ;

LPPRINTER_INFO_2 pPrinterEnum = NULL ;

// get needed size of PRINTER_INFO_2-struct and alloc memory:

::EnumPrinters( dwFlags, NULL, dwLevel, NULL, 0, &cbBuf, &pcReturned) ;
pPrinterEnum = (LPPRINTER_INFO_2)LocalAlloc(LPTR, cbBuf + 4) ;

if (!pPrinterEnum)
TRACE(_T("Error %1d\n"), GetLastError()) ;

if ( !::EnumPrinters(dwFlags, NULL, dwLevel, (LPBYTE)pPrinterEnum, cbBuf,
&cbBuf, &pcReturned) )
TRACE(_T("Error %1d\n"), GetLastError()) ;

now it seems as if everything worked properly. most PRINTER_INFO_2 members
get the correct
value (e.g. pPrinterName, pDriverName, pDatatype, Attributes, Priority) .
But the members Start/UntilTime, Status, cJobs and AveragePPM are always
ZERO.
Has anyone encountered the same or a similar problem and knows a solution to
it?
or, if not, who knows another way to enumerate all local and network
printers and their states (in a mfc-App)?