twain/twain-dsm

Randomized base address and DEP disabled in VS project file

mikekaganski opened this issue · 2 comments

Visual Studio 2015 project file has RandomizedBaseAddress set to false (for all configurations), and DataExecutionPrevention set to false (for 32-bit). Can those features be enabled?

Never tested in 32-bit, but in 64 there's some odd compatibility issues, for instance the DSM Call with DAT_IMAGENATIVEXFER returns an invalid handle. It seems to cheat on using 32-bit integers and having the high-order word fixed, which doesn't apply when ASLR & friends are in place. As for DEP, didn't test it.

I ran into this issue in an application with ASLR enabled as well. Does anyone have any idea on how to fix it?

I had a go at debugging the DSM code, but as far as I could tell, the invalid handle was being assigned from within the Data Source (which I wasn't able to debug). It seems unlikely that 3 distinct sets of 64-bit scanner drivers have the same exact problem with 64-bit pointers for the DAT_IMAGENATIVEXFER operation, but I just can't see what might be wrong in the DSM code.