[fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
Is there some function to know if the Windows is 32 or 64? Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Henry Vermaak
On 15 March 2011 14:05, Marcos Douglas wrote: > Is there some function to know if the Windows is 32 or 64? You can use the GetNativeSystemInfo function. Check TSystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64 to see if it's 64 bit. Henry _

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 11:13 AM, Henry Vermaak wrote: > > On 15 March 2011 14:05, Marcos Douglas wrote: > > Is there some function to know if the Windows is 32 or 64? > > You can use the GetNativeSystemInfo function.  Check > TSystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64 to >

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Henry Vermaak
On 15 March 2011 14:25, Marcos Douglas wrote: > On Tue, Mar 15, 2011 at 11:13 AM, Henry Vermaak > wrote: >> >> On 15 March 2011 14:05, Marcos Douglas wrote: >> > Is there some function to know if the Windows is 32 or 64? >> >> You can use the GetNativeSystemInfo function.  Check >> TSystemInfo.

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread DaWorm
I've used this in Delphi 32 and it seems to work. Forgot where I pulled the basic info. Probably doesn't do much on native 64 bit. function Is64BitOS: Boolean; type TIsWow64Process = function(Handle:THandle; var IsWow64 : BOOL) : BOOL; stdcall; var hKernel32 : Integer; IsWow64Process : TIs

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 11:35 AM, Henry Vermaak wrote: > On 15 March 2011 14:25, Marcos Douglas wrote: >> On Tue, Mar 15, 2011 at 11:13 AM, Henry Vermaak >> wrote: >>> >>> On 15 March 2011 14:05, Marcos Douglas wrote: >>> > Is there some function to know if the Windows is 32 or 64? >>> >>> You

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Sven Barth
Am 15.03.2011 16:00, schrieb Marcos Douglas: On Tue, Mar 15, 2011 at 11:35 AM, Henry Vermaak wrote: On 15 March 2011 14:25, Marcos Douglas wrote: On Tue, Mar 15, 2011 at 11:13 AM, Henry Vermaak wrote: On 15 March 2011 14:05, Marcos Douglas wrote: Is there some function to know if the Win

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Henry Vermaak
On 15 March 2011 15:00, Marcos Douglas wrote: > > Weird. This code did not compile in this line: >  @GNSIProc := GetProcAddress(GetModuleHandle('kernel32.dll'), > 'GetNativeSystemInfo'); > > Error: unit1.pas(46,2) Error: Can't assign values to an address This was Delphi code, so remove the @. He

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 12:05 PM, Sven Barth wrote: >> Weird. This code did not compile in this line: >>  @GNSIProc := GetProcAddress(GetModuleHandle('kernel32.dll'), >> 'GetNativeSystemInfo'); >> >> Error: unit1.pas(46,2) Error: Can't assign values to an address >> >> > > Just a guess: > Add {$mo

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Henry Vermaak
On 15 March 2011 15:19, Marcos Douglas wrote: > > Right. But is better ignore the IA64? You can do whatever you like. We chose to ignore it, since we don't support it. You just have to check for the PROCESSOR_ARCHITECTURE_IA64, too, if you'd like to support it. See the msdn page: http://msdn.

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 12:36 PM, Henry Vermaak wrote: > On 15 March 2011 15:19, Marcos Douglas wrote: >> >> Right. But is better ignore the IA64? > > You can do whatever you like.  We chose to ignore it, since we don't > support it.  You just have to check for the > PROCESSOR_ARCHITECTURE_IA64,

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 11:47 AM, DaWorm wrote: > I've used this in Delphi 32 and it seems to work.  Forgot where I > pulled the basic info.  Probably doesn't do much on native 64 bit. > > function Is64BitOS: Boolean; > type >  TIsWow64Process = function(Handle:THandle; var IsWow64 : BOOL) : > BOO

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marco van de Voort
In our previous episode, Marcos Douglas said: > > ? ?if (IsWow64Process(GetCurrentProcess, IsWow64)) then > > ? ? Result := IsWow64 > > ? end; > > ?FreeLibrary(hKernel32); > > end; > > Thanks Jeff, this also works and seems to be standard function to know > if is a 32 or 64bits > See http://msdn.m

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 12:48 PM, Marco van de Voort wrote: > In our previous episode, Marcos Douglas said: >> > ? ?if (IsWow64Process(GetCurrentProcess, IsWow64)) then >> > ? ? Result := IsWow64 >> > ? end; >> > ?FreeLibrary(hKernel32); >> > end; >> >> Thanks Jeff, this also works and seems to be

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Henry Vermaak
On 15 March 2011 15:46, Marcos Douglas wrote: > > Thanks Jeff, this also works and seems to be standard function to know > if is a 32 or 64bits No, this won't work if your application is compiled for win64 (since it won't run under the emulator), as Jeff mentioned. Henry

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 1:33 PM, Henry Vermaak wrote: > On 15 March 2011 15:46, Marcos Douglas wrote: >> >> Thanks Jeff, this also works and seems to be standard function to know >> if is a 32 or 64bits > > No, this won't work if your application is compiled for win64 (since > it won't run under

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Marcos Douglas
On Tue, Mar 15, 2011 at 1:40 PM, Marcos Douglas wrote: > On Tue, Mar 15, 2011 at 1:33 PM, Henry Vermaak > wrote: >> On 15 March 2011 15:46, Marcos Douglas wrote: >>> >>> Thanks Jeff, this also works and seems to be standard function to know >>> if is a 32 or 64bits >> >> No, this won't work if

Re: [fpc-pascal] Function to know if WIN is 32 or 64

2011-03-15 Thread Robert Wolfe
On 3/15/2011 10:25 AM, Marcos Douglas wrote: On Tue, Mar 15, 2011 at 11:13 AM, Henry Vermaak wrote: On 15 March 2011 14:05, Marcos Douglas wrote: Is there some function to know if the Windows is 32 or 64? You can use the GetNativeSystemInfo function. Check TSystemInfo.wProcessorArchitecture