From d389f471b6c249b64c5f580273ce9843d70ecfd1 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 18 Nov 2005 12:05:05 +0000 Subject: [PATCH] If SANE returns empty device list treat it as an error. --- dlls/twain/dsm_ctrl.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/twain/dsm_ctrl.c b/dlls/twain/dsm_ctrl.c index d4204b52c6..f744939d26 100644 --- a/dlls/twain/dsm_ctrl.c +++ b/dlls/twain/dsm_ctrl.c @@ -146,16 +146,24 @@ TW_UINT16 TWAIN_IdentityGetFirst (pTW_IDENTITY pOrigin, TW_MEMREF pData) { if (device_list[0]) { + TRACE("got: %s, %s, %s\n", device_list[0]->name, device_list[0]->vendor, device_list[0]->model); pSourceIdentity->Id = DSM_sourceId ++; strcpy (pSourceIdentity->ProductName, device_list[0]->name); strcpy (pSourceIdentity->Manufacturer, device_list[0]->vendor); strcpy (pSourceIdentity->ProductFamily, device_list[0]->model); pSourceIdentity->ProtocolMajor = TWON_PROTOCOLMAJOR; pSourceIdentity->ProtocolMinor = TWON_PROTOCOLMINOR; + + DSM_currentDevice = 1; + twRC = TWRC_SUCCESS; + DSM_twCC = TWCC_SUCCESS; + } + else + { + TRACE("got empty device list\n"); + twRC = TWRC_FAILURE; + DSM_twCC = TWCC_NODS; } - DSM_currentDevice = 1; - twRC = TWRC_SUCCESS; - DSM_twCC = TWCC_SUCCESS; } else if (status == SANE_STATUS_NO_MEM) {