Old Windows plugin support (2000/98)

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

Old Windows plugin support (2000/98)

Post by *krasusczak »

Hi

This is topic where we can add rebuilded version of plugins supporting old Windows version.

Right now many authors create plugins in Visual Studio 2010 but unfortunately this kill support for Windows 2000 and below (I not sure but problem also may persist at server 2003 (without SP), XP SP0,1,2).

Max version of VS for 2000 is VS2008, for Windows 98 is VS2005.

Many user may still use old Windows like w2k, difference between original version & this? Non!, these is the same plugins but working at a one or more Windows version more.



Here you have plugins rebuilded from original sources from VS2010 to lover version:


AviWcx 1.9 (Windows 2000)
https://rapidshare.com/files/3154293004/wcx_aviwcx_1.9-vc9-static.rar

ext4Plugin 0.16 (Windows 2000)
https://sourceforge.net/projects/ext4tc/files/ext4Plugin/ext4Plugin-0.16/ext4Plugin_static.zip/download

GifWcx 1.3 (Windows 2000)
https://rapidshare.com/files/3075337997/wcx_gifwcx_1.3-vc9-static.rar

tLister 1.2.0 (Windows 2000)
http://tbeu.de/forum/tlister.rar

URL Shortcut Viewer 1.1.1.0 (Windows 2000/98)
http://www.mediafire.com/?8bd6d340mp201y4



Big Thanks for iana & tbeu for rebuilded versions!


Note for authors:
Please if You don't need use newest VS2010 please do that, use VS2008 because many plugins work also at older system without any problems:)
Last edited by krasusczak on 2012-02-21, 22:31 UTC, edited 1 time in total.
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2krasusczak
Many user may still use old Windows like w2k
Really? I don't think so. Even XP is on the way to the great bitbucket in the sky.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

All my plugins/tools support Windows 2000. I'm using VS 2010 but often I don't use CRT at all, or (if I need some CRT) I replace newly added imports from CRT (EncodePointer, DecodePointer, HeapSetInformation, HeapQueryInformation) with empty stubs (I'm linking patched kernel32.lib library w/o that function names and my special kernel32sp1.obj module).
TW
Senior Member
Senior Member
Posts: 390
Joined: 2005-01-19, 13:35 UTC

Post by *TW »

i don'd know a single person who uses w9x or w2k.

honestly, there are no security patches for this since ages, and personally i wouldn't dare to connect to the inet using this completely outdated systems.

but i do live in a so called "civilized" country, maybe there are some of those systems in countries like burundi or bhutan.
licenced and happy TC user since 1994 (#11xx)
krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

Post by *krasusczak »

I can agree that for ex. Win98 is extremely out dated OS & there is no need to support this at all, but if comes to Win 2000 or XP w/o SP or old server you have no idea how many people use it.
They are using it not because they like it but they don't have choice, money for exchange OS mostly simultaneously need also exchange all unit.

A year or two ago i works with a few clients who have win98 & there wasn't any chance to force them to change OS (no money, no need because "it works, slowly & hangs up all the time but it works")

Right now i works remotely for client & they have thousand machines with XP (they have a few testing machines with 7 but from a month or two) you know how much it cost exchange OS & unit because they are to slowly??
I'm taking about one of the biggest logistic company in the world.

You're not using ok, neither i, long time ago i have changed my main OS to 7 but when i go to client & see 2000, sometimes WinME?! nothing gonna surprise me..
Last edited by krasusczak on 2012-02-11, 13:39 UTC, edited 1 time in total.
umbra
Power Member
Power Member
Posts: 876
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

2TW
You would be surprised, but those ancient systems are used even now, because from an engineering point of view they are very simple and they can run on almost anything. Over time most of their deficiencies have been properly documented and as long as you know how to work with them, they can be very safe and stable. You can often find them in ATMs (http://en.wikipedia.org/wiki/Automated_teller_machine#Software), power plants or meteorological stations. So your "civilized" country most probably depends on these "outdated systems".

And now to the topic. Personally I don't care about plugins for such old systems, but if author can make them work without too much effort, why not?
Windows 10 Pro x64, Windows 11 Pro x64
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

MVV wrote:All my plugins/tools support Windows 2000. I'm using VS 2010 but often I don't use CRT at all, or (if I need some CRT) I replace newly added imports from CRT (EncodePointer, DecodePointer, HeapSetInformation, HeapQueryInformation) with empty stubs (I'm linking patched kernel32.lib library w/o that function names and my special kernel32sp1.obj module).
I am interested in your patch. This would save me some work of backporting VS 2010 project files and code to Vs 2005. Do you mind to share?
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

tbeu,
Well, I'll do. There is nothing secret. However, maybe there are some other functions that may need to be replaced too, I found only mentioned 4 (I'm using CRT in my projects rarely): EncodePointer, DecodePointer, HeapSetInformation, HeapQueryInformation.

You need to create special property sheet file for projects that require such compatibility. Then you may add it to all projects, and they will inherit that properties:

0. Open Property Manager window for any of your projects and create new property sheet (for all other projects just attach existing one, you should attach it to each 32-bit Release configuration). I'm using folder $(VisualStudioDir)\Projects for such property sheet (usually it is My Documents\Visual Studio 2010\Projects). E.g. call it Win2kCompat.props.

1. You need to create separate directory for library files and set it as first library search path in that property sheet (open Win2kCompat.props's properties via Property Manager, VC++ Directories page, Library Directories parameter). Don't remove ;$(LibraryPath) after path to your directory.

2. Copy your kernel32.lib (from platform SDK folder) to that directory and patch it using any hex editor (don't add/remove any bytes, just write yours over existing ones): you need to remove problem function names from it. Find all strings with theese function names and modify them a bit (e.g. I changed last name character to _: EncodePointe_, DecodePointe_, HeapSetInformatio_, HeapQueryInformatio_). Voila, linker won't link them anymore! :D

3. Now you need to provide some library that exports theese functions since VS will use your kernel32.lib instead of standard (since its directory specified before SDK directory) and won't find required functions. Use this one as a starting point (it defines empty stubs). Open Win2kCompat.props's properties, Linker\Input page, set Additional Dependencies parameter to kernel32sp1.obj;%(AdditionalDependencies). Put the file kernel32sp1.obj into folder with patched kernel32.lib from step 1.

Save property sheet after modifying it, you should get something like this one. Now you're ready to build your project. Linker will warn you that locally defined symbols are used insted of imported ones, just ignore it. Also it may warn that there is no debug information for that module. Don't forget that only projects that use our Win2kCompat.props will use patched kernel32.lib and kernel32sp1.obj.

And last, you need to patch PE header of EXE files (DLLs don't require such patching) in order to set lower Windows version required to run them. VS2010 sets version 5.01 as required OS version, you need to use 5.00 for Windows 2000 or 4.00 for Windows 9x (so you need to patch 2-4 bytes of PE header - you may even write simple tool for that task). There are a lot of places where you can find required documentation (DWORD at offset 0x3C of a file points to PE header, you need to patch DWORDs at offsets 0x40 and 0x48 of PE header).

Also keep in mind that by default kernel32sp1.obj makes EXE files to export theese functions (!) so I masked some linker directives inside of it to avoid that. If you rebuild kernel32sp1.obj, you will want to do the same (or you will get EXE files with export table :D - it is not a problem but it is unusual, also extra section will waste some space).
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Thank you for your detailed instruction on kernel patching. I noticed that EncodePointer/DecodePointer is the obvious problem whereas the 2 heap functions are not exported by my plugins.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Sometimes CRT may use that functions too, so it is better to redefine them (and all other that may be used by CRT).
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

Post by *krasusczak »

2tbeu

URL Shortcut Viewer still in old version at totalcmd.net
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

krasusczak wrote:URL Shortcut Viewer still in old version at totalcmd.net
Sorry, it is fixed now.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
DoubleT
Member
Member
Posts: 163
Joined: 2003-11-22, 02:21 UTC
Location: Germany

Post by *DoubleT »

MVV wrote: And last, you need to patch PE header of EXE files (DLLs don't require such patching) in order to set lower Windows version required to run them.
You don't need to patch the PE header!
Went to project properties > Linker > System and change "Minimum required version" to 5.00.

Maybe interesting Windows 2000 XP API wrapper pack
#5576 Personal licence
#155652 Commercial licence

Planung bedeutet, den Zufall durch den Irrtum zu ersetzten.
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Blat Mailer should work on Win2k again. Can you please test.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
Post Reply