Checking for a Windows 64-bit

hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: Checking for a Windows 64-bit

Post 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.
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: Checking for a Windows 64-bit

Post 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)
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Davide
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: Checking for a Windows 64-bit

Post 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
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Checking for a Windows 64-bit

Post 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.
kind regards
Stefan
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: Checking for a Windows 64-bit

Post 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
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: Checking for a Windows 64-bit

Post 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
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Post Reply