Home › Forums › TWAIN Classic › DSM 2.0 does not work with DS 1.9 on Windows 7
- This topic has 4 replies, 2 voices, and was last updated 14 years, 7 months ago by jimwatters.
- AuthorPosts
It’s found that 32-bit TWAIN 2.0 application cannot scan using legacy TWAIN drivers (v. 1.9 and earlier) on Windows 7 (32-bit). However same 32-bit TWAIN 2.0 application and DS 1.9 work well on Vista (both 32- and 64-bit).
It can be reproduced with test TWAIN 2.0 Sample Application and latest DSM v. 2.0.7.1.
Investigations showed that trick with hooking LdrGetProcedureAddress does not work on Windows 7. Thus DSM 2.0 cannot catch MSG_XFERREADY event from DS. As result DS calls DSM 1.9 (Twain_32.dll) which reasonably returns error and DS reports error as well. Thus TWAIN 2.0 application does not receive MSG_XFERREADY event at all.
Has anybody tested TWAIN 2.0 applications with legacy DS on Windows 7?!
We found that in Windows 7 implementation of major functions is moved from “kermel32.dll” to “kernelbase.dll”. Thus it’s “kernelbase.dll” which calls “LdrGetProcedureAddress” from ntdll.dll. For more details see http://www.nirsoft.net/articles/windows_7_kernel_architecture_changes.html
So on Windows 7 DSM should hook “kernelbase.dll” instead of “kermel32.dll”.
In our tests following fix of hook.cpp [CTwHook::Hook(), line #360] resolved the issue:
//hmodule = GetModuleHandle(“kernel32.dll”);
hmodule = GetModuleHandle(“kernelbase.dll”); //Windows 7Of course, regular DSM needs a little bit more complex code to distinguish Windows 7 case, etc..
Hope that above information will help to fix and release next verison of DSM soon.
Thank you for the bug report and info to resolve it.
Regards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************Is there any information about planned updates of TWAIN DSM regarding the problem with Windows 7 and “legacy” data sources?
I appreciate if anybody can answer.This has been resolved with version 2.0.9 of the DSM.
https://sourceforge.net/projects/twain-dsm/files/At this time the sample TWAIN 2.0 App and DS have not been updated to use version 2.0.9 of the DSM.
Regards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************- AuthorPosts