Use RegQueryInfoKey to count number of printers.

This commit is contained in:
Huw D M Davies 1999-11-28 19:47:58 +00:00 committed by Alexandre Julliard
parent 8354d16897
commit 6d149d85d8
1 changed files with 6 additions and 3 deletions

View File

@ -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) {