Solved

WinNT and Generic Thunks

Posted on 1997-12-02
3
308 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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 how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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 …
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

837 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