From: Dmitry Timoshkov <dmitry@baikal.ru> Page 739 of the TWAIN Specification Version 2.4 https://github.com/twain/twain-specification/blob/master/versions/2.4/TWAIN-... describes the LOOP as 4. Application issues DAT_IMAGENATIVEXFER to get image and goes to state 7. 5. Application issues MSG_ENDXFER to return to state 6, and it displays the image. Then if it wants the next preview image, examines pTW_PENDINGXFERS->Count to verify that there is another image, and it goes to LOOP. Source, upon receiving the MSG_ENDXFER message, takes the next picture and returns -1 in the pTW_PENDINGXFERS->Count. END LOOP 6. If the application wants to end preview mode, it issues DAT_PENDINGXFERS / MSG_RESET. This forces the Source to go to state 5 (CAP_XFERCOUNT is set to 0). If the Source is unable to deliver preview images, it sets pTW_PENDINGXFERS->Count to 0 in reply to the application’s MSG_ENDXFER command, and returns to state 5. 7. The application can then issue MSG_DISABLEDS, which returns it to state 4, and now the application can use DG_CONTROL / DAT_FILESYSTEM / MSG_CHANGEDIRECTORY to change directory to the camera device to take a full resolution picture. So, the step 6 (DAT_PENDINGXFERS / MSG_RESET) that forces the Source to go to state 5 is optional, and when an application issues MSG_DISABLEDS the state could be 5 or 6. Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/sane.ds/ds_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/sane.ds/ds_ctrl.c b/dlls/sane.ds/ds_ctrl.c index e41319baa0f..9f18ff2fe97 100644 --- a/dlls/sane.ds/ds_ctrl.c +++ b/dlls/sane.ds/ds_ctrl.c @@ -371,7 +371,7 @@ TW_UINT16 SANE_DisableDSUserInterface (pTW_IDENTITY pOrigin, TRACE ("DG_CONTROL/DAT_USERINTERFACE/MSG_DISABLEDS\n"); - if (activeDS.currentState != 5) + if (activeDS.currentState != 5 && activeDS.currentState != 6) { twRC = TWRC_FAILURE; activeDS.twCC = TWCC_SEQERROR; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11063