Solved

WinNT and Generic Thunks

Posted on 1997-12-02
3
304 Views
Last Modified: 2013-12-03
I am using Generic Thunks in order to have a 16 bit App use a 32 bit DLL. First, from the 16 bit App I call GetVersion() to verify it is running in a 32 bit OS (Jeff Richter in his book 'Advanced WIndows' claims both Win95 & WinNT are hard coded to return 3.95, pgs 30, 31). Second, I use LoadLibraryEx32W() to load the 32 bit DLL, etc.
This has all been coded and debuged in Win95 and all works as expected. I have recently ported it to WinNT (ver 4.0) and this is where everything breaks down. First of all, the 16 bit GetVersion() call returns 3.1, then the LoadLibraryEx32W() fails (returns NULL).
What is going on here? It appears WinNT is simulating a 16 bit 'Win3.1' enviornment for the 16 bit App. According to all the documentation I have read this should have behaved exactly as in Win95. Also, I cannot find a way to determine why LoadLibraryEx32W() failed because I have not found a 16 bit API equivalent to the Win32 GetLastError() function.

Thanks for any help.
Jeff Reich
0
Comment
Question by:reichj
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 150 total points
ID: 1409045
Check articles Q125710 and Q104009 from the MS knowledge base.

0
 

Author Comment

by:reichj
ID: 1409046
Been there, done that.

Actually, forget the Generic Thunks, Do you know why the 16 bit App's GetVersion() function is not returning 3.95 when running under WinNT (it returns 3.1)?

Thanks.

0
 
LVL 11

Expert Comment

by:alexo
ID: 1409047
No.  But you can check the "OS" environment variable.
On NT should be: OS=Windows_NT

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question