RE: [GD-Windows] Loading new DLLs on old Windows
Brought to you by:
vexxed72
From: Simon O'C. <si...@sc...> - 2004-02-11 00:22:03
|
Hi Andras, The subsystem for a DLL is controlled by the /SUBSYSTEM: linker option in your project settings. For a DLL project, this will be set to /SUBSYSTEM:WINDOWS. The /SUBSYSTEM: linker option has an **OPTIONAL** subsystem version parameter (e.g. /SUBSYSTEM:WINDOWS,5.01). This optional parameter allows you to specify the _minimum_ OS version that the DLL requires to be run. You'll find a list of OS version numbers in the documentation for OSVERSIONEX. Some examples are: Windows 95: 4.0 Windows 98: 4.10 Windows ME: 4.90 Windows 2000: 5.0 Windows XP: 5.1 (5.01) Note that the OS version number comes as two parts, major (4, 5 etc) and minor (0, 10, 90, 1 etc). The point isn't a decimal point so 5.1 is the same as 5.01 (the "minor" number is 1). If you (or your development tools) do *not* specify the optional version parameter at the end of the /SUBSYSTEM:WINDOWS option, a default subsystem of 4.00 will be used, regardless of your development tool or OS. [NB: only for x86 code targets, for Itanium code targets this is 5.01] So a DLL created with Visual Studio .NET 2003 on a WindowsXP machine for example will still have a subsystem of 4.00. The only time you'll encounter a DLL under Win32 OSes that has a subsystem that is different than 4.00 is if that DLL absolutely requires that version of Windows. You can view the subsystem of a DLL using Dependency Walker (it comes with the platform SDK, depends.exe). DUMPBIN should tell you this too. To change the subsystem of an existing DLL that you don't have the sourcecode to (i.e. when you aren't able to alter the /SUBSYSTEM option), you can change it using EDITBIN. So in short, all that part of the documentation is saying is "if the DLL specifies that it needs a newer version of Windows than the one currently installed (if 9x) then the LoadLibrary() call will fail". HTH Cheers, Simon O'Connor Programmer @ Acclaim & Microsoft DirectX MVP > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Andras Balogh > Sent: 10 February 2004 16:31 > To: gam...@li... > Subject: [GD-Windows] Loading new DLLs on old Windows > > MSDN says: > > "Windows Me/98/95: If you are using LoadLibrary to load a > module that contains a resource whose numeric identifier is > greater than 0x7FFF, LoadLibrary fails. If you are attempting > to load a 16-bit DLL directly from 32-bit code, LoadLibrary > fails. If you are attempting to load a DLL whose subsystem > version is greater than 4.0, LoadLibrary fails. If your > DllMain function tries to call the Unicode version of a > function, LoadLibrary fails." > > Now, I believe that my DLLs' subsystem version is greater > than 4.0 (how can I check?). How can I make it work on > Win95/98/ME?? Is there a linker option? Or some other workaround? > > > Thanks, > > Andras > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 Premiere > Conference on Open Tools Development and Integration See the > breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004 |