Skip to content
Snippets Groups Projects
Commit 6d149d85 authored by Huw D. M. Davies's avatar Huw D. M. Davies Committed by Alexandre Julliard
Browse files

Use RegQueryInfoKey to count number of printers.

parent 8354d168
No related branches found
No related tags found
No related merge requests found
......@@ -1034,9 +1034,12 @@ BOOL WINAPI EnumPrintersA(
return FALSE;
}
while(RegEnumKeyA(hkeyPrinters, number, NULL, 0) == ERROR_SUCCESS)
number++;
if(RegQueryInfoKeyA(hkeyPrinters, NULL, NULL, NULL, &number, NULL, NULL,
NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) {
RegCloseKey(hkeyPrinters);
ERR("Can't query Printers key\n");
return FALSE;
}
TRACE("Found %ld printers\n", number);
switch(dwLevel) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment