Solved

WinNT and Generic Thunks

Posted on 1997-12-02
3
313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

631 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