Antonio: Minor Bugs on 64Bit

Antonio: Minor Bugs on 64Bit

Postby byte-one » Mon Apr 18, 2016 2:01 pm

Antonio,
GetCPUSpeed() and nExtMem() gives wrong results on 64Bit!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Minor Bugs on 64Bit

Postby Antonio Linares » Mon Apr 18, 2016 3:29 pm

Günther,

Could you check:

"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz"

and compare it with 32 bits GetCPUSpeed() value ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Minor Bugs on 64Bit

Postby Antonio Linares » Mon Apr 18, 2016 3:38 pm

This should work fine on 64 bits:

Code: Select all  Expand view
HB_FUNC( NEXTMEM ) // --> nHardwareMemory
{
   MEMORYSTATUSEX mst;

   memset( &mst, 0, sizeof( MEMORYSTATUSEX ) );
   mst.dwLength = sizeof( MEMORYSTATUSEX );

   GlobalMemoryStatusEx( &mst );

   hb_retnll( mst.ullTotalPhys );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Minor Bugs on 64Bit

Postby byte-one » Mon Apr 18, 2016 8:05 pm

Antonio, in 16.03 GetCPUSpeed() is coded to "999". No support for 64 in source!
"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz"
and compare it with 32 bits GetCPUSpeed() value ?


nextmem() gives in 64 a negative value! I will test this further tomorrow.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Minor Bugs on 64Bit

Postby byte-one » Tue Apr 19, 2016 5:26 pm

Antonio, GetCPUSpeed() gives also in 32Bit different values. From 183Mhz over 2017Mhz(is right) to 3719Mhz.
In 64Bit gives always 999Mhz. I see on source, the function is not ready!
nExtmem gives in 32Bit the correct value, in 64 Bit gives a ( cValToChar( Int( nExtMem() / ( 1024 * 1024 ) ) + 1 ) ) the value of minus(!)-1062
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Minor Bugs on 64Bit

Postby byte-one » Mon Apr 25, 2016 8:16 am

Antonio, any news on that problems?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Minor Bugs on 64Bit

Postby Antonio Linares » Mon Apr 25, 2016 11:23 am

Günther,

I have been busy working to complete the Windows 10 Toasts support.

How may I help you ? Is the info from the registry ok ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Minor Bugs on 64Bit

Postby byte-one » Tue Apr 26, 2016 8:49 am

Antonio, in case of the memory-size i compile your code with Borland 7.1 and the result is ok! With the libs from FWH the result is wrong and negative. Maybe you are not compile the mem.c in the right way??
The GetCPUSpeed() gives always 999. You should write a new function for 64Bit or use the registry-value. It seems to be nearly right.

Antonio, see also viewtopic.php?f=3&t=32188&p=189722#p189722. There are problems with nextmem()!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Minor Bugs on 64Bit

Postby Antonio Linares » Tue Apr 26, 2016 9:55 am

Günther,

* Fix: function nExtMem() is returning now the same value in both
32 and 64 bits. It keeps returning zero for xHb.com

Included in FWH 16.04
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Minor Bugs on 64Bit

Postby Antonio Linares » Tue Apr 26, 2016 10:26 am

Günther,

* Fix: function GetCpuSpeed() now reads from the registry and returns
the same value in 32 and 64 bits.

Included in FWH 16.04
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Minor Bugs on 64Bit

Postby byte-one » Tue Apr 26, 2016 11:43 am

Antonio, thanks! Super, as all time!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests