64-Bit Windows applications typically expect the Twain Data Source manager to be named twaindsm.dll.
Send the DG_CONTROL/DAT_ENTRYPOINT/MSG_SET before DG_CONTROL/DAT_IDENTITY/MSG_OPENDS so sane.ds does not need to know the module name to find the DSM entry point.
An explanation for the request to offer the name twaindsm.dll for 64-Bit windows is offered here by the TWAIN organization:
https://github.com/twain/twain-dsm/blob/master/TWAIN_DSM/src/readme.doc
They cannot update the twain_32.dll installed and maintained by Microsoft, so they choose the new name twaindsm.dll instead. This name is also used at least by Irfanview and oder versions oder LibreOffice (Newer Libreoffice version start a 32-Bit process for 32-Bit TWAIN usage).
This Merge request also changes the twain_32.dll so that it send it's entry points earlier, before opening the data source. This is the same behaviour as the twaindsm.dll from the TWAIN organization from [https://github.com/twain/twain-dsm/](https://github.com/twain/twain-dsm/blo…
Otherwise sane.ds would in MSG_OPENDS try to find the DSM entry point based on the module-name "twain_32" in sane_main.c:60:
```
if (SANE_dsmentry == NULL)
{
HMODULE moddsm = GetModuleHandleW(L"twain_32");
if (moddsm)
SANE_dsmentry = (void*)GetProcAddress(moddsm, "DSM_Entry");
if (!SANE_dsmentry)
{
ERR("can't find DSM entry point\n");
return TWRC_FAILURE;
}
}
```
--
v4: dlls/twain_32, dlls/twaindsm: Build Twain DSM as twaindsm.dll on 64-Bit build
https://gitlab.winehq.org/wine/wine/-/merge_requests/9519
Control display of progress dialog with CAP_INDICATORS.
Use PeekMessage/DispatchMessage loop while scanning. Display some informations on scan job in progress dialog.
If ADF is enabled and not filled with paper, display an error message to the user and allow a retry.
Also displays paper jammed message and cover open message.
Added german translation for the new error messages and progress dialog controls.
{width=389 height=320}
Error message display are controlled with CAP_INDICATORS if Data Source UI is not shown.
--
v5: dlls/sane.ds: Display message if ADF is empty in ADF scan
dlls/sane.ds: Added cancel button and progress bar to progress dialog
https://gitlab.winehq.org/wine/wine/-/merge_requests/9530
In Twain the capability ICAP_BITDEPTH defines the number of bits to transfer per pixel during a scan. So for an RGB image with 8 bit per color channel, ICAP_BITDEPTH is 24.
In Sane the depth is defined as the number of bits per color channel, so for an RGB image with 8 bit per color channel, depth is 8.
See Page 10-132 (PDF Page 550) if the Twain 2.5 Spec. Obviously older spec versions where not as exact, so there were misunderstandings.
The existing code to handle ICAP_BITDEPTH did not consider this difference and returned the sane depth value.
This merge request fixes this and adds the ability to set the depth to 16 bit per color channel for those sane backends that support the "depth" option.
--
v2: dlls/sane.ds: Refuse native transfer mode with depth 16 bit
dlls/sane.ds: Fix ICAP_BITDEPTH semantics, allow setting it
https://gitlab.winehq.org/wine/wine/-/merge_requests/9555