Sysinternals Homepage
Forum Home Forum Home > Windows Discussions > Development
  New Posts New Posts RSS Feed - EXEs created by VisualStudio2008 vs Win4.0
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

EXEs created by VisualStudio2008 vs Win4.0

 Post Reply Post Reply Page  12>
Author
Message
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Topic: EXEs created by VisualStudio2008 vs Win4.0
    Posted: 21 April 2008 at 7:21am
EXEs and DLLs created by Visual Studio 2008 don't run on Windows 4.0 (ie, NT4 and Win9x)
 
here's my results of digging into this problem ...
 
 
Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2008 at 8:08am
Hi Louis,
 
It would seem that this is discussed (indirectly) here.  Have a look at the /SUBSYSTEM linker switch.  (Doesn't help if you're not the one building the app, of course... Wink)


Edited by molotov - 21 April 2008 at 8:10am
Daily affirmation:
net helpmsg 4006
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2008 at 4:42pm
1.  the /SUBSYSTEM with VS2008 won't allow values less then 5.0
 
2.  if you read the page I pointed to, you'll see the os ver num is not the only issue.
Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2008 at 6:12pm
RE: 1) Ah, thanks.  I hadn't actually tried it. Embarrassed
Quote LINK : warning LNK4010: invalid subsystem version number x.y; default subsystem version assumed
 
Wonder if it's worth mentioning on your page?  (Also would be nice if the MSDN doc for the switch would include that detail...)
 
RE: 2) I did read the page; I guess I disregarded parts 2 and 3 because they were Win9x only...  Shame on me... Shocked
Daily affirmation:
net helpmsg 4006
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2008 at 8:01pm

thnx for the suggestion (reminder) - updated.

what inspired me to post this thread was, that I saw that sysintnerals had published a new ver of handle.exe that is supposed to work on win9x - it doesn't :-)  It looks like sysinternals have bumped into this set of problems and hadn't realised part 2 and 3 of my post ...
Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 4:48am
Quote using older version of EditBin from some older version of VS/VC/SDK _may_ work - I have not explored/tested
I used VS 2003's editbin.exe, and was no longer presented with the following dialog:
Quote =====
Error Starting Program
=====
The X:\Path To\Your.exe file
expects a newer version of Windows.
Upgrade your Windows version.
 
OK
=====
 
I finally made a 98SE and ME VM; the app didn't run, probably due to Part 2 and Part 3 from your page.  Added those functions, and rebuilt, but still no joy... 
Quote LIBCMT.lib(crt0dat.obj) : error LNK2005: __crt_waiting_on_module_handle already defined in objfile.obj
LIBCMT.lib(initcrit.obj) : error LNK2005: ___crtInitCritSecAndSpinCount already defined in objfile.obj
 
Got around those with /FORCE:MULTIPLE to ignore the second definition, but the apps still wouldn't run...  (No warning, and no response from the app.)
Daily affirmation:
net helpmsg 4006
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 5:11am
were you compiling with global optimisation? if so, it seems that you can't reliably override the CRT functions.
Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 7:43pm
Even after disabling compiler optimization (/Od), and using the functions in Part 2 and Part 3 from your page (in conjunction with /FORCE:MULTIPLE), and running the binary through the function in Part 1 (or VS2003's EditBin.exe), the executables created in VS 2008 do not function on Windows 98 SE or Windows ME.
 
In the case of EditBin, Dependency Walker verifies the Subsystem Ver is 4.0, and in the case of the function from Part 1 Dependency Walker shows the OS Ver and Subsystem Ver both as 4.0. 
Daily affirmation:
net helpmsg 4006
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 10:01pm

please past your build log here, as I am interested in reading the warnings that the linker generates when resolving the multiple references to these two functons.

PS, test 5 mins ago with a hello world test from scratch ...
* set progrm to be multibyte
* add forcemultiple to linker
* set crt to be static not dll
* disable whole program optimisation
* use the two funcs from my web page
* and modfy the ver fields (using the method on my page).

Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2008 at 3:54am
I have my test program working on 98 and ME now - thanks for your persistence. EmbarrassedThumbs%20Up
 
Quote were you compiling with global optimisation?
I had taken this to mean /Og which the default optimization (/O2) includes.  I had previously changed the optimzation setting to /Od, to no effect.
 
Quote disable whole program optimisation
This made me look at that Whole Program Optimization setting (/GL); disabling that seems to have been the key.
 
EditBin.exe from VS 2003 and the code from Part 1 each worked, in combination with the functions from Part 2 and Part 3.
 
Wonder if it may also be worth including your list of steps on your page...


Edited by molotov - 23 April 2008 at 4:09am
Daily affirmation:
net helpmsg 4006
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down