winspool.drv: Check return value of EnumPrintersA.

This commit is contained in:
Marcus Meissner 2010-10-24 11:09:42 +01:00 committed by Alexandre Julliard
parent e2eb5e2348
commit c7f158824f
1 changed files with 1 additions and 2 deletions

View File

@ -964,8 +964,7 @@ void WINSPOOL_LoadSystemPrinters(void)
printers AddPrinter takes a while. So we'll tag all printers that
were automatically added last time around, if they still exist
we'll leave them be otherwise we'll delete them. */
EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, &needed, &num);
if(needed) {
if (EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, &needed, &num) && needed) {
PRINTER_INFO_5A* pi = HeapAlloc(GetProcessHeap(), 0, needed);
if(EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, (LPBYTE)pi, needed, &needed, &num)) {
for(i = 0; i < num; i++) {