@@ -100,16 +100,50 @@ my @dual_tests = (
100100[" 7 [Ultimate]" , " 7" , 2, 6, 1, 0x01 ],
101101
102102[" 8" , " 8" , 2, 6, 2 ],
103- [" 2008 [R2]" , " 2008" , 2, 6, 1, 0x00 , 2, 89 ],
104- [" 2012" , " 2012" , 2, 6, 2, 0x00 , 2, 89 ],
103+ [" 2008 [R2 Standard ]" , " 2008" , 2, 6, 1, 0x07 , 2, 89 ],
104+ [" 2012 [Standard] " , " 2012" , 2, 6, 2, 0x07 , 2, 89 ],
105105[" [Small Business Server] 2008 R2" , " 2008" , 2, 6, 1, 0x09, 2, 89 ],
106106
107107[" 8.1" , " 8.1" , 2, 6, 3 ],
108108[" 2012 [R2]" , " 2012" , 2, 6, 3, 0x00, 2, 89 ],
109+ );
110+
111+ my @win10_tests = (
112+ [" 10 [Build 9840]" , " 10" , 2, 10, 0, 0x00, 0, 0, 9840],
113+
114+ [" 10 [Version 1507 (Preview Build 9841)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 9841],
115+ [" 10 [Version 1507 (RTM)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 10240],
116+
117+ [" 10 [Version 1511 (November Update) (Preview Build 10525)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 10525],
118+ [" 10 [Version 1511 (November Update)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 10586],
119+
120+ [" 10 [Version 1607 (Anniversary Update) (Preview Build 11082)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 11082],
121+ [" 10 [Version 1607 (Anniversary Update)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 14393],
122+
123+ [" 10 [Version 1703 (Creators Update) (Preview Build 14901)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 14901],
124+ [" 10 [Version 1703 (Creators Update)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 15063],
109125
110- [" 10" , " 10" , 2, 10, 0, 0x00, 2, 89 ],
111- [" 2016" , " 2016" , 2, 10, 0, 0x00, 2, 89 ],
112- [" 2019" , " 2019" , 2, 10, 0, 0x00, 2, 89 ],
126+ [" 10 [Version 1709 (Fall Creators Update) (Preview Build 16170)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 16170],
127+ [" 10 [Version 1709 (Fall Creators Update)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 16299],
128+
129+ [" 10 [Version 1803 (April 2018 Update) (Preview Build 16353)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 16353],
130+ [" 10 [Version 1803 (April 2018 Update)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 17134],
131+
132+ [" 10 [Version 1809 (October 2018 Update) (Preview Build 17604)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 17604],
133+ [" 10 [Version 1809 (October 2018 Update)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 17763],
134+
135+ [" 10 [Version 1903 (May 2019 Update) (Preview Build 18204)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 18204],
136+ [" 10 [Version 1903 (May 2019 Update)]" , " 10" , 2, 10, 0, 0x00, 0, 0, 18362],
137+
138+ [" 2016 [Version 1607]" , " 2016" , 2, 10, 0, 0x07, 2, 0, 14393],
139+ [" 2019 [Version 1809]" , " 2019" , 2, 10, 0, 0x07, 2, 0, 17763],
140+
141+ [" Server [Version 1709]" , " Server" , 2, 10, 0, 0x07, 2, 0, 16299],
142+ [" Server [Version 1803]" , " Server" , 2, 10, 0, 0x07, 2, 0, 17134],
143+ # The 1809 version from the semi-annual channel will identify as "Windows Server 2019 Version 1809"
144+ # ["Server [Version 1809]", "Server", 2, 10, 0, 0x07, 2, 0, 17763],
145+ [" Server [Version 1903]" , " Server" , 2, 10, 0, 0x07, 2, 0, 18362],
146+ [" Server [Build 12345]" , " Server" , 2, 10, 0, 0x07, 2, 0, 12345],
113147
114148);
115149
@@ -118,12 +152,12 @@ my @ia64_tests = (
118152[" 2003 [Enterprise Edition for Itanium-based Systems]" , " 2003" , 2, 5, 2, 0x0002, 2, 0],
119153);
120154
121- plan tests => 6 * (@intel_tests + @amd64_tests + 2*@dual_tests + @ia64_tests );
155+ plan tests => 6 * (@intel_tests + @amd64_tests + 2*@dual_tests + @ia64_tests ) + 3 * @win10_tests ;
122156
123157# Test internal implementation function
124158sub check {
125159 my ($test , $arch ) = @_ ;
126- my ($pretty , $expect , $id , $major , $minor , $sm , $pt , $metrics ) = @$test ;
160+ my ($pretty , $expect , $id , $major , $minor , $sm , $pt , $metrics , $build ) = @$test ;
127161 $metrics = [$metrics ] if defined ($metrics ) && not ref $metrics ;
128162
129163 my $tag = " " ;
@@ -135,7 +169,7 @@ sub check {
135169 # and 2003/2008 start with "Windows Server"
136170 unless ($pretty eq " Win32s" ) {
137171 my $prefix = " Windows" ;
138- $prefix .= " Server" if $pretty =~ / ^20(03|08|12)/ ;
172+ $prefix .= " Server" if $pretty =~ / ^20(03|08|12|16|19 )/ ;
139173 $pretty = " $prefix $pretty " ;
140174 }
141175
@@ -150,7 +184,7 @@ sub check {
150184
151185 # We pass the same value for $suitemask and $productinfo. The former is
152186 # used for Windows up to 2003, the latter is used for Vista and later.
153- my ($os , $desc ) = Win32::_GetOSName(" " , $major ||0, $minor ||0, 0 ,
187+ my ($os , $desc ) = Win32::_GetOSName(" " , $major ||0, $minor ||0, $build ,
154188 $id , $sm ||0, $pt ||1, $sm ||0, $arch , $metrics );
155189 my $display = Win32::GetOSDisplayName($os , $desc );
156190
@@ -159,6 +193,8 @@ sub check {
159193 is($os , " Win$expect " , " os: $os " );
160194 is($desc , $tag , " desc: $desc " );
161195
196+ next if $major == 10;
197+
162198 my $sp = " Service Pack 42" ;
163199 ($os , $desc ) = Win32::_GetOSName($sp , $major ||0, $minor ||0, 0,
164200 $id , $sm ||0, $pt ||1, $sm ||0, $arch , $metrics );
@@ -170,7 +206,7 @@ sub check {
170206 is($desc , $expect , " desc: $desc " );
171207}
172208
173- check($_ , Win32::PROCESSOR_ARCHITECTURE_INTEL) for @intel_tests , @dual_tests ;
209+ check($_ , Win32::PROCESSOR_ARCHITECTURE_INTEL) for @intel_tests , @dual_tests , @win10_tests ;
174210check($_ , Win32::PROCESSOR_ARCHITECTURE_AMD64) for @amd64_tests , @dual_tests ;
175211check($_ , Win32::PROCESSOR_ARCHITECTURE_IA64) for @ia64_tests ;
176212
0 commit comments