Re: [GD-Windows] Loading new DLLs on old Windows
Brought to you by:
vexxed72
From: Andras B. <bn...@ma...> - 2004-02-11 18:31:08
|
Ah, thanks! Huge amount of info there! You were right, my DLLs are all having subversion 4.0. So my problem is probably somewhere else.. Thanks again, Andras Wednesday, February 11, 2004, 1:21:44 AM, Simon O'Connor wrote: > 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 >> |