From: David W. H. <dw...@bl...> - 2004-08-07 08:16:59
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is completely a guess... However, could it be because when running a program in Windows NT based OS's it appears to load a subsystem to run that application. So, it may not check the OS version but instead check the subsystem version. Try using it with JUST the subsystem version requirments. It may also be that windows requires both of them to do it properly. I'm not sure why this would happen, except that subsystems can be updated perhaps without changing the OS version number, or older subsystems can be used in emulation (maybe?) such as running a Win95 program under Win2003 or XP. Thus, the subsystem version would tell you exactly what part of Windows is running it. Of course, then the question comes up, what if you want to make sure that the full Windows version is higher, blah blah blah, perhaps MS just has a weird way of doing it. - -----Original Message----- From: min...@li... [mailto:min...@li...] On Behalf Of Gisle Vanem Sent: Saturday, August 07, 2004 1:07 AM To: MingW-users Subject: [Mingw-users] Enforcing a minimum OS version I tried linking a console program with -Wl,--major-os-version,5,--minor-os-version,50 just to test what the result would be when I ran it. I have Win-XP (NT v5.1), so I'd expect the Win-loader to deny loading it. But it runs fine. Using pedump, I see this in the optional header: Optional Header Magic 010B linker version 2.56 size of code 33000 size of initialized data 47800 size of uninitialized data C00 entrypoint RVA 1000 base of code 1000 base of data 34000 image base 400000 section align 1000 file align 200 required OS version 5.50 image version 2.08 subsystem version 4.00 So ld seems to do the right thing. Adding -Wl,--major-subsystem-version,5,--minor-subsystem-version,50 to the link step and running it gives an error though: "test.exe is not a valid Win32 program...". Anybody knows why Windows seems to ignore the "required OS version" value? I'm using: gcc (GCC) 3.4.1 (mingw special) GNU ld version 2.15.90 20040222. -----BEGIN PGP SIGNATURE----- Version: PGP 8.1 Comment: http://www.blue-covenant.org for PGP keys iQA/AwUBQRSPbmz8H+FYJEQ7EQJpwQCfcBwgf6bcJ+MlfA0JAQgYFnhDH+EAn3gX QYOLVUju4RA/r8eaCA2ITA72 =dp8a -----END PGP SIGNATURE----- |