Getting Thumped trying to Thunk
by dbaechtel - 4/9/08 5:14 PM
:confused: Getting Thumped trying to Thunk.
I have a Legacy 16-bit application that generates Lessons for Education. The Lessons generated need to run on school computers from Windows 98 through Windows XP. These Lessons also need to exchange information with remote servers using XMLHTTP. I have 32-bit DLLs that can do the data exchange using XMLHTTP tested out OK. I need to be able to exchange integer values, strings and status between the 16-bit Lessons and the 32-bit DLLs. The Legacy 16-bit Lessons can link with 16-bit DLLs. I have tested this and it works OK. But the 16-bit Lessons are not able to link to 32-bit DLLs directly.
The plan is to build 16-bit DLLs that link with the 16-bit Lessons and then use flat thunks between the 16-bit DLLs and 32-bit DLLs to get the communication functions that are needed. I am using the methods described in KB154093 "How To Call 32-bit Code from 16-bit Code Under Windows 95, Windows 98, or Windows Millennium Edition" in building the 16-bit DLLs, thunking script and 32-bit DLLs.
Quite a bit of information is missing. There does not seem to be any documentation on thunk.exe, the thunking compiler. There does not seem to be any documentation on the thunking script language. The formats for the integer and other variable types changed between the 16-bit and 32-bit DLLs. I am not sure what data format the thunk script is using in its declarations.
I am using VC++ 1.52 to build the 16-bit DLLs. I am using VC++ 6.0 to build the 32-bit DLLs. I am using thunk.exe, rc.exe and ml.exe found in the Win98 DDK to build the flat thunk as instructed. I have scraped up enough information on the web to build the DLLs and the flat thunk. It compiles and links OK but any information received by the 16 bit DLL from the 32 bit DLL appears to be corrupted by the flat thunk. I can not send constants as int, WORD, DWORD, LONG or LPSTR from the 32 bit DLL to the 16 bit DLL. ALL values from the 32 bit DLL seem to be corrupted no matter the data type. I am not yet able to test data from the 16-bit DLL to the 32-bit DLL until I can get the correct data returned. I am trying very simple and straight forward tests.
I am building and running these components on a Windows XP Professional system for testing.
Does anyone know why this method described in the KB article does not work?
Does anyone know how to exchange data between 16-bit DLLs and 32 Bit DLLs that will work on Win98 through WinXP systems?
Does flat thunks as described not work on WinXP systems?
Does anyone know where I can find documentation on the thunk.exe and thunking script?
I greatly appreciate any assistance.