Page 2 of 2

Re: Checking for a Windows 64-bit

Posted: Wed Aug 18, 2010 2:27 am
by hua
StefanHaupt wrote:Daniel,

maybe the name of the function is a little bit confusing. The other funcions (IsWinXP(),...) are returning the version of the OS, so I think it would be clearer if IsWin64() would return the type of the OS (.f. for 32bit and .t. for a 64bit OS).

I suggest IsWin64() for the OS and IsWow64() for the application. IsWin64() should return .t. if a 64bit OS is running, IsWow64() should return .t. if a 32bit app is running under 64bit.
+1

I think it's more intuitive and in line with the rest of IsWin...() functions.

Re: Checking for a Windows 64-bit

Posted: Wed Aug 18, 2010 3:51 am
by Daniel Garcia-Gil
hua, stefan

we can not change IsWin64() functionality, maybe other user use this function, we could break compatibility.

yes the function is not intuitive, but return a correct value ( .T. in applications built under 64 and .F. in applications built under 32 )
Daniel Garcia-Gil wrote:Stefan...

the return value is correct in both case
the point is call IsWin64 in 32 bit program (built) never shall return .T. because run in emulation mode (WOW64) under 64 bit OS, this emulation is 32bits
like say : http://msdn.microsoft.com/en-us/library ... S.85).aspx
IsWow64 Determines whether the specified process is running under WOW64.
i mean, no verify OS verify emulation mode
so we need use IsWow64 in 32bit applications

to run 32 bits applications under 64bit, only is possible in emulation mode, we can not skip this "layer", only way is with new function IsWow64 (thanks to davide)

Re: Checking for a Windows 64-bit

Posted: Wed Aug 18, 2010 10:14 am
by Davide
Daniel,
Daniel Garcia-Gil wrote:we can not change IsWin64() functionality, maybe other user use this function
you're right, but if someone did you use it as advertised in the Wiki (like I did), they've already found it doesn't work that way.

I would suggest:

1) Rename IsWin64() as IsMyPrg64()
(including all the calls to IsWin64() in the different sources, like rPreview.prg)
2) Function IsWin64() ; Return ( IsMyPrg64() .or. IsWow64() )

This way IsWin64() would really check the OS rather then the prg, either with FWH32 or with FWH64, without breaking backward compatibility for most of the FiveWin users, apart those that eventually did use it in their own prg's to check whether they were compiled under 32 or 64 bit (they would just have to rename IsWin64() as above however)

Alternatively, we can leave IsWin64() like it is now, but then the Wiki needs to be updated or more and more people will make the mistake to use it with FWH32 to check if the OS is 64bit or not.

Hi,
Davide

Re: Checking for a Windows 64-bit

Posted: Wed Aug 18, 2010 10:28 am
by StefanHaupt
Daniel,
I think it's more intuitive and in line with the rest of IsWin...() functions.
That was my intention. Maybe changing the function could break compatibility with existing apps, but are there already 64bit apps ? I think, it´s not too late to change the function.

Re: Checking for a Windows 64-bit

Posted: Wed Aug 18, 2010 12:32 pm
by Daniel Garcia-Gil
Davide wrote:Alternatively, we can leave IsWin64() like it is now, but then the Wiki needs to be updated or more and more people will make the mistake to use it with FWH32 to check if the OS is 64bit or not.
http://wiki.fivetechsoft.com/doku.php?i ... on_iswin64
The return section explain perfectly this point:
Returns
<lWin64> This function returns .t. if we are executing the application under Windows 64 bit
i will change IsWind64 section
already is:
IsWin64()
It checks if the version of Windows is 64 bit.
for this
it check if we are executing the application under Windows 64 bit
Remarks:
32 bis applications no run in 64 bit, these run under 32 bit emulation, for detect emulation mode use IsWow64

wiki for IsWow64() could be, it check if we are executing the application under 32 bit emulation

Re: Checking for a Windows 64-bit

Posted: Wed Aug 18, 2010 12:46 pm
by Daniel Garcia-Gil
Already changed wiki

http://wiki.fivetechsoft.com/doku.php?i ... on_iswin64

http://wiki.fivetechsoft.com/doku.php?i ... on_iswow64

please any thing else or additional comment, please let us know, thanks by feedback