-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dtwinver.cpp
5985 lines (5280 loc) · 272 KB
/
Dtwinver.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Module : Dtwinver.cpp
Purpose: Implementation of a comprehensive class to perform OS version detection
Created: PJN / 11-05-1996
History: PJN / 24-02-1997 A number of updates including support for NT 3.1,
single mode DOS in Windows 95 and better Windows
version detection under real mode DOS.
PJN / 13-09-1998 1. Added explicit support for Windows 98
2. Updated documentation to use HTML.
3. Minor update to the web page describing it.
PJN / 22-06-1999 1. UNICODE enabled the code.
2. Removed need for the dwOSVersionInfoSize variable
3. Added support for detecting Build Number of 95 and 98 from DOS code path.
4. Now ships as standard with VC 5 workspace files
5. Added explicit support for Windows 95 SP 1
6. Added explicit support for Windows 95 OSR 2
7. Added explicit support for Windows 98 Second Edition
8. Added explicit support for Windows 2000
9. Added explicit support for Windows CE
10. Added explicit support for Windows Terminal Server's
11. Added explicit support for NT Stand Alone Server's.
12. Added explicit support for NT Primary Domain Controller's
13. Added explicit support for NT Backup Domain Controller's
PJN / 23-07-1999 Tested out support for Windows 98 SE, minor changes required
PJN / 26-07-1999 Added explicit support for Windows 98 SP 1
PJN / 28-07-1999 1. Fixed a problem when application is build in non-huge/large
memory model in Win16
2. Added explicit support for returning NT and Win9x service pack information
from Win32 and Win16 code paths
3. Updated test program to not bother reporting on any info which does not
exist. e.g. if there is no service pack installed, then we don't bother
displaying any info about service packs
4. Added explicit support for NT Enterprise Edition
PJN / 30-06-2000 1. Added explicit support for Windows Millennium Edition
PJN / 29-01-2001 1. Added explicit support for Windows XP (Whistler) Personal
2. Added explicit support for Windows XP (Whistler) Professional
3. Added explicit support for Windows XP (Whistler) Server
4. Added explicit support for Windows XP (Whistler) Advanced Server
5. Added explicit support for Windows XP (Whistler) Datacenter
6. Added explicit support for Windows XP (Whistler) 64 bit (all flavors)
7. Made all the code into a C++ class called COSVersion
8. Rewrote all the generic thunk code to be easier to follow
9. Generic thunk code now uses CallProcEx32W
10. Added explicit support for BackOffice Small Business Edition
11. Added explicit support for Terminal Services
12. 16 bit code path now can determine ProductSuite and ProductType type
thro additional generic thunk code
13. Provided a 64 bit test binary and make batch file (make64.bat) for
those lucky enough to have an Itanium processor and a beta of 64 bit Windows XP (Whistler).
14. Provided a Embedded C++ workspace and X86 Release binary.
15. Updated copyright information
PJN / 10-02-2001 1. Updated function names etc following MS decision to call Whistler "Windows XP"
PJN / 10-10-2001 1. Added code to 32 bit code path to detect if we are being run under 64 bit Windows. Also
updated the sample app to distinguish between emulated 64 bit and underlying
64 bit.
2. Updated the sample app to call XP Server its proper name which will be "Windows.NET Server"
PJN / 13-12-2001 1. Major upgrade. Now 16 bit DOS path can return as much information as native Win32 code.
This is achieved by spawning off the Win32 utility WriteVer with a special command line option.
Please note that if you intend deploying Dtwinver then you must now ship the writever.exe file
in addition to linking in the Dtwinver code into your application. Also this utility needs
to be in the path or current directory when the Dtwinver code is executing. Thanks to Chaz Angell
for prompted me into finding a solution for this last major item missing in Dtwinver.
PJN / 30-12-2002 1. Provided an update CE workspace to work correctly in eMbedded Visual C++ v3. All build configurations
for eVC 3 have also been provided.
2. Optimized the usage of _tcscat and _tcscpy in the test app which comes with Dtwinver.cpp
3. OEM Info string and Platform Type string is now returned for CE code path
4. Fixed display of minor version number for example Windows .NET is version number v5.20 but
should be shown as 5.2 to be consistent with what the native ver command displays
5. Provided a new CE workspace to work correctly in eMbedded Visual C++ v4. All build configurations
for eVC 4 have also been provided.
PJN / 08-10-2002 1. Now uses OSVERSIONINFOEX it possible in the Win32 or Win64 code paths. This provides for
more reliably detection of Windows XP Home Edition.
2. Renamed the functions which detect Windows .NET Server 2003. Also updated the test code which
prints out these names
3. Provided explicit support for Windows .NET Web Server
4. Fixed a bug in the display of the minor OS version number on Windows .NET Server.
5. Made the project for WriteVer a VC 5 project instead of VC 6 which it was up until now.
6. Reworked the internal function WhichNTProduct to use a constant input string parameter
7. Added explicit support for Windows NT / 2000 / XP Embedded
8. Added explicit support for detecting Terminal Services in remote admin mode
PJN / 10-10-2002 1. Fixed a problem where on Windows XP, the test program will include the text "(Standard Edition)"
2. Added two variables to the OS_VERSION_INFO structure to report the minor service pack number
3. Removed the OS_VERSION_INFO structure from the global namespace
4. Removed all static member variables from the class
5. Added a member variable to the OS_VERSION_INFO to return the various "suites" installed
6. reduced the number of calls to WriteVer to 1 when called from dos code path.
7. Completely reworked the internal WhichNTProduct method
8. General tidy up of the header file
9. Completely reworked the ValidateProductSuite method
10. Now only 1 call is made to WhichNTProduct throughout a single call to COSVersion::GetVersion
11. Now only 1 call is made to ValidateProductSuite throughout a single call to COSVersion::GetVersion
12. Fixed an uninitialized variable problem in COSVersion::IsUnderlying64Bit
13. Changed "WhichNTProduct" method to "GetNTOSTypeFromRegistry"
14. Changed "ValidateProductSuite" method to "GetProductSuiteDetailsFromRegistry".
15. Now correctly reports on Terminal Services being in Remote Admin Mode on OS which do not
support calling GetVersionEx using an OSVERSIONINFOEX structure i.e any NT 4 install prior to SP6.
16. 16 bit Windows code path now reports as much NT information as the Win32 code path
17. Fixed a bug in COSVersion::GetInfoBySpawingWriteVer which was failing if it encountered
an empty CSD string. This was spotted on Windows .NET Server which since it is in beta still
(as of October 2002) does not have any service pack!.
PJN / 10-01-2003 1. Update to support MS deciding to change the name of their Whistler Server product. The product
will now be called "Windows Server 2003".
PJN / 30-01-2003 1. Added explicit support for detecting NT Service Pack 6a
PJN / 08-02-2003 1. Added explicit support for detecting Windows XP Service Pack 1a
2. Added support to determine the HAL on NT Kernels.
PJN / 12-02-2003 1. Fixed a compiler warning in GetNTServicePackFromRegistry which occurs when the code is compiled
with the Watcom compiler. Thanks to Christian Kaiser for reporting this.
PJN / 08-03-2003 1. Updated a comment in COSVersion::GetProductSuiteDetailsFromRegistry re NT Embedded.
2. A comment from John A. Vorchak: On NTe (NT Embedded) and XPE (XP Embedded), all of the versions
(of DTWinver) work just fine so long as the components to support them are included in the images,
which itself is kind of a crap shoot. I think that you would probably find that most images will
not support the DOS or Win16 versions however most will support the Win32. Many of the images that
folks build either do not include the DOS subsystem and some of them do not include Explorer, so it
really can't be said that all builds will support them however it is not difficult for a developer
to understand which version would work for them as they understand their target systems better than
anyone and at least one version would certainly work for almost all images.
As far as Win2k (Server Appliance Kit), I haven't done enough testing with that platform, nor do I
currently have any built images with the SAK to say positively or otherwise. More than likely you
would find no problems with the SAK images since they typically follow W2k much more than NTe or
XPE do.
Author: If you are writing for an embedded OS, then there is little use for DTWinver!!, since the
developer has very tight control over the runtime environment. Also if you do use DTWinver on an
embedded version of Windows, you will probably compile in the Dtwinver code rather than ship the
sample binaries I include in the Dtwinver download.
PJN / 09-04-2004 1. Removed a number of unreferenced variable warnings when you compile the code on on VS.NET 2003.
Thanks to Edward Livingston for reporting these issues.
2. Now includes support for Windows XP Media Center Edition. Please note that if you want to do
specific version checking of what version of Media Center you have installed then you should use
my CVersionInfo classes at http://www.naughter.com/versioninfo.html in conjunction with the following
information which I culled from http://www.mvps.org/marksxp/MediaCenter/2004/version.php which
describes the various version numbers of ehshell.exe in \Windows\ehome to the corresponding versions
of XP Media Center Edition.
Windows XP Media Center Edition: 2002 5.1.2600.1106 First released version of Windows Media Center
5.1.2600.1142 Highest released build of Media Center 2002
(provided via Q815487)
Windows XP Media Center Edition: 2004 5.1.2600.1217 Release build of Windows Media Center 2004
(upgrade over previous MCE 2002 build).
5.1.2600.1321 December 2003 Hotfix for Media Center 2004 version
(provided via Q830786)
5.1.2600.2096 Media Center Version included with Windows XP
Service Pack 2 Release Candidate 1. This version can
be installed over a current MCE 2002 or 2004 using
the Windows XP Service Pack 2 installer. If you have
any build between 1322 and 2095 assume this to be
a beta version.
3. Dtwinver now returns the processor architecture via a call to GetSystemInfo or GetNativeSystemInfo.
This is used to differentiate between 64 Bit Windows on Itanium and AMD64 processors.
4. Renamed the global preprocessor defines used by Dtwinver to use more unique names
5. Added make files and binaries for AMD64 processors
PJN / 26-06-2005 1. INTEL_PROCESSOR enum is now more correctly know as IA32 which means x86 32 bit.
2. Fixed a bug where the OS_VERSION_INFO parameter was not be zero set in the function
COSVersion::GetVersion. Thanks to "Remio" for reporting this issue.
PJN / 29-06-2005 1. Added support for detecting if code is running on Tablet PC Edition of Windows.
2. Code now uses GetSystemMetrics call in preference to direct registry calls to detect Media Center
Edition of Windows.
3. Renamed the functions which differentiate between the different OEM Service Release versions of Windows
95. They are OSR 2[.1] = Win95B, OSR2.5 = Win95C. For the gory details please see the KB article at
http://support.microsoft.com/kb/q158238/
PJN / 22-07-2005 1. Now includes support for Windows Vista, formerly Windows codename "Longhorn"
PJN / 06-09-2005 1. Renamed some of the functions which detect Longhorn Server. Previously the functions were
incorrectly referring to Vista Server. Vista is the name of the Windows Client. As of yet, a product
name has not been picked for Longhorn Server.
2. Now includes support for Windows Server 2003 R2.
3. Now includes support for Windows XP Starter Edition and any future versions such as Windows Vista
Starter Edition.
PJN / 17-05-2006 1. Updated copyright details.
2. Updated documentation to use the same style as the web site.
3. Updated documentation on version numbers which XP Media Center can have.
4. Added support for Windows Server 2003, Computer Cluster Edition
5. Added support for Windows Storage Server 2003 R2
6. Added support for detecting if Windows is installed in a "Security Application" mode
7. Added support for detecting BackOffice components are installed
7. Provided Visual Studio 2005 solutions to build DtWinver with.
PJN / 21-09-2006 1. Included support for detecting all the different types of Vista SKU's, namely:
Windows Vista Starter Edition, Windows Vista Home Basic N, Windows Vista Home Basic,
Windows Vista Home Premium, Windows Vista Business N, Windows Vista Business,
Windows Vista Enterprise, and Windows Vista Ultimate.
2. Fixed a bug in the displaying of unknown versions of Windows in the sample app
PJN / 18-05-2007 1. Updated copyright details.
2. Updated code to refer to Windows Server 2008 which was formerly known as Windows Server codename "Longhorn"
PJN / 20-06-2007 1. Include support for detecting Windows Home Server. Thanks to Petr Stejskal for suggesting this update.
PJN / 14-06-2008 1. Updated copyright details
2. Code now compiles cleanly using Code Analysis (/analyze)
3. Added support for Vista Home Premium N
4. Added support for Vista Business N
5. Added support for Vista Enterprise N
6. Added support for Vista Ultimate N
7. Added support for Windows Core Server
8. Added support for Windows Hyper-V
9. Added support for Windows Essential Business Server Management Server
10. Added support for Windows Essential Business Server Messaging Server
11. Added support for Windows Essential Business Server Security Server
12. Added support for Windows Storage Server Enterprise Edition
13. Added support for Windows Storage Server Express Edition
14. Added support for Windows Storage Server Standard Edition
15. Added support for Windows Storage Server Workgroup Edition
16. Added support for Windows Cluster Server Edition
17. Added support for Windows Business Server Premium Edition
PJN / 15-12-2008 1. Added support for detecting Windows 7
PJN / 05-07-2010 1. Updated copyright details
2. Added a IsWindowsVistaOrWindowsServer2008 method
3. Added a IsWindows7OrWindowsServer2008R2 method
4. Reworked the logic in all the Windows 2008 methods to use IsWindowsVistaOrWindowsServer2008 instead of
IsWindowsServer2008. Thanks to Matt Fox for reporting this issue.
5. Added comprehensive support for Windows 2008 R2
6. Reworked the GetInfoBySpawingWriteVer method to work correctly on OSes which use UAC. The code now uses
_tempnam which places the temporary file in the "TMP" directory.
7. Fixed a bug in GetInfoBySpawingWriteVer where it incorrectly parsed the dwSuiteMask values.
8. Extended WriteVer and GetInfoBySpawingWriteVer to also update dwSuiteMask2
9. Added support for the following Product types: PRODUCT_ENTERPRISE_E, PRODUCT_HOME_BASIC_E,
PRODUCT_HOME_PREMIUM_E, PRODUCT_PROFESSIONAL, PRODUCT_PROFESSIONAL_E, PRODUCT_PROFESSIONAL_N,
PRODUCT_SERVER_FOR_SMALLBUSINESS, PRODUCT_SERVER_FOR_SMALLBUSINESS_V, PRODUCT_SERVER_FOUNDATION,
PRODUCT_SOLUTION_EMBEDDEDSERVER, PRODUCT_STARTER_E, PRODUCT_STARTER_N, PRODUCT_ULTIMATE_E. This means that
the code now fully supports Windows 7 Professional, Windows E Edition (The version of Windows 7 that was to
be released in Europe without Internet Explorer 8), Windows Server 2008 R2 Foundation Server and
Windows Multipoint Server 2010.
10. Changed some of the names of the class methods for overall consistency
PJN / 08-08-2010 1. The code now differentiates between having the Hyper-V tools installed and the actual Hyper-V OS. Thanks
to Scott Pawloski for reporting this issue.
PJN / 26-06-2011 1. Updated copyright details.
2. Added support for the following Product types: PRODUCT_HOME_SERVER_PREMIUM,
PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE, PRODUCT_CLUSTER_SERVER_V, PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE,
PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE, PRODUCT_SB_SOLUTION_SERVER, PRODUCT_EMBEDDED,
PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT, PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE, PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL,
PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC, PRODUCT_STORAGE_EXPRESS_SERVER_CORE, PRODUCT_STORAGE_STANDARD_SERVER_CORE,
PRODUCT_STORAGE_WORKGROUP_SERVER_CORE. Thanks to Petr Stejskal for prompting this update.
3. Added a IsHomeServerPremiumEditionInstalled method.
4. Fixed a bug handling PRODUCT_CLUSTER_SERVER_V ProductType
5. Fixed a bug handling PRODUCT_CLUSTER_SERVER ProductType
6. Fixed a typo in the name of IsSmallBusinessServerInstalled method
7. Added a IsWindowsCENET method.
8. Added a IsWindowsEmbeddedCompact method.
9. The sample app has been updated to differentiate between the various marketing names for CE i.e. Windows CE,
Windows CE .NET and Windows Embedded Compact. The code has also been verified to operate correctly on Windows Embedded
Compact using a OSDesign project on Visual Studio 2008 Professional, Windows Embedded Compact, a sub project which
builds DtWinVer for x86 CEPC and a VMWare image of Compact 7 running the DtWinVer binaries. Thanks to Mike Ryan for
prompting this update.
PJN / 02-07-2011 1. Updated to support Windows 8 and Windows Server 2012. These are the names which DtWinVer currently uses to refer
to the next client and server versions of Windows respectively. At the moment there is no official details from
Microsoft on what the product names will be, but DtWinVer will be updated following any announcements.
PJN / 17-09-2011 1. Updated the code to work correctly against the Windows 8 Developer Preview and Windows 8 Server Developer
Preview builds.
2. Updated code to refer to Windows codename "8" and Windows codename Server "8" instead of Windows 8 and Windows
Server 2012.
PJN / 28-04-2012 1. Updated copyright details.
2. My guess from last year was correct! Windows codename Server "8" will become Windows Server 2012. The code has been
updated to reflect this announcement from http://www.microsoft.com/en-us/news/Press/2012/Apr12/04-17MMSDay1PR.aspx.
3. Updated code to refer to Windows codename "8" as Windows 8 based on information from
http://windowsteamblog.com/windows/b/bloggingwindows/archive/2012/04/16/announcing-the-windows-8-editions.aspx.
4. Removed tests for Windows 8 (Home Basic), Windows 8 (Home Premium), Windows 8 (Ultimate) from code.
5. Added support for the following Product types: PRODUCT_PRERELEASE, PRODUCT_PRERELEASE_N, PRODUCT_PRERELEASE_ARM,
PRODUCT_PROFESSIONAL_PLUS, PRODUCT_ENTERPRISE_EVALUATION, PRODUCT_STANDARD_EVALUATION_SERVER,
PRODUCT_DATACENTER_EVALUATION_SERVER, PRODUCT_ENTERPRISE_N_EVALUATION, PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER,
PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER, PRODUCT_MULTIPOINT_STANDARD_SERVER, PRODUCT_MULTIPOINT_PREMIUM_SERVER &
PRODUCT_THINPC, PRODUCT_EMBEDDEDINDUSTRY, PRODUCT_EMBEDDEDA, PRODUCT_EMBEDDEDINDUSTRYA, PRODUCT_EMBEDDEDAUTOMOTIVE,
PRODUCT_EMBEDDEDE, PRODUCT_EMBEDDEDINDUSTRYAE & PRODUCT_EMBEDDEDINDUSTRYE
6. Added support for Windows RT based on information from
http://windowsteamblog.com/windows/b/bloggingwindows/archive/2012/04/16/announcing-the-windows-8-editions.aspx.
PJN / 29/12-2012 1. Added support for the following product types: PRODUCT_EMBEDDED_AUTOMOTIVE, PRODUCT_EMBEDDED_INDUSTRY_A,
PRODUCT_EMBEDDED_A, PRODUCT_EMBEDDED_INDUSTRY, PRODUCT_EMBEDDED_E, PRODUCT_EMBEDDED_INDUSTRY_E,
PRODUCT_EMBEDDED_INDUSTRY_E, PRODUCT_EMBEDDED_INDUSTRY_A_E, PRODUCT_CORE_ARM, PRODUCT_CORE_ARM, PRODUCT_CORE_N,
PRODUCT_CORE_COUNTRYSPECIFIC, PRODUCT_CORE_SINGLELANGUAGE, PRODUCT_CORE & PRODUCT_PROFESSIONAL_WMC
2. Fixed a bug with the handling of the PRODUCT_THINPC #define value
3. Updated the code to compile cleanly on VC 2012
PJN / 26-05-2013 1. Updated copyright details.
2. Now includes support for Windows 8.1 formerly known as Windows "Blue". I have also added code to support the
server version of "Blue" which for the moment I am calling Windows Server codename "Blue".
PJN / 07-06-2013 1. Updated all code references of Windows Server codename "Blue" to Windows Server 2012 R2.
PJN / 21-07-2013 1. Fixed some /analyze warnings reported by VS 2013 Preview.
2. The code now correctly handles the case where Windows 8.1 and Windows 2012 R2 lies about the real windows
version number. For details see http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074(v=vs.85).aspx.
This change should also mean that correct OS details are returned when the code is run from a process in which
AppCompat version number shims are installed. Thanks to Christian Kaiser for reporting this issue.
3. All RegOpenKeyEx now requests the non virtualized key via the KEY_WOW64_64KEY value.
4. Reworked the WriteVer application to correctly compile under Unicode.
5. Win32s is now surfaced as a suite value.
6. Major rework and refactoring of all the DtWinver code base and test app. This rework should make it easy to
update the code going forward.
7. The suite details are now only reported after the underlying OS details in the test app.
8. The sample app now uses a larger stack buffer for displaying the OS details. This avoids any potential
stack overwrite issues when the number of suite mask values returned is large.
9. Fixed a bug in the generic thunking code path in GetProductInfo which resulted in the Win32 API of the same
name failing.
PJN / 14-04-2014 1. Updated copyright details
2. Updated code to compile cleanly using VS 2013
3. Updated code to report failure when compiled under Windows RT i.e. when the WINAPI_FAMILY preprocessor
value is anything other than WINAPI_FAMILY_DESKTOP_APP
4. Added support to detect Windows 8.1 / 2012 R2 Update
PJN / 01-10-2014 1. Updated code to support Windows 10 Technical Preview and Windows Server 10 Technical Preview.
PJN / 17-01-2015 1. Updated copyright details.
2. Fixed up the COSVersion::IsWindows2000AdvancedServer method to correctly distinguish between server and client OSes.
3. Fixed up the COSVersion::IsEnterpriseWindowsServer2003 method to correctly distinguish between server and client OSes.
4. Fixed up the COSVersion::IsEnterpriseWindowsServer2003R2 method to correctly distinguish between server and client OSes.
5. Fixed up the COSVersion::IsEnterpriseWindowsServer2008 method to correctly distinguish between server and client OSes.
6. Fixed up the COSVersion::IsEnterpriseWindowsServer2008R2 method to correctly distinguish between server and client OSes.
7. Fixed up the COSVersion::IsEnterpriseWindowsServer2012 method to correctly distinguish between server and client OSes.
8. Fixed up the COSVersion::IsEnterpriseWindowsServer2012R2 method to correctly distinguish between server and client OSes.
9. Fixed up the COSVersion::IsEnterpriseWindowsServer10 method to correctly distinguish between server and client OSes.
PJN / 29-04-2015 1. Updated the code to correctly handle / identify Windows 8.1 with Bing (aka CoreConnected). This applies to the
ProductInfo values: PRODUCT_CORE_ARM, PRODUCT_CORE_N, PRODUCT_CORE_COUNTRYSPECIFIC, PRODUCT_CORE_SINGLELANGUAGE &
PRODUCT_CORE. Thanks to Petr Stejskal for reporting this issue. The suite value that is used to identify this is
COSVERSION_SUITE2_CORECONNECTED and the method IsCoreConnected.
2. The ProductInfo value PRODUCT_PRERELEASE_ARM now correctly sets the underlying processor type to ARM
PJN / 30-04-2015 1. It turns out that the new detection code to detect Windows 8.1 with Bing was flawed in the previous release as the
PRODUCT_CORE_* ProductInfo values just means the standard / core version of Windows 8.1. The code has now been updated to
use a registry search to correctly detect if Windows 8.1 with Bing is installed.
PJN / 17-05-2015 1. Updated all code references of Windows Server 10 to Windows Server 2016.
2. Added support for the following product types: PRODUCT_PROFESSIONAL_EMBEDDED, PRODUCT_MOBILE_CORE,
PRODUCT_EMBEDDED_INDUSTRY_EVAL, PRODUCT_EMBEDDED_INDUSTRY_E_EVAL, PRODUCT_EMBEDDED_EVAL, PRODUCT_EMBEDDED_E_EVAL,
PRODUCT_NANO_SERVER, PRODUCT_CLOUD_STORAGE_SERVER, PRODUCT_CORE_CONNECTED, PRODUCT_PROFESSIONAL_STUDENT,
PRODUCT_CORE_CONNECTED_N, PRODUCT_PROFESSIONAL_STUDENT_N, PRODUCT_CORE_CONNECTED_SINGLELANGUAGE,
PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC, PRODUCT_CONNECTED_CAR, PRODUCT_INDUSTRY_HANDHELD, PRODUCT_PPI_PRO,
PRODUCT_ARM64_SERVER, PRODUCT_EDUCATION, PRODUCT_EDUCATION_N, PRODUCT_IOTUAP, PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER,
PRODUCT_ENTERPRISE_S, PRODUCT_ENTERPRISE_S_N, PRODUCT_PROFESSIONAL_S, PRODUCT_PROFESSIONAL_S_N,
PRODUCT_ENTERPRISE_S_EVALUATION & PRODUCT_ENTERPRISE_S_N_EVALUATION.
3. Remove the word Installed from most of the methods.
4. The download now includes a Winver14.sln solution for Visual Studio 2015 RC. This now allows you to build an ARM
binary of DtWinVer which you can deploy to Windows IoT Core on the Raspberry Pi 2. Also included is a precompiled
ARM binary of DtWinVer.
5. Updated the code to clean compile on VS 2015 RC
PJN / 19-09-2015 1. Code now always tries to use "RTLGetVersion" to get the underlying OS details. Previously it would only do this if
the code detected that it was running on Windows 8.1 or greater. Also removed the GetRealVersionNumbersFromRegistry
method as this returns 6.3 on Windows 10 and as such is just unreliable. Please note that DtWinVer will still report
incorrect OS details if compatibility mode is enabled for your application. Thanks to Dave Silber for prompting this
investigation.
PJN / 04-03-2016 1. Updated copyright details.
2. Provided IsWindows10RTM, IsWindows10Version1511 & IsWindows10Redstone functions. Also updated the sample app to
report this information.
PJN / 04-04-2016 1. Updated code to refer to Windows 10 Anniversary Update instead of Windows Redstone.
PJN / 25-07-2016 1. Reworked the code in test.cpp to correctly report on versions of Windows Server Enterprise. This follows testing on
Windows Server 2016 Standard Technical Preview 5.
PJN / 17-08-2016 1. Renamed IsWindows10AnniversaryUpdate method to IsWindows10Version1607.
2. Provided new IsWindows10Redstone2, IsHolographic, IsSubscription, IsUtilityVM, IsWorkstation, IsAzure &
IsIoTCommercial methods.
3. Added support for the following product types: PRODUCT_HOLOGRAPHIC, PRODUCT_PRO_SINGLE_LANGUAGE, PRODUCT_PRO_CHINA,
PRODUCT_ENTERPRISE_SUBSCRIPTION, PRODUCT_ENTERPRISE_SUBSCRIPTION_N, PRODUCT_DATACENTER_NANO_SERVER,
PRODUCT_STANDARD_NANO_SERVER, PRODUCT_DATACENTER_A_SERVER_CORE, PRODUCT_STANDARD_A_SERVER_CORE,
PRODUCT_DATACENTER_WS_SERVER_CORE, PRODUCT_STANDARD_WS_SERVER_CORE, PRODUCT_UTILITY_VM,
PRODUCT_DATACENTER_EVALUATION_SERVER_CORE, PRODUCT_STANDARD_EVALUATION_SERVER_CORE, PRODUCT_PRO_WORKSTATION,
PRODUCT_PRO_WORKSTATION_N, PRODUCT_PRO_FOR_EDUCATION, PRODUCT_PRO_FOR_EDUCATION_N, PRODUCT_AZURE_SERVER_CORE,
PRODUCT_AZURE_NANO_SERVER, PRODUCT_IOTUAPCOMMERCIAL & PRODUCT_MOBILE_ENTERPRISE
4. Added SAL annotations to all the code.
PJN / 13-10-2016 1. Updated the code to report correct values on Windows Server 2016 RTM. It seems that on Windows Server 2016 Standard
RTM that the VER_SUITE_ENTERPRISE flag is set in OSVERSIONINFOEX::wSuiteMask. I'm not sure if this is a genuine bug
in Windows Server 2016 but I have modified the code to handle this by removing the COSVERSION_SUITE_ENTERPRISE flag if
the code successfully calls GetProductInfo which gives the correct result after calling GetVersionEx.
PJN / 03-01-2017 1. Updated copyright details.
2. Renamed IsWindows10Redstone2 method to IsWindows10Version1703.
PJN / 12-02-2017 1. Added support for the following product types: PRODUCT_ENTERPRISEG, PRODUCT_ENTERPRISEGN, PRODUCT_CLOUD &
PRODUCT_CLOUDN.
2. Renamed IsWindows10Version1703 method to IsWindows10Version1704.
PJN / 01-04-2017 1. Renamed IsWindows10Version1704 method to IsWindows10Version1703.
2. Tested the code on Windows 10 version 1703.
3. Verified the code compiles cleanly on VC 2017.
PJN / 17-04-2017 1. Provided a new IsWindows10Redstone3 method
PJN / 18-04-2017 1. Removed unused COSVersion::GetNTCurrentVersionFromRegistry and COSVersion::GetNTCSDVersionFromRegistry methods
from codebase.
2. Updated the code to support the Windows 10 UBR "Update Build Revision" value. For example the latest version of
Windows 10 at the time of this release was Version 1703, OS Build 15063.138. The 138 in the value is the UBR.
PJN / 19-06-2017 1. Renamed IsWindowsCloud method to IsSEdition.
2. Renamed IsSEdition method to IsLTSB.
PJN / 27-09-2017 1. Renamed IsWorkstation method to IsProWorkstations and reworked the COSVERSION_SUITE3_WORKSTATION enum to be
COSVERSION_SUITE3_PRO_WORKSTATIONS. These changes allow DtWinVer to explicitly support detection of Windows 10 Pro
for Workstations.
PJN / 28-09-2017 1. Added support for PRODUCT_SERVERRDSH product type.
PJN / 21-10-2017 1. Renamed IsWindows10Redstone3 method to IsWindows10Version1709.
2. Tested the code on Windows 10 version 1709.
3. Provided a new IsWindows10Redstone4 method.
4. Provided a new IsWindowsServerVersion1709 method.
5. Tested the code on Windows Server version 1709.
PJN / 11-11-2017 1. Added support for PRODUCT_HUBOS product type
2. Added support for detecting VER_SUITE_COMMUNICATIONS, VER_SUITE_SMALLBUSINESS_RESTRICTED &
VER_SUITE_EMBEDDED_RESTRICTED. Note that there is a new VER_SUITE_MULTIUSERTS define in the latest Windows 10 SDK
but it does not fit in the current WORD sized element in OSVERSIONINFOEX structure so I have not included any
code to support this new define.
3. Added support for detecting PROCESSOR_ARCHITECTURE_NEUTRAL, PROCESSOR_ARCHITECTURE_ARM64,
PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 & PROCESSOR_ARCHITECTURE_IA32_ON_ARM64 architectures
PJN / 04-02-2018 1. Updated copyright details.
2. Added support for PRODUCT_ONECOREUPDATEOS.
PJN / 21-02-2018 1. Added support for PRODUCT_ANDROMEDA
2. Provided a new IsWindows10Redstone5 method.
PJN / 28-03-2018 1. Provided new IsWindowsServer2019, IsWebWindowsServer2019, IsStandardWindowsServer2019,
IsEnterpriseWindowsServer2019, IsDatacenterWindowsServer2019 & IsDomainControllerWindowsServer2019 methods
2. Updated IsWindows10OrWindowsServer2016 method to account for Windows Server 2019
PJN / 31-03-2018 1. Renamed IsWindows10Redstone4 method to IsWindows10Version1803.
PJN / 22-04-2018 1. Fixed a bug in IsWindowsServer2019 when the computer is a domain controller. Thanks to Heiko Wetzel for
reporting this issue.
PJN / 26-04-2018 1. Added support for "Windows 10 Lean" as reported at
https://twitter.com/tfwboredom/status/987400226913779712/photo/1.
PJN / 03-05-2018 1. Test code now reports the UBR number on Windows Server 2019
2. Fixed up detection of Server Core for the following Product types: PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE,
PRODUCT_DATACENTER_A_SERVER_CORE, PRODUCT_STANDARD_A_SERVER_CORE, PRODUCT_DATACENTER_WS_SERVER_CORE,
PRODUCT_STANDARD_WS_SERVER_CORE, PRODUCT_DATACENTER_EVALUATION_SERVER_CORE,
PRODUCT_STANDARD_EVALUATION_SERVER_CORE & PRODUCT_AZURE_SERVER_CORE.
3. The value from GetProductInfo is now returned in the OS_VERSION_INFO structure.
4. Provided a new IsWindowsServerVersion1803 method.
PJN / 30-06-2018 1. Fixed a number of C++ core guidelines compiler warnings.
2. Added support for PRODUCT_IOTOS
PJN / 26-07-2018 1. Added support for PRODUCT_CLOUDEN
2. Provided a new IsWindows10Codename19H1 method.
3. Changed IsWindows10Redstone5 to IsWindows10CodenameRedstone5.
PJN / 23-09-2018 1. Renamed PRODUCT_LEAN define to PRODUCT_CLOUDE
2. Removed defunct IsLean method
3. Fixed a number of compiler warnings when using VS 2017 15.8.5
4. Renamed IsWindows10Redstone5 method to IsWindows10Version1809.
PJN / 12-10-2018 1. Added a new IsWindowsServerVersion1809 method.
2. Reimplemented the IsWindowsServerVersion1709 & IsWindowsServerVersion1803 methods to explicitly check
for these semi-annual Windows server editions
PJN / 14-11-2018 1. Added support for PRODUCT_IOTEDGEOS & PRODUCT_IOTENTERPRISE
PJN / 29-11-2018 1. Added a new IsWindowsServerCodename19H1 method.
2. Added support for PRODUCT_LITE
PJN / 02-01-2019 1. Updated copyright details.
2. Added support for PRODUCT_HOLOGRAPHIC_BUSINESS & PRODUCT_IOTENTERPRISES
PJN / 15-02-2019 1. Fixed a number of compiler warnings when using VS 2019 Preview
2. Provided a new IsWindows10Codename20H1 method.
PJN / 19-02-2019 1. Updated the detection logic in IsWindowsServerVersion1809.
2. Updated the detection logic in IsWindowsServerCodename19H1.
PJN / 05-03-2019 1. Updated the detection logic in IsWindows10Version1803, IsWindows10Version1809 and
IsWindows10Version19H1
2. Renamed IsWindows10Codename19H1 method to IsWindows10Version1903.
PJN / 06-04-2019 1. Updated the detection logic in IsWindows10Version1903.
2. Added a new IsWindows10Version19H2 method.
3. Renamed IsWindowsServerCodename19H1 to IsWindowsServerVersion1903
4. Added a new IsWindowsServerCodename19H2 method.
PJN / 20-04-2019 1. Fixed a small typo in the test app provided in the download
PJN / 21-05-2019 1. Added support for the following product types: PRODUCT_XBOX_SYSTEMOS, PRODUCT_XBOX_NATIVEOS,
PRODUCT_XBOX_GAMEOS, PRODUCT_XBOX_ERAOS & PRODUCT_XBOX_HOSTOS
PJN / 03-07-2019 1. Updated the detection logic in IsWindows10Version19H2 & IsWindows10Version1903 in light
of the details about 19H2 announced at
https://blogs.windows.com/windowsexperience/2019/07/01/announcing-windows-10-insider-preview-build-18362-10000-19h2/
PJN / 11-08-2019 1. Added support for PRODUCT_XBOX_SCARLETTHOSTOS product type.
2. Renamed product type value PRODUCT_XBOX_HOSTOS to PRODUCT_XBOX_DURANGOHOSTOS.
PJN / 20-08-2019 1. Fixed some further compiler warnings when using VC 2019 Preview v16.3.0 Preview 2.0
PJN / 15-09-2018 1. Renamed IsWindows10Codename19H2 method to IsWindows10Version1909.
PJN / 25-09-2019 1. Updated the logic in IsWindowsServerCodename19H2 to be consistent with IsWindows10Version1909.
2. Added a new IsWindowsServerCodename20H1 method.
3. Updated the logic in IsWindowsServerVersion1903 to be consistent with IsWindows10Version1903.
PJN / 18-09-2018 1. Renamed IsWindowsServerCodename19H2 method to IsWindowsServerVersion1909.
2. Renamed IsLite method to IsWindows10X.
PJN / 26-12-2019 1. Fixed various Clang-Tidy static code analysis warnings in the code.
2. Added support for detecting Windows 10 "Active Development Branch" as announced at
https://blogs.windows.com/windowsexperience/2019/12/16/announcing-windows-10-insider-preview-build-19536/
3. Renamed IsWindowsServerCodename20H1 method to IsWindowsServerVersion2004
PJN / 11-04-2020 1. Updated copyright details.
2. Fixed more Clang-Tidy static code analysis warnings in the code.
3. Added support for the following product types: PRODUCT_AZURESTACKHCI_SERVER_CORE
4. Added support for returning the information from the Windows 10 RtlGetDeviceFamilyInfoEnum API.This addition allows
DtWinVer to return true version information even if the process in which the DtWinVer code is running with OS Version
compatibility mode shims applied.
PJN / 17-05-2020 1. Added support for Windows Server vNext (aka the version of Windows Server after Windows Server version 2004).
PJN / 16-06-2020 1. Provided a new IsWindows10Codename20H2 method.
PJN / 12-08-2020 1. Added support for the following product types: PRODUCT_DATACENTER_SERVER_AZURE_EDITION and
PRODUCT_DATACENTER_SERVER_CORE_AZURE_EDITION
PJN / 11-11-2020 1. Renamed IsWindows10Codename20H2 method to IsWindows10Version20H2.
PJN / 18-02-2021 1. Provided a new IsWindows10Version21H1 method.
2. Updated copyright details.
PJN / 03-03-2021 1. Provided new IsWindowsServer2022, IsWebWindowsServer2022, IsStandardWindowsServer2022,
IsEnterpriseWindowsServer2022, IsDatacenterWindowsServer2022 & IsDomainControllerWindowsServer2022 methods
2. Updated logic in IsWindows10OrWindowsServer2016, IsWindowsServer2019, IsWindowsServerVersion1909,
IsWindowsServerVersion2004 & IsWindows10Version1909 methods.
PJN / 16-06-2021 1. Updated code to support Windows 11 as revealed at
https://www.theverge.com/2021/6/15/22535123/microsoft-windows-11-leak-screenshots-start-menu.
PJN / 17-07-2021 1. Provided a new IsWindows10Version21H2 method.
PJN / 18-07-2021 1. Added support for the following product types: PRODUCT_AZURE_SERVER_CLOUDHOST,
PRODUCT_AZURE_SERVER_CLOUDMOS, PRODUCT_CLOUDEDITIONN & PRODUCT_CLOUDEDITION
PJN / 04-09-2021 1. Provided new IsWindows11Version21H2 & IsWindows11ActiveDevelopmentBranch methods
2. Renamed IsWindows10RTM to IsWindows10Version1507
PJN / 10-09-2021 1. Provided a new IsWindowsServerVersion20H2 method.
2. Updated the logic in IsWindowsServerVersion2004.
PJN / 13-01-2022 1. Updated copyright details.
2. Added support in the test app for detecting DEVICEFAMILYDEVICEFORM_XBOX_SERIES_S
PJN / 20-01-2022 1. Reworked and renamed IsWindowsServervNext to IsWindowsServer2019ActiveDevelopmentBranch
2. Provided new IsWindowsServer2022ActiveDevelopmentBranch method.
3. Reworked IsWindowsServer2022 method.
4. Reworked IsWindowsServer2019 method.
5. Reworked IsWindows11ActiveDevelopmentBranch method.
6. Reworked IsWindows10ActiveDevelopmentBranch method.
7. Reworked IsWindows11 method.
PJN / 24-03-2022 1. Added support for the following product types: PRODUCT_XBOX_KEYSTONE
PJN / 08-06-2022 1. Provided a new IsWindows11Version22H2 method.
PJN / 28-07-2022 1. Provided a new IsWindows10Version21H2 method.
PJN / 25-09-2022 1. Added support for the following product types: PRODUCT_IOTENTERPRISESK
PJN / 13-07-2023 1. Updated copyright details.
2. Provided a new IsWindows11Version23H2 method.
PJN / 28-07-2023 1. Added support for the following product types: PRODUCT_VALIDATION
PJN / 08-11-2023 1. Added support for the following product types: PRODUCT_IOTENTERPRISEK,
PRODUCT_IOTENTERPRISESEVAL & PRODUCT_WNC
PJN / 10-11-2023 1. Updated logic to handle the product types: PRODUCT_IOTENTERPRISESK,
PRODUCT_IOTENTERPRISES, PRODUCT_IOTENTERPRISESEVAL & PRODUCT_IOTENTERPRISE
PJN / 11-11-2023 1. Updated logic to handle the product types: PRODUCT_SERVER_FOR_SB_SOLUTIONS,
PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM, PRODUCT_STANDARD_SERVER_SOLUTIONS,
PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE, PRODUCT_IOTENTERPRISES, PRODUCT_IOTENTERPRISESK,
PRODUCT_IOTENTERPRISEK & PRODUCT_UNLICENSED.
2. Provided a new IsUnlicensed method.
3. Provided a new IsServerForSBSolutions method.
4. Provided a new IsServerSolutions method.
PJN / 04-01-2024 1. Updated copyright details.
2. UBR number is now reported by test app on Windows 11 and Windows Server 2022
3. Added support for the following product types: PRODUCT_AZURE_SERVER_AGENTBRIDGE
& PRODUCT_AZURE_SERVER_NANOHOST.
PJN / 27-01-2024 1. Provided a new IsWindowsServerVersion23H2 method.
2. Provided a new IsWindowsServer2025 method.
3. Provided a new IsWebWindowsServer2025 method.
4. Provided a new IsStandardWindowsServer2025 method.
5. Provided a new IsEnterpriseWindowsServer2025 method.
6. Provided a new IsDatacenterWindowsServer2025 method.
7. Provided a new IsDomainControllerWindowsServer2025 method.
PJN / 07-04-2024 1. Provided a new IsWindows11Version24H2 method.
Copyright (c) 1997 - 2024 by PJ Naughter (Web: www.naughter.com, Email: [email protected])
All rights reserved.
Copyright / Usage Details:
You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise)
when your product is released in binary form. You are allowed to modify the source code in any way you want
except you cannot modify the copyright details at the top of each module. If you want to distribute source
code with your application, then you are only allowed to distribute versions released by the author. This is
to maintain a single distribution point for the source code.
*/
///////////////////////////////// Includes ////////////////////////////////////
#include "stdafx.h"
#include "Dtwinver.h"
///////////////////////////////// Macros / Defines ////////////////////////////
#ifndef VER_NT_WORKSTATION
#define VER_NT_WORKSTATION 0x0000001
#endif //#ifndef VER_NT_WORKSTATION
#ifndef VER_NT_DOMAIN_CONTROLLER
#define VER_NT_DOMAIN_CONTROLLER 0x0000002
#endif //#ifndef VER_NT_DOMAIN_CONTROLLER
#ifndef VER_NT_SERVER
#define VER_NT_SERVER 0x0000003
#endif //#ifndef VER_NT_SERVER
#ifndef PROCESSOR_ARCHITECTURE_SHX
#define PROCESSOR_ARCHITECTURE_SHX 4
#endif //#ifndef PROCESSOR_ARCHITECTURE_SHX
#ifndef PROCESSOR_ARCHITECTURE_ARM
#define PROCESSOR_ARCHITECTURE_ARM 5
#endif //#ifndef PROCESSOR_ARCHITECTURE_ARM
#ifndef PROCESSOR_ARCHITECTURE_IA64
#define PROCESSOR_ARCHITECTURE_IA64 6
#endif //#ifndef PROCESSOR_ARCHITECTURE_IA64
#ifndef PROCESSOR_ARCHITECTURE_ALPHA64
#define PROCESSOR_ARCHITECTURE_ALPHA64 7
#endif //#ifndef PROCESSOR_ARCHITECTURE_ALPHA64
#ifndef PROCESSOR_ARCHITECTURE_MSIL
#define PROCESSOR_ARCHITECTURE_MSIL 8
#endif //#ifndef PROCESSOR_ARCHITECTURE_MSIL
#ifndef PROCESSOR_ARCHITECTURE_AMD64
#define PROCESSOR_ARCHITECTURE_AMD64 9
#endif //#ifndef PROCESSOR_ARCHITECTURE_AMD64
#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10
#endif //#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
#ifndef PROCESSOR_ARCHITECTURE_NEUTRAL
#define PROCESSOR_ARCHITECTURE_NEUTRAL 11
#endif //#ifndef PROCESSOR_ARCHITECTURE_NEUTRAL
#ifndef PROCESSOR_ARCHITECTURE_ARM64
#define PROCESSOR_ARCHITECTURE_ARM64 12
#endif //#ifndef PROCESSOR_ARCHITECTURE_ARM64
#ifndef PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64
#define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13
#endif //#ifndef PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64
#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_ARM64
#define PROCESSOR_ARCHITECTURE_IA32_ON_ARM64 14
#endif //#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_ARM64
#ifndef SM_TABLETPC
#define SM_TABLETPC 86
#endif //#ifndef SM_TABLETPC
#ifndef SM_MEDIACENTER
#define SM_MEDIACENTER 87
#endif //#ifndef SM_MEDIACENTER
#ifndef SM_STARTER
#define SM_STARTER 88
#endif //#ifndef SM_STARTER
#ifndef SM_SERVERR2
#define SM_SERVERR2 89
#endif //#ifndef SM_SERVERR2
#ifndef VER_SUITE_SMALLBUSINESS
#define VER_SUITE_SMALLBUSINESS 0x00000001
#endif //#ifndef VER_SUITE_SMALLBUSINESS
#ifndef VER_SUITE_ENTERPRISE
#define VER_SUITE_ENTERPRISE 0x00000002
#endif //#ifndef VER_SUITE_ENTERPRISE
#ifndef VER_SUITE_BACKOFFICE
#define VER_SUITE_BACKOFFICE 0x00000004
#endif //#ifndef VER_SUITE_BACKOFFICE
#ifndef VER_SUITE_COMMUNICATIONS
#define VER_SUITE_COMMUNICATIONS 0x00000008
#endif //#ifndef VER_SUITE_COMMUNICATIONS
#ifndef VER_SUITE_TERMINAL
#define VER_SUITE_TERMINAL 0x00000010
#endif //#ifndef VER_SUITE_TERMINAL
#ifndef VER_SUITE_SMALLBUSINESS_RESTRICTED
#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020
#endif //#ifndef VER_SUITE_SMALLBUSINESS_RESTRICTED
#ifndef VER_SUITE_EMBEDDEDNT
#define VER_SUITE_EMBEDDEDNT 0x00000040
#endif //#ifndef VER_SUITE_EMBEDDEDNT
#ifndef VER_SUITE_DATACENTER
#define VER_SUITE_DATACENTER 0x00000080
#endif //#ifndef VER_SUITE_DATACENTER
#ifndef VER_SUITE_SINGLEUSERTS
#define VER_SUITE_SINGLEUSERTS 0x00000100
#endif //#ifndef VER_SUITE_SINGLEUSERTS
#ifndef VER_SUITE_PERSONAL
#define VER_SUITE_PERSONAL 0x00000200
#endif //#ifndef VER_SUITE_PERSONAL
#ifndef VER_SUITE_BLADE
#define VER_SUITE_BLADE 0x00000400
#endif //#ifndef VER_SUITE_BLADE
#ifndef VER_SUITE_EMBEDDED_RESTRICTED
#define VER_SUITE_EMBEDDED_RESTRICTED 0x00000800
#endif //#ifndef VER_SUITE_EMBEDDED_RESTRICTED
#ifndef VER_SUITE_SECURITY_APPLIANCE
#define VER_SUITE_SECURITY_APPLIANCE 0x00001000
#endif //#ifndef VER_SUITE_SECURITY_APPLIANCE
#ifndef VER_SUITE_STORAGE_SERVER
#define VER_SUITE_STORAGE_SERVER 0x00002000
#endif //#ifndef VER_SUITE_STORAGE_SERVER
#ifndef VER_SUITE_COMPUTE_SERVER
#define VER_SUITE_COMPUTE_SERVER 0x00004000
#endif //#ifndef VER_SUITE_COMPUTE_SERVER
#ifndef VER_SUITE_WH_SERVER
#define VER_SUITE_WH_SERVER 0x00008000
#endif //#ifndef VER_SUITE_WH_SERVER
//Flags returned from GetProductInfo
#ifndef PRODUCT_ULTIMATE
#define PRODUCT_ULTIMATE 0x00000001
#endif //#ifndef PRODUCT_ULTIMATE
#ifndef PRODUCT_HOME_BASIC
#define PRODUCT_HOME_BASIC 0x00000002
#endif //#ifndef PRODUCT_HOME_BASIC
#ifndef PRODUCT_HOME_PREMIUM
#define PRODUCT_HOME_PREMIUM 0x00000003
#endif //#ifndef PRODUCT_HOME_PREMIUM
#ifndef PRODUCT_ENTERPRISE
#define PRODUCT_ENTERPRISE 0x00000004
#endif //#ifndef PRODUCT_ENTERPRISE
#ifndef PRODUCT_HOME_BASIC_N
#define PRODUCT_HOME_BASIC_N 0x00000005
#endif //#ifndef PRODUCT_HOME_BASIC_N
#ifndef PRODUCT_BUSINESS
#define PRODUCT_BUSINESS 0x00000006
#endif //#ifndef PRODUCT_BUSINESS
#ifndef PRODUCT_STANDARD_SERVER
#define PRODUCT_STANDARD_SERVER 0x00000007
#endif //#ifndef PRODUCT_STANDARD_SERVER
#ifndef PRODUCT_DATACENTER_SERVER
#define PRODUCT_DATACENTER_SERVER 0x00000008
#endif //#ifndef PRODUCT_DATACENTER_SERVER
#ifndef PRODUCT_SMALLBUSINESS_SERVER
#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
#endif //#ifndef PRODUCT_SMALLBUSINESS_SERVER
#ifndef PRODUCT_ENTERPRISE_SERVER
#define PRODUCT_ENTERPRISE_SERVER 0x0000000A
#endif //#ifndef PRODUCT_ENTERPRISE_SERVER
#ifndef PRODUCT_STARTER
#define PRODUCT_STARTER 0x0000000B
#endif //#ifndef PRODUCT_STARTER
#ifndef PRODUCT_DATACENTER_SERVER_CORE
#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
#endif //#ifndef PRODUCT_DATACENTER_SERVER_CORE
#ifndef PRODUCT_STANDARD_SERVER_CORE
#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
#endif //#ifndef PRODUCT_STANDARD_SERVER_CORE
#ifndef PRODUCT_ENTERPRISE_SERVER_CORE
#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
#endif //#ifndef PRODUCT_ENTERPRISE_SERVER_CORE
#ifndef PRODUCT_ENTERPRISE_SERVER_IA64
#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
#endif //#ifndef PRODUCT_ENTERPRISE_SERVER_IA64
#ifndef PRODUCT_BUSINESS_N
#define PRODUCT_BUSINESS_N 0x00000010
#endif //#ifndef PRODUCT_BUSINESS_N
#ifndef PRODUCT_WEB_SERVER
#define PRODUCT_WEB_SERVER 0x00000011
#endif //#ifndef PRODUCT_WEB_SERVER
#ifndef PRODUCT_CLUSTER_SERVER
#define PRODUCT_CLUSTER_SERVER 0x00000012
#endif //#ifndef PRODUCT_CLUSTER_SERVER
#ifndef PRODUCT_HOME_SERVER
#define PRODUCT_HOME_SERVER 0x00000013
#endif //#ifndef PRODUCT_HOME_SERVER
#ifndef PRODUCT_STORAGE_EXPRESS_SERVER
#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
#endif //#ifndef PRODUCT_STORAGE_EXPRESS_SERVER
#ifndef PRODUCT_STORAGE_STANDARD_SERVER
#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
#endif //#ifndef PRODUCT_STORAGE_STANDARD_SERVER
#ifndef PRODUCT_STORAGE_WORKGROUP_SERVER
#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
#endif //#ifndef PRODUCT_STORAGE_WORKGROUP_SERVER
#ifndef PRODUCT_STORAGE_ENTERPRISE_SERVER
#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
#endif //#ifndef PRODUCT_STORAGE_ENTERPRISE_SERVER
#ifndef PRODUCT_SERVER_FOR_SMALLBUSINESS
#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
#endif //#ifndef PRODUCT_SERVER_FOR_SMALLBUSINESS
#ifndef PRODUCT_SMALLBUSINESS_SERVER_PREMIUM
#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
#endif //#ifndef PRODUCT_SMALLBUSINESS_SERVER_PREMIUM
#ifndef PRODUCT_HOME_PREMIUM_N
#define PRODUCT_HOME_PREMIUM_N 0x0000001A
#endif //#ifndef PRODUCT_HOME_PREMIUM_N
#ifndef PRODUCT_ENTERPRISE_N
#define PRODUCT_ENTERPRISE_N 0x0000001B
#endif //#ifndef PRODUCT_ENTERPRISE_N
#ifndef PRODUCT_ULTIMATE_N
#define PRODUCT_ULTIMATE_N 0x0000001C
#endif //#ifndef PRODUCT_ULTIMATE_N
#ifndef PRODUCT_WEB_SERVER_CORE
#define PRODUCT_WEB_SERVER_CORE 0x0000001D
#endif //#ifndef PRODUCT_WEB_SERVER_CORE
#ifndef PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT
#define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E
#endif //#ifndef PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT
#ifndef PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY
#define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F
#endif //#ifndef PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY
#ifndef PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING
#define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
#endif //#ifndef PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING
#ifndef PRODUCT_SERVER_FOUNDATION
#define PRODUCT_SERVER_FOUNDATION 0x00000021
#endif //#ifndef PRODUCT_SERVER_FOUNDATION
#ifndef PRODUCT_HOME_PREMIUM_SERVER
#define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
#endif //#ifndef PRODUCT_HOME_PREMIUM_SERVER
#ifndef PRODUCT_SERVER_FOR_SMALLBUSINESS_V
#define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
#endif //#ifndef PRODUCT_SERVER_FOR_SMALLBUSINESS_V
#ifndef PRODUCT_STANDARD_SERVER_V
#define PRODUCT_STANDARD_SERVER_V 0x00000024
#endif //#ifndef PRODUCT_STANDARD_SERVER_V
#ifndef PRODUCT_DATACENTER_SERVER_V
#define PRODUCT_DATACENTER_SERVER_V 0x00000025
#endif //#ifndef PRODUCT_DATACENTER_SERVER_V
#ifndef PRODUCT_ENTERPRISE_SERVER_V
#define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
#endif //#ifndef PRODUCT_ENTERPRISE_SERVER_V
#ifndef PRODUCT_DATACENTER_SERVER_CORE_V
#define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
#endif //#ifndef PRODUCT_DATACENTER_SERVER_CORE_V
#ifndef PRODUCT_STANDARD_SERVER_CORE_V
#define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
#endif //#ifndef PRODUCT_STANDARD_SERVER_CORE_V
#ifndef PRODUCT_ENTERPRISE_SERVER_CORE_V
#define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
#endif //#ifndef PRODUCT_ENTERPRISE_SERVER_CORE_V
#ifndef PRODUCT_HYPERV
#define PRODUCT_HYPERV 0x0000002A
#endif //#ifndef PRODUCT_HYPERV
#ifndef PRODUCT_STORAGE_EXPRESS_SERVER_CORE
#define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B
#endif //#ifndef PRODUCT_STORAGE_EXPRESS_SERVER_CORE
#ifndef PRODUCT_STORAGE_STANDARD_SERVER_CORE
#define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C
#endif //#ifndef PRODUCT_STORAGE_STANDARD_SERVER_CORE
#ifndef PRODUCT_STORAGE_WORKGROUP_SERVER_CORE
#define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D
#endif //#ifndef PRODUCT_STORAGE_WORKGROUP_SERVER_CORE
#ifndef PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE
#define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E
#endif //#ifndef PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE
#ifndef PRODUCT_STARTER_N
#define PRODUCT_STARTER_N 0x0000002F
#endif //#ifndef PRODUCT_STARTER_N
#ifndef PRODUCT_PROFESSIONAL
#define PRODUCT_PROFESSIONAL 0x00000030
#endif //#ifndef PRODUCT_PROFESSIONAL
#ifndef PRODUCT_PROFESSIONAL_N
#define PRODUCT_PROFESSIONAL_N 0x00000031
#endif //#ifndef PRODUCT_PROFESSIONAL_N
#ifndef PRODUCT_SB_SOLUTION_SERVER
#define PRODUCT_SB_SOLUTION_SERVER 0x00000032
#endif //#ifndef PRODUCT_SB_SOLUTION_SERVER
#ifndef PRODUCT_SERVER_FOR_SB_SOLUTIONS
#define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
#endif //#ifndef PRODUCT_SERVER_FOR_SB_SOLUTIONS
#ifndef PRODUCT_STANDARD_SERVER_SOLUTIONS
#define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
#endif //#ifndef PRODUCT_STANDARD_SERVER_SOLUTIONS
#ifndef PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE
#define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
#endif //#ifndef PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE
#ifndef PRODUCT_SB_SOLUTION_SERVER_EM
#define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
#endif //#ifndef PRODUCT_SB_SOLUTION_SERVER_EM
#ifndef PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM
#define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
#endif //#ifndef PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM
#ifndef PRODUCT_SOLUTION_EMBEDDEDSERVER
#define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
#endif //#ifndef PRODUCT_SOLUTION_EMBEDDEDSERVER
#ifndef PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE
#define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039
#endif //#ifndef PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE
#ifndef PRODUCT_PROFESSIONAL_EMBEDDED
#define PRODUCT_PROFESSIONAL_EMBEDDED 0x0000003A
#endif //#ifndef PRODUCT_PROFESSIONAL_EMBEDDED
#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT
#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
#endif //#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT
#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL
#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
#endif //#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL
#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC
#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
#endif //#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC
#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC
#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
#endif //#ifndef PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC
#ifndef PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE
#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F
#endif //#ifndef PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE
#ifndef PRODUCT_CLUSTER_SERVER_V
#define PRODUCT_CLUSTER_SERVER_V 0x00000040
#endif //#ifndef PRODUCT_CLUSTER_SERVER_V
#ifndef PRODUCT_EMBEDDED
#define PRODUCT_EMBEDDED 0x00000041
#endif //#ifndef PRODUCT_EMBEDDED
#ifndef PRODUCT_STARTER_E
#define PRODUCT_STARTER_E 0x00000042
#endif //#ifndef PRODUCT_STARTER_E
#ifndef PRODUCT_HOME_BASIC_E
#define PRODUCT_HOME_BASIC_E 0x00000043
#endif //#ifndef PRODUCT_HOME_BASIC_E
#ifndef PRODUCT_HOME_PREMIUM_E
#define PRODUCT_HOME_PREMIUM_E 0x00000044
#endif //#ifndef PRODUCT_HOME_PREMIUM_E
#ifndef PRODUCT_PROFESSIONAL_E
#define PRODUCT_PROFESSIONAL_E 0x00000045
#endif //#ifndef PRODUCT_PROFESSIONAL_E
#ifndef PRODUCT_ENTERPRISE_E
#define PRODUCT_ENTERPRISE_E 0x00000046
#endif //#ifndef PRODUCT_ENTERPRISE_E
#ifndef PRODUCT_ULTIMATE_E
#define PRODUCT_ULTIMATE_E 0x00000047
#endif //#ifndef PRODUCT_ULTIMATE_E
#ifndef PRODUCT_ENTERPRISE_EVALUATION
#define PRODUCT_ENTERPRISE_EVALUATION 0x00000048
#endif //#ifndef PRODUCT_ENTERPRISE_EVALUATION
#ifndef PRODUCT_PRERELEASE
#define PRODUCT_PRERELEASE 0x0000004A
#endif //#ifndef PRODUCT_PRERELEASE
#ifndef PRODUCT_MULTIPOINT_STANDARD_SERVER
#define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C
#endif //#ifndef PRODUCT_MULTIPOINT_STANDARD_SERVER
#ifndef PRODUCT_MULTIPOINT_PREMIUM_SERVER
#define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D
#endif //#ifndef PRODUCT_MULTIPOINT_PREMIUM_SERVER
#ifndef PRODUCT_STANDARD_EVALUATION_SERVER
#define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F
#endif //#ifndef PRODUCT_STANDARD_EVALUATION_SERVER
#ifndef PRODUCT_DATACENTER_EVALUATION_SERVER
#define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050
#endif //#ifndef PRODUCT_DATACENTER_EVALUATION_SERVER
#ifndef PRODUCT_PRERELEASE_ARM
#define PRODUCT_PRERELEASE_ARM 0x00000051
#endif //#ifndef PRODUCT_PRERELEASE_ARM
#ifndef PRODUCT_PRERELEASE_N
#define PRODUCT_PRERELEASE_N 0x00000052
#endif //#ifndef PRODUCT_PRERELEASE_N
#ifndef PRODUCT_ENTERPRISE_N_EVALUATION
#define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054
#endif //#ifndef PRODUCT_ENTERPRISE_N_EVALUATION
#ifndef PRODUCT_EMBEDDED_AUTOMOTIVE
#define PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055
#endif //#ifndef PRODUCT_EMBEDDED_AUTOMOTIVE
#ifndef PRODUCT_EMBEDDED_INDUSTRY_A
#define PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056
#endif //#ifndef PRODUCT_EMBEDDED_INDUSTRY_A
#ifndef PRODUCT_THINPC
#define PRODUCT_THINPC 0x00000057
#endif //#ifndef PRODUCT_THINPC