channels: Check return value of EnumPrinters
This commit is contained in:
parent
2fed8fb62e
commit
ecb4712a10
@ -1106,18 +1106,23 @@ UINT printer_DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
|
|||||||
{
|
{
|
||||||
WINPR_ASSERT(driver->EnumPrinters);
|
WINPR_ASSERT(driver->EnumPrinters);
|
||||||
rdpPrinter** printers = driver->EnumPrinters(driver);
|
rdpPrinter** printers = driver->EnumPrinters(driver);
|
||||||
rdpPrinter** current = printers;
|
if (printers)
|
||||||
|
|
||||||
for (i = 0; current[i]; i++)
|
|
||||||
{
|
{
|
||||||
rdpPrinter* printer = current[i];
|
for (rdpPrinter** current = printers; *current; ++current)
|
||||||
|
|
||||||
if ((error = printer_register(pEntryPoints, printer)))
|
|
||||||
{
|
{
|
||||||
WLog_ERR(TAG, "printer_register failed with error %" PRIu32 "!", error);
|
error = printer_register(pEntryPoints, *current);
|
||||||
break;
|
if (error)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "printer_register failed with error %" PRIu32 "!", error);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "Failed to enumerate printers!");
|
||||||
|
error = CHANNEL_RC_INITIALIZATION_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
WINPR_ASSERT(driver->ReleaseEnumPrinters);
|
WINPR_ASSERT(driver->ReleaseEnumPrinters);
|
||||||
driver->ReleaseEnumPrinters(printers);
|
driver->ReleaseEnumPrinters(printers);
|
||||||
|
Loading…
Reference in New Issue
Block a user