twain / twain-cs

A C# interface for TWAIN
165 stars 66 forks source link

Low level memory corruption with some scanners [sf#14] #18

Open kolomiets opened 7 years ago

kolomiets commented 7 years ago

Reported by neticous on 2015-10-13 20:12 UTC I have the latest code and built it. I changed the ICAP_XFERMECH to native 0.

There is a memory corruption with some scanners. When I run the software it works fine until you close and then open the same or other. I am using the Fujitsu fi-7160 and the the Xerox Documate 3220 both exhibit this problem . To reproduce to problem: Run TWAIN for C-Sharp preferably from within devstudio 2010-15

  1. Open the fi-7160
  2. Scan a few times
  3. Close the fi-7160
  4. Open the fi-7160
  5. Scan a few times The following will expose the memory corruption. Run the snipping tool that comes with windows 7. Select an area of the screen to snip, it does not matter what. If you are in the debugger of VS you will get an Access violation exception in the Main program.cs. You can also run this in WinDbg using the same steps. This does not happen with all scanners. It seems as though the scanner is not really being closed or cleaned up correctly for all scanners. I also have a Fujitsu fi-6230 and it works fine, no memory issues. Anybody have an idea why this is happening? Is there something missing in the TWAIN for C-Sharp implementation that would take care of this issue?

Thanks

neticous

kolomiets commented 7 years ago

Updated by mlmcl on 2015-10-17 17:22 UTC

kolomiets commented 7 years ago

Commented by mlmcl on 2015-10-17 17:22 UTC I'm working on a release that may well address this issue. I have a scanner that was exhibiting a lot of problems with the driver UI and memory transfers. I need to apply the fixes to the file, memfile and native transfers. With luck I may have a new release this weekend...

kolomiets commented 7 years ago

Updated by mlmcl on 2015-10-18 00:42 UTC

kolomiets commented 7 years ago

Updated by mlmcl on 2015-10-18 09:28 UTC

kolomiets commented 7 years ago

Commented by mlmcl on 2015-10-18 09:28 UTC The new code is up, please let me know if it makes a difference....