Hi All,
I cant find a way to tell the difference between Vista32 and Vista64
with a Win32 API. For XP32/XP64 I can use minorbuild from
GetVersionEx(…) but that doesnt seem to work in Vista.
Just checking the processor width doesnt work since you can run Vista32
on a 64 bit processor.
Is there a definitive guide thats up-to-date listing all the OSVERSIONEX
fields? (i.e Version ‘5.2’ can be either Server2003 or XP64 according to
MSDN, and it doesnt say how to distinguish).
Anyone know how the wProductType field will be handled for Longhorn Server?
Thanks!
Bob Kennett
Robert Kennett wrote:
Is there a definitive guide thats up-to-date listing all the
OSVERSIONEX fields? (i.e Version ‘5.2’ can be either Server2003 or
XP64 according to MSDN, and it doesnt say how to distinguish).
For that, there isn’t anything to distinguish. Except for the label,
XP64 *IS* Server 2003.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
----- Original Message -----
From: “Robert Kennett”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, February 28, 2007 12:27 PM
Subject: [ntdev] Differentiate between Vista32 and Vista64
> Hi All,
>
> I cant find a way to tell the difference between Vista32 and Vista64 with
> a Win32 API. For XP32/XP64 I can use minorbuild from GetVersionEx(…) but
> that doesnt seem to work in Vista.
I also wonder if there’s an API that tells if the OS is 32 or 64bit. For the
moment I usually use this registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session
Manager\Environment\PROCESSOR_ARCHITECTURE
It tells me if it’s x86, AMD64 or IA64
Hope it helps
GV
>
> Just checking the processor width doesnt work since you can run Vista32 on
> a 64 bit processor.
>
> Is there a definitive guide thats up-to-date listing all the OSVERSIONEX
> fields? (i.e Version ‘5.2’ can be either Server2003 or XP64 according to
> MSDN, and it doesnt say how to distinguish).
>
> Anyone know how the wProductType field will be handled for Longhorn
> Server?
>
>
> Thanks!
>
> Bob Kennett
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
Tim Roberts wrote:
Robert Kennett wrote:
>Is there a definitive guide thats up-to-date listing all the
>OSVERSIONEX fields? (i.e Version ‘5.2’ can be either Server2003 or
>XP64 according to MSDN, and it doesnt say how to distinguish).
>
>
For that, there isn’t anything to distinguish. Except for the label,
XP64 *IS* Server 2003.
I thought that the wProductId field would contain either VER_NT_SERVER
or VER_NT_DOMAIN_CONTROLLER for Server 2003? I wasnt sure if the field
would return the PRODUCT_DATACENTER_SERVER_CORE,
PRODUCT_STANDARD_SERVER_CORE, or PRODUCT_ENTERPRISE_SERVER_CORE id’s
listed in GetProductInfo API.
No, theres an API for that (GetProcessorInfo?) but that doesnt help if
you are running Vista32 on 64-bit processor, which is actually the more
common case.
----- Original Message ----- From: “Robert Kennett”
> To: “Windows System Software Devs Interest List”
> Sent: Wednesday, February 28, 2007 12:27 PM
> Subject: [ntdev] Differentiate between Vista32 and Vista64
>
>
>> Hi All,
>>
>> I cant find a way to tell the difference between Vista32 and Vista64
>> with a Win32 API. For XP32/XP64 I can use minorbuild from
>> GetVersionEx(…) but that doesnt seem to work in Vista.
>
>
> I also wonder if there’s an API that tells if the OS is 32 or 64bit.
> For the moment I usually use this registry key
>
> HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session
> Manager\Environment\PROCESSOR_ARCHITECTURE
>
> It tells me if it’s x86, AMD64 or IA64
>
>
> Hope it helps
> GV
Ummm, from a 32-bit Windows program, IsWOW64Process will tell you if
you’re running under 64-bit Windows, and from a 64-bit program that
information in inherent in the fact that you’re executing. That would
seem to be sufficient to answer this question vis a vis Win32.
Robert Kennett wrote:
Hi All,
I cant find a way to tell the difference between Vista32 and Vista64
with a Win32 API. For XP32/XP64 I can use minorbuild from
GetVersionEx(…) but that doesnt seem to work in Vista.
Just checking the processor width doesnt work since you can run Vista32
on a 64 bit processor.
Is there a definitive guide thats up-to-date listing all the OSVERSIONEX
fields? (i.e Version ‘5.2’ can be either Server2003 or XP64 according to
MSDN, and it doesnt say how to distinguish).
Anyone know how the wProductType field will be handled for Longhorn Server?
Thanks!
Bob Kennett
–
Ray
(If you want to reply to me off list, please remove “spamblock.” from my
email address)
> I thought that the wProductId field would contain either VER_NT_SERVER or
VER_NT_DOMAIN_CONTROLLER for Server 2003? I wasnt sure if the field would
return the PRODUCT_DATACENTER_SERVER_CORE, PRODUCT_STANDARD_SERVER_CORE,
or PRODUCT_ENTERPRISE_SERVER_CORE id’s listed in GetProductInfo API.
S2K3 definitely exists in both enterprise and DC editions, and will return
those values.
There is a way to tell if you are running in 32 bit on an x64 system, but I
don’t recall the exact interface now. Something about querying to see if
you are running in an emulation environment of some sort as best I recall.
Only works for x64, not IA64. A completely different interface to figure
out if you are 32 bit on an IA64 system.
Loren
Just check if IsWow64Process is exported by ntdll.dll, use GetProcAddress or
so
“Ray Trent” wrote in message
news:xxxxx@ntdev…
> Ummm, from a 32-bit Windows program, IsWOW64Process will tell you if
> you’re running under 64-bit Windows, and from a 64-bit program that
> information in inherent in the fact that you’re executing. That would seem
> to be sufficient to answer this question vis a vis Win32.
Uhh… the documentation says to check Kernel32.dll, not ntdll.dll, and
the function is there on 32-bit XP… Perhaps you know something I
don’t, but that seems like an unwise thing to rely on even if it happens
to be true today for some reason.
Daniel Terhell wrote:
Just check if IsWow64Process is exported by ntdll.dll, use GetProcAddress or
so
“Ray Trent” wrote in message
> news:xxxxx@ntdev…
>> Ummm, from a 32-bit Windows program, IsWOW64Process will tell you if
>> you’re running under 64-bit Windows, and from a 64-bit program that
>> information in inherent in the fact that you’re executing. That would seem
>> to be sufficient to answer this question vis a vis Win32.
>
>
>
–
Ray
(If you want to reply to me off list, please remove “spamblock.” from my
email address)
The right thing is
- check is IsWow64Process is exported by kernel32.dll. ntdll.dll should not
be used. if IsWow… is not exported, it’s 32 bit
- if it’s exported, call it. If the value returned in the Wow64Process is
true, then you are running on 64bit windows. otherwise, it’s 32bit windows.
GV
----- Original Message -----
From: “Ray Trent”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, March 05, 2007 2:51 PM
Subject: Re:[ntdev] Differentiate between Vista32 and Vista64
> Uhh… the documentation says to check Kernel32.dll, not ntdll.dll, and
> the function is there on 32-bit XP… Perhaps you know something I don’t,
> but that seems like an unwise thing to rely on even if it happens to be
> true today for some reason.
>
> Daniel Terhell wrote:
>> Just check if IsWow64Process is exported by ntdll.dll, use GetProcAddress
>> or so
>>
>> “Ray Trent” wrote in message
>> news:xxxxx@ntdev…
>>> Ummm, from a 32-bit Windows program, IsWOW64Process will tell you if
>>> you’re running under 64-bit Windows, and from a 64-bit program that
>>> information in inherent in the fact that you’re executing. That would
>>> seem to be sufficient to answer this question vis a vis Win32.
>>
>>
>>
>
> –
> Ray
> (If you want to reply to me off list, please remove “spamblock.” from my
> email address)
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
If the app is running Usermode you can use the WMI WIN32_OperatingSystem class and get the infromation. This class will tell you everything about the OS that your app is running on. It requires WMI services to be running - which is the default configuration in Windows Vista.
The field that answers the question is the “OSArchitecture”. 32-Bit or 64-Bit OS whether it runs on 32-bit or 64-bit machine.
– Crajyman - NathCorp