News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

OS Info Dump

Started by dedndave, July 28, 2009, 01:41:48 PM

Previous topic - Next topic

dedndave

thanks sinsi
let me play with that one - i may do a conditional display so it only shows one set...

fearless

Couple more titbits of info i found that could be useful:


Determining NT 4.0 SP6 versus SP6a. To detect whether Service Pack 6a is installed if SP6 is detected, you can check to see if the following registry value is set to 1:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\Q246009\Installed


http://www.codeproject.com/KB/winsdk/osdetect.aspx - similar info as before but might be useful.


http://blogs.msdn.com/pusu/archive/2009/06/19/how-do-you-detect-if-running-os-is-windows-7-or-not.aspx
http://msdn.microsoft.com/en-us/library/ms725491%28VS.85%29.aspx (overview of use of VerifyVersionInfo())

http://msdn.microsoft.com/en-us/library/ms724429%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/ms724832%28VS.85%29.aspx
ƒearless

dedndave

thanks again, fearless
the version number almost does the job for us
i may use that as the basic value, then append it with additional information
as always, ms leaves out just enough information to make us work for it - lol

dedndave

i have again updated the program (ver 2.01)
this time, i added preliminary support for win95/98/98se/ME as per sinsi
if you are running win 2K or later, you will see no difference from previous runs
if you are running win95/98/98se/ME, a different Key name is used
that is, if it works - lol - it will be interesting to see it run on 95/98/ME (maybe even win 3.1 and OS/2)

i have updated the first post of the thread with the new d/l
the source file is included
here is a shortcut to the version 2.01 d/l
http://www.masm32.com/board/index.php?action=dlattach;topic=11963.0;id=6534

sinsi

95 OSR2 again

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"Version"="Windows 95"
"VersionNumber"="4.00.1111"
"ProductName"="Microsoft Windows 95"
"CurrentVersion"=(Value not found)
"CurrentBuildNumber"=(Value not found)
"SubVersionNumber"=" B"
"CSDVersion"=(Value not found)
"BuildLab"=(Value not found)
"ProductId"="24264-XXX-XXXXXXX-XXXXX"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Key not found)

OSVERSIONINFOEX Structure:

       Version.Build: 0.0.0
         Platform ID: Win32s on Windows 3.1
         CSD Version:
Service Pack Version: 0.0
          Suite Mask: 0000000000000000
        Product Type: 0

now it's more than 25 lines so your "DednDave OS Info Dump" doesn't show  :boohoo:


edit: I put an error check after GetVersionEx which returned 127 "ERROR_PROC_NOT_FOUND"
edit2: 95 (and win32s I assume) uses OSVERSION and fail when the struc size isn't 148.
Light travels faster than sound, that's why some people seem bright until you hear them.

sinsi

OK, forcing the struc size to 148 produces this

OSVERSIONINFOEX Structure:

       Version.Build: 4.0.67109975
         Platform ID: Win32 on Windows 95
         CSD Version:  B
Service Pack Version: 0.0
          Suite Mask: 0000000000000000
        Product Type: 0

The reason for the strange .Build number is
Quote from: Win32SDK.hlp
dwBuildNumber

Windows NT: Identifies the build number of the operating system.
Windows 95: Identifies the build number of the operating system in the low-order word. The high-order word contains the major and minor version numbers.

Light travels faster than sound, that's why some people seem bright until you hear them.

dedndave

ok - updated to version 2.02
the os version info structure size is set to 148 for older OS's
i would like to see the displayed values for 95, of course
i also noticed you have win98se
it would be greatly appreciated, sinsi
thanks for your help
http://www.masm32.com/board/index.php?action=dlattach;topic=11963.0;id=6535

sinsi


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"Version"="Windows 95"
"VersionNumber"="4.00.1111"
"ProductName"="Microsoft Windows 95"
"CurrentVersion"=(Value not found)
"CurrentBuildNumber"=(Value not found)
"SubVersionNumber"=" B"
"CSDVersion"=(Value not found)
"BuildLab"=(Value not found)
"ProductId"="24264-XXX-XXXXXXX-XXXXX"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Key not found)

OSVERSIONINFOEX Structure:

       Version.Build: 4.0.67109975
         Platform ID: Win32 on Windows 95
         CSD Version:  B



[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"Version"="Windows 98"
"VersionNumber"="4.10.2222"
"ProductName"="Microsoft Windows 98"
"CurrentVersion"=(Value not found)
"CurrentBuildNumber"=(Value not found)
"SubVersionNumber"=" A "
"CSDVersion"=(Value not found)
"BuildLab"=(Value not found)
"ProductId"="13909-OEM-XXXXXXX-XXXXX"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Key not found)

OSVERSIONINFOEX Structure:

       Version.Build: 4.10.67766446
         Platform ID: Win32 on Windows 95
         CSD Version:  A

Light travels faster than sound, that's why some people seem bright until you hear them.

dedndave

very cool sinsi - many thanks
that helped a lot
i bet noone in the forum has win ME
oh - maybe Steve (FORTRANS) does - he collects old stuff like me - lol (don't tell the wifee i said that)

i made a small update - added the version to the banner title
and i overwrite the "Press any key to exit" message at exit for a shorter screen
source included, as always.....
http://www.masm32.com/board/index.php?action=dlattach;topic=11963.0;id=6537

UtillMasm

Microsoft Windows Home Server 32bit Chinese simplified with Service Pack 2
DednDave OS Info Dump Ver 2.03

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"ProductName"="Microsoft Windows Server 2003"
"CurrentVersion"="5.2"
"CurrentBuildNumber"="3790"
"SubVersionNumber"=(Value not found)
"CSDVersion"="Service Pack 2"
"BuildLab"="3790.srv03_sp2_gdr.070926-1208"
"ProductId"="00182-OEM-XXXXXXX-XXXXX"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Key not found)

OSVERSIONINFOEX Structure:

       Version.Build: 5.2.3790
         Platform ID: Win32 on Windows NT
         CSD Version: Service Pack 2
Service Pack Version: 2.0
          Suite Mask: 1000000100110001
        Product Type: Windows Server 2000/2003/2008

Press any key to exit

FORTRANS

Quote from: dedndave on August 01, 2009, 09:04:51 AM
i bet noone in the forum has win ME
oh - maybe Steve (FORTRANS) does

   Nope, I saw that one in use at work.  Had to help
restore that system way too many time.  Ick.  Plus
it wouldn't run some stuff that worked on 98.

   3.11, maybe 95, 98, 2000, XP, if needed.

Steve N.

dedndave

i would be interested in 3.1, Steve - out of curiosity

thanks UtillMasm - good to see a server run
if you would like an explaination of the Suite Mask pins...
http://msdn.microsoft.com/en-us/library/ms724833(VS.85).aspx

sinsi

Tried it in win311 with win32s, but it crashed windows - actually it rebooted the system. I got a flash of an error message from emm386 but couldn't see it.

edit: sorry, that was the old version. The new version doesn't work  :( but doesn't crash win311  :bg

Here are the screenshots of the errors.

[attachment deleted by admin]
Light travels faster than sound, that's why some people seem bright until you hear them.

dedndave

thanks again sinsi - lol
i didn't expect it to work, actually
if i knew how to detect win3 early, i would avoid making the GetVersionEx call or, at least, get the structure size right

dedndave

i found the following 3 tables for older OS's, and for media center\ident

Windows 95 retail, OEM     4.00.950                     7/11/95
Windows 95 retail SP1      4.00.950A                    7/11/95-12/31/95
OEM Service Release 2      4.00.1111* (4.00.950B)       8/24/96
OEM Service Release 2.1    4.03.1212-1214* (4.00.950B)  8/24/96-8/27/97 
OEM Service Release 2.5    4.03.1214* (4.00.950C)       8/24/96-11/18/97
Windows 98 retail, OEM     4.10.1998                    5/11/98
Windows 98, Security CD    4.10.1998A
Windows 98 Second Edition  4.10.2222A                   4/23/99
Windows 98 SE Security CD  4.10.2222B
Windows Me                 4.90.3000                    6/08/00
Windows Me Security CD     4.90.3000A
-------------------------------------------------------------------------------------------
   dwPlatformID dwMajorVersion dwMinorVersion dwBuildNumber
95       1             4              0            950
95 SP1   1             4              0      > 950 && <= 1080
95 OSR2  1             4            < 10         > 1080
98       1             4             10           1998
98 SP1   1             4             10      > 1998 && < 2183
98 SE    1             4             10         >= 2183
Me       1             4             90           3000

NT 3.51  2             3             51           1057
NT 4     2             4              0           1381
2000     2             5              0           2195
XP       2             5              1   

CE 1.0   3             1              0   
CE 2.0   3             2              0   
CE 2.1   3             2              1   
CE 3.0   3             3              0   
-------------------------------------------------------------------------------------------
Ident value v.s Windows Media Center version

< 2.7 = Windows XP Media Center Edition 2002
2.7 or 2.8 = Windows XP Media Center Edition 2004
3.0 = Windows XP Media Center Edition 2005
3.1 = Windows XP Media Center Edition 2005 with Update Rollup 1
4.0 = Windows XP Media Center Edition 2005 with Update Rollup 2
5.0 = Windows Vista
5.1 = Windows Vista with Media Center TV Pack 2008
6.0 = Windows 7