The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: orbb on March 20, 2009, 02:46:50 PM

Title: a ver 98 and XP - GetFileSizeEx
Post by: orbb on March 20, 2009, 02:46:50 PM
Hi masters
I have a problem with working code under XP , where running in 98 .
Here is code of unfinished my project of File Compare - find huge count files and compare it to CRC32 , and display if doubled .
The code is working , unfinished only function delete .
My question : how to modifi to work with 98 and XP ?

[attachment deleted by admin]
Title: Re: a ver 98 and XP - GetFileSizeEx
Post by: orbb on March 20, 2009, 02:48:02 PM
If running in 98 - error : The FILECOMPARE.EXE file is linked to missing export KERNEL32.DLL:GetFileSizeEx.
Title: Re: a ver 98 and XP - GetFileSizeEx
Post by: hutch-- on March 20, 2009, 02:53:46 PM
There are two approaches, do an OS version detect and call different API functions depending on which OS version is running or use the win98 version if its available on 2000/XP/Vista and have reduced capacity.
Title: Re: a ver 98 and XP - GetFileSizeEx
Post by: orbb on March 20, 2009, 02:59:11 PM
yes hutch , this is clearly , but never less than 98 starts , i am will get version and call corect function IF APPLICATION LOAD NO ERROR ...
Title: Re: a ver 98 and XP - GetFileSizeEx
Post by: evlncrn8 on March 22, 2009, 01:00:16 PM
well if the api doesn't exist in 9x and you have it in your import table, then the exe will not load,
you will have to do the GetModuleHandle(kernel32) -> GetProcAddress(kernel32, the api you want)
runtime in your code, of the GetProcAddress returns NULL then the api doesn't exist.. no need
for a version check then
Title: Re: a ver 98 and XP - GetFileSizeEx
Post by: orbb on March 22, 2009, 08:09:32 PM
thank you