flat assembler
Message board for the users of flat assembler.

Index > Windows > Difference FASMW and FRESH IDE

Author
Thread Post new topic Reply to topic
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun
dateigroesse dd ?,0

The code

"
"
invoke OpenFile,dateiname,dateiinfo,OF_READ
mov [dateihandle],eax

invoke GetFileSize,[dateihandle],dateigroesse
mov [dateigroesse],eax
"
"

Compiled with FASMW this returns the filesize directly in [dateigroesse].

Compiled with FRESH IDE this does not return the filesize in [dateigroesse], but in eax.

mov [dateigroesse],eax
Took me some time to realize.

Is this possible?
Post 11 Jul 2014, 14:30
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 518
Location: Munich
shutdownall
Well, read carefully the documentation of GetFileSize.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364955%28v=vs.85%29.aspx

Code:
lpFileSizeHigh [out, optional]

    A pointer to the variable where the high-order doubleword of the file size is returned. 
This parameter can be NULL if the application does not require the high-order doubleword.
    


Only the upper (!) dword of a (possible) qword will be stored in that variable. This means only in case the file size is bigger than eax or a dword (32 bit) - so only for files bigger 4 gigabyte you will have a (partly) result.
Post 11 Jul 2014, 15:16
View user's profile Send private message Send e-mail Reply with quote
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun
Yes thank you, but I know that.

The fact is -like I wrote - that the same code compiled with FASM (using the same file - of course) gives me 1 in eax and the correct size in dateigroesse !

Compiled with FRESH eax gives the correct size and dateigroesse is 0 !

Strange ??? Check it out.
Post 12 Jul 2014, 13:45
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 518
Location: Munich
shutdownall
clamicun wrote:
Compiled with FRESH eax gives the correct size and dateigroesse is 0 !

Strange ??? Check it out.


The same source at the same OS/machine ?
And the same file ?

It is recommended to use GetFileSizeEx instead of GetFileSize.
And it is also recommended to use CreateFile with GENERIC_READ instead of the "obselete" OpenFile function. There are reasons why MS recommends to use newer functions.

Code:
OpenFile function

Creates, opens, reopens, or deletes a file.

Note  This function has limited capabilities and is not recommended. 
For new application development, use the CreateFile function.
    
Post 12 Jul 2014, 22:51
View user's profile Send private message Send e-mail Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
The IDE is not important Fresh IDE uses the same FASM compiler as FASMW. But the macro library you use in both cases is important. So, what macro library you use?
Post 13 Jul 2014, 20:18
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.