Solved

WinNT and Generic Thunks

Posted on 1997-12-02
3
299 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
Comment Utility
Check articles Q125710 and Q104009 from the MS knowledge base.

0
 

Author Comment

by:reichj
Comment Utility
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
Comment Utility
No.  But you can check the "OS" environment variable.
On NT should be: OS=Windows_NT

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now