ReactOS 0.4.16-dev-125-g798ea90
versionhelpers.h File Reference
#include <specstrings.h>
Include dependency graph for versionhelpers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _versionhelpers_H_INCLUDED_
 
#define VERSIONHELPERAPI   FORCEINLINE BOOL
 

Functions

VERSIONHELPERAPI IsWindowsVersionOrGreater (WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)
 
VERSIONHELPERAPI IsWindowsXPOrGreater ()
 
VERSIONHELPERAPI IsWindowsXPSP1OrGreater ()
 
VERSIONHELPERAPI IsWindowsXPSP2OrGreater ()
 
VERSIONHELPERAPI IsWindowsXPSP3OrGreater ()
 
VERSIONHELPERAPI IsWindowsVistaOrGreater ()
 
VERSIONHELPERAPI IsWindowsVistaSP1OrGreater ()
 
VERSIONHELPERAPI IsWindowsVistaSP2OrGreater ()
 
VERSIONHELPERAPI IsWindows7OrGreater ()
 
VERSIONHELPERAPI IsWindows7SP1OrGreater ()
 
VERSIONHELPERAPI IsWindows8OrGreater ()
 
VERSIONHELPERAPI IsWindows8Point1OrGreater ()
 
VERSIONHELPERAPI IsWindowsThresholdOrGreater ()
 
VERSIONHELPERAPI IsWindows10OrGreater ()
 
VERSIONHELPERAPI IsWindowsServer ()
 
VERSIONHELPERAPI IsActiveSessionCountLimited ()
 

Macro Definition Documentation

◆ _versionhelpers_H_INCLUDED_

#define _versionhelpers_H_INCLUDED_

Definition at line 24 of file versionhelpers.h.

◆ VERSIONHELPERAPI

#define VERSIONHELPERAPI   FORCEINLINE BOOL

Definition at line 31 of file versionhelpers.h.

Function Documentation

◆ IsActiveSessionCountLimited()

VERSIONHELPERAPI IsActiveSessionCountLimited ( )

Definition at line 132 of file versionhelpers.h.

133{
134 OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0, 0, 0, 0 };
135 DWORDLONG dwlConditionMask = VerSetConditionMask(0, VER_SUITENAME, VER_AND);
136 BOOL fSuiteTerminal, fSuiteSingleUserTS;
137
138 osvi.wSuiteMask = VER_SUITE_TERMINAL;
139 fSuiteTerminal = VerifyVersionInfoW(&osvi, VER_SUITENAME, dwlConditionMask);
140
141 osvi.wSuiteMask = VER_SUITE_SINGLEUSERTS;
142 fSuiteSingleUserTS = VerifyVersionInfoW(&osvi, VER_SUITENAME, dwlConditionMask);
143
144 return !(fSuiteTerminal & !fSuiteSingleUserTS);
145}
BOOL WINAPI VerifyVersionInfoW(IN LPOSVERSIONINFOEXW lpVersionInformation, IN DWORD dwTypeMask, IN DWORDLONG dwlConditionMask)
Definition: version.c:118
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long long DWORDLONG
Definition: intsafe.h:93
#define VER_AND
Definition: rtltypes.h:244
#define VER_SUITENAME
Definition: rtltypes.h:234
#define VER_SUITE_TERMINAL
#define VER_SUITE_SINGLEUSERTS
ULONGLONG NTAPI VerSetConditionMask(IN ULONGLONG ConditionMask, IN ULONG TypeMask, IN UCHAR Condition)
Definition: version.c:262
OSVERSIONINFO osvi
Definition: ver.c:28

◆ IsWindows10OrGreater()

VERSIONHELPERAPI IsWindows10OrGreater ( )

Definition at line 118 of file versionhelpers.h.

119{
120 return IsWindowsVersionOrGreater(10, 0, 0);
121}
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindows7OrGreater()

◆ IsWindows7SP1OrGreater()

VERSIONHELPERAPI IsWindows7SP1OrGreater ( )

Definition at line 94 of file versionhelpers.h.

95{
96 return IsWindowsVersionOrGreater(6, 1, 1);
97}

◆ IsWindows8OrGreater()

VERSIONHELPERAPI IsWindows8OrGreater ( )

Definition at line 100 of file versionhelpers.h.

101{
102 return IsWindowsVersionOrGreater(6, 2, 0);
103}

◆ IsWindows8Point1OrGreater()

VERSIONHELPERAPI IsWindows8Point1OrGreater ( )

Definition at line 106 of file versionhelpers.h.

107{
108 return IsWindowsVersionOrGreater(6, 3, 0);
109}

◆ IsWindowsServer()

VERSIONHELPERAPI IsWindowsServer ( )

Definition at line 124 of file versionhelpers.h.

125{
126 OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION };
127 DWORDLONG const dwlConditionMask = VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL);
128 return VerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask) == FALSE;
129}
#define FALSE
Definition: types.h:117
#define VER_EQUAL
Definition: rtltypes.h:239
#define VER_PRODUCT_TYPE
Definition: rtltypes.h:235
#define VER_NT_WORKSTATION

◆ IsWindowsThresholdOrGreater()

VERSIONHELPERAPI IsWindowsThresholdOrGreater ( )

Definition at line 112 of file versionhelpers.h.

113{
114 return IsWindowsVersionOrGreater(10, 0, 0);
115}

◆ IsWindowsVersionOrGreater()

VERSIONHELPERAPI IsWindowsVersionOrGreater ( WORD  wMajorVersion,
WORD  wMinorVersion,
WORD  wServicePackMajor 
)

◆ IsWindowsVistaOrGreater()

◆ IsWindowsVistaSP1OrGreater()

VERSIONHELPERAPI IsWindowsVistaSP1OrGreater ( )

Definition at line 76 of file versionhelpers.h.

77{
78 return IsWindowsVersionOrGreater(6, 0, 1);
79}

◆ IsWindowsVistaSP2OrGreater()

VERSIONHELPERAPI IsWindowsVistaSP2OrGreater ( )

Definition at line 82 of file versionhelpers.h.

83{
84 return IsWindowsVersionOrGreater(6, 0, 2);
85}

◆ IsWindowsXPOrGreater()

VERSIONHELPERAPI IsWindowsXPOrGreater ( )

Definition at line 46 of file versionhelpers.h.

47{
48 return IsWindowsVersionOrGreater(5, 1, 0);
49}

Referenced by TEST_StrDupA(), and TEST_StrDupW().

◆ IsWindowsXPSP1OrGreater()

VERSIONHELPERAPI IsWindowsXPSP1OrGreater ( )

Definition at line 52 of file versionhelpers.h.

53{
54 return IsWindowsVersionOrGreater(5, 1, 1);
55}

◆ IsWindowsXPSP2OrGreater()

VERSIONHELPERAPI IsWindowsXPSP2OrGreater ( )

Definition at line 58 of file versionhelpers.h.

59{
60 return IsWindowsVersionOrGreater(5, 1, 2);
61}

◆ IsWindowsXPSP3OrGreater()

VERSIONHELPERAPI IsWindowsXPSP3OrGreater ( )

Definition at line 64 of file versionhelpers.h.

65{
66 return IsWindowsVersionOrGreater(5, 1, 3);
67}