From: Bernd Herd codeberg@herdsoft.com
--- dlls/sane.ds/unixlib.c | 16 +++++++++++++--- dlls/twain_32/dsm_ctrl.c | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/dlls/sane.ds/unixlib.c b/dlls/sane.ds/unixlib.c index 3ced42df1fb..861e243a215 100644 --- a/dlls/sane.ds/unixlib.c +++ b/dlls/sane.ds/unixlib.c @@ -266,10 +266,20 @@ static NTSTATUS open_ds( void *args ) return STATUS_DEVICE_NOT_CONNECTED; } status = sane_open( device_list[i]->name, &device_handle ); - if (status == SANE_STATUS_GOOD) return STATUS_SUCCESS; + if (status != SANE_STATUS_GOOD) { + ERR("sane_open(%s): %s\n", device_list[i]->name, sane_strstatus (status)); + return STATUS_DEVICE_NOT_CONNECTED; + } + + /* return the Identity of the device opened to the caller */ + id->ProtocolMajor = TWON_PROTOCOLMAJOR; + id->ProtocolMinor = TWON_PROTOCOLMINOR; + id->SupportedGroups = DG_CONTROL | DG_IMAGE | DF_DS2; + copy_sane_short_name(device_list[i]->name, id->ProductName, sizeof(id->ProductName) - 1); + lstrcpynA (id->Manufacturer, device_list[i]->vendor, sizeof(id->Manufacturer) - 1); + lstrcpynA (id->ProductFamily, device_list[i]->model, sizeof(id->ProductFamily) - 1);
- ERR("sane_open(%s): %s\n", device_list[i]->name, sane_strstatus (status)); - return STATUS_DEVICE_NOT_CONNECTED; + return STATUS_SUCCESS; }
static NTSTATUS close_ds( void *args ) diff --git a/dlls/twain_32/dsm_ctrl.c b/dlls/twain_32/dsm_ctrl.c index b99ed3dabf2..89e788f979d 100644 --- a/dlls/twain_32/dsm_ctrl.c +++ b/dlls/twain_32/dsm_ctrl.c @@ -162,7 +162,9 @@ static void PASCAL _DSM_MemUnlock(TW_HANDLE _handle) GlobalUnlock(_handle); }
-/// Structure with pointers being transfered in DG_CONTROL / DAT_ENTRYPOINT / MSG_SET to the data source +/* Structure with pointers being transfered in + * DG_CONTROL / DAT_ENTRYPOINT / MSG_SET to the data source + */ static const TW_ENTRYPOINT _entrypoints = { .Size = sizeof(TW_ENTRYPOINT), .DSM_Entry = DSM_Entry, @@ -400,7 +402,7 @@ TW_UINT16 TWAIN_OpenDS (pTW_IDENTITY pOrigin, TW_MEMREF pData) /* Tell the source our entry points */ if (pIdentity->SupportedGroups & DF_DS2) { /* This makes sure that the DS knows the current address of our DSM_Entry - * function so there is no risc that it is using a stale copy. + * function so there is no risk that it is using a stale copy. * The other entry points are also set for formal reasons, * but are currently not used. */