dynarithmic / twain_library

Dynarithmic TWAIN Library, Version 5.x
Apache License 2.0
56 stars 24 forks source link

DTwain & Windows security (disable producing TWAIN.LOG) #55

Closed johandevarwaere closed 1 year ago

johandevarwaere commented 1 year ago

I'm building a java application which uses DTwain for scanning images with an Avision-scanner. Everything works fine, but I've an issue when scanning: I use the method _DTWAINAcquireNative to start the scan. After the method is called it takes up to 30 second before the scanner actually starts scanning. I remarked the Microsoft Defender Antivirus Service slows down the process. By trial and error I've added the temp directory to the exclusion list of Microsoft Defender Antivirus. This solves the problem. More precisely it is the TWAIN.LOG file inside the temp directory causes the problem. (Excluding all .log files also solves the problem) Do you have any idea why this happens and if it is possible to disable the log file (f.e.) /... in order not to have this problem?

Kind regards, Johan

dynarithmic commented 1 year ago

The TWAIN.LOG is not one produced by DTWAIN. Not sure how to turn this off, since this seems to be one produced by the TWAIN Data Source Manager, twain_32.dll.

If possible, use the 32-bit TWAINDSM.DLL, found here, and specify to use that DSM by calling DTWAIN_SetTwainDSM.

johandevarwaere commented 1 year ago

Thanks very much, using TWAINDSM.DLL solves the problem.

dynarithmic commented 1 year ago

Thanks. I will close out this issue.