IsUserAnAdmin - IsWow64Process

Share your advanced PureBasic knowledge/code with the community.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: IsUserAnAdmin - IsWow64Process

Post by rsts »

RASHAD wrote:Hi doctorized
Sorry I do't have XP 64 bit for test
So please test the next snippet it is much shorter and clear (the SYSTEM_INFO structure is about( The Processor
Architecture not the running OS )

Code: Select all

#KEY_WOW64_64KEY=$100

KeyName.s = "Software\Wow6432Node" 
KeyHandle.l = 0 
If RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, @KeyName, 0,#KEY_READ|#KEY_WOW64_64KEY, @KeyHandle) = #ERROR_SUCCESS 
MessageRequester("Information","Running System is 64 bit", #MB_ICONINFORMATION)
Else
MessageRequester("Information","Running System is 32 bit", #MB_ICONINFORMATION)
EndIf
Happy new year
Yes Mr Rashad, this code returns 64 bit on my win 7 64 bit system.

Happy new year to you too, my friend :)
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: IsUserAnAdmin - IsWow64Process

Post by moogle »

Returns x86 for me, running Vista x64 SP2 and PB4.4 x86.

Debug GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") returns "x86" instead of "AMD64" which is what it is set to in the Env Vars.

Returns the right values when I run it via PB4.4 x64
Image
Post Reply