Commit c7f15882 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

winspool.drv: Check return value of EnumPrintersA.

parent e2eb5e23
...@@ -964,8 +964,7 @@ void WINSPOOL_LoadSystemPrinters(void) ...@@ -964,8 +964,7 @@ void WINSPOOL_LoadSystemPrinters(void)
printers AddPrinter takes a while. So we'll tag all printers that printers AddPrinter takes a while. So we'll tag all printers that
were automatically added last time around, if they still exist were automatically added last time around, if they still exist
we'll leave them be otherwise we'll delete them. */ we'll leave them be otherwise we'll delete them. */
EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, &needed, &num); if (EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, &needed, &num) && needed) {
if(needed) {
PRINTER_INFO_5A* pi = HeapAlloc(GetProcessHeap(), 0, needed); PRINTER_INFO_5A* pi = HeapAlloc(GetProcessHeap(), 0, needed);
if(EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, (LPBYTE)pi, needed, &needed, &num)) { if(EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, (LPBYTE)pi, needed, &needed, &num)) {
for(i = 0; i < num; i++) { for(i = 0; i < num; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment