ReactOS  0.4.15-dev-3182-g7b62228
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 }
#define VER_SUITENAME
Definition: rtltypes.h:232
#define VER_AND
Definition: rtltypes.h:242
ULONGLONG NTAPI VerSetConditionMask(IN ULONGLONG ConditionMask, IN ULONG TypeMask, IN UCHAR Condition)
Definition: version.c:262
OSVERSIONINFO osvi
Definition: ver.c:28
#define VER_SUITE_TERMINAL
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI VerifyVersionInfoW(IN LPOSVERSIONINFOEXW lpVersionInformation, IN DWORD dwTypeMask, IN DWORDLONG dwlConditionMask)
Definition: version.c:118
#define VER_SUITE_SINGLEUSERTS
unsigned long long DWORDLONG
Definition: intsafe.h:93

◆ 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()

VERSIONHELPERAPI IsWindows7OrGreater ( )

Definition at line 88 of file versionhelpers.h.

89 {
90  return IsWindowsVersionOrGreater(6, 1, 0);
91 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

Referenced by CheckValidation(), RunApphelpCacheControlTests(), START_TEST(), Test_FindFirstFileA(), Test_FindFirstFileW(), Test_Flags(), Test_TimeAdjustment(), TestInitialize(), and TestUninitialized().

◆ IsWindows7SP1OrGreater()

VERSIONHELPERAPI IsWindows7SP1OrGreater ( )

Definition at line 94 of file versionhelpers.h.

95 {
96  return IsWindowsVersionOrGreater(6, 1, 1);
97 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindows8OrGreater()

VERSIONHELPERAPI IsWindows8OrGreater ( )

Definition at line 100 of file versionhelpers.h.

101 {
102  return IsWindowsVersionOrGreater(6, 2, 0);
103 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

Referenced by expect_empty_imp().

◆ IsWindows8Point1OrGreater()

VERSIONHELPERAPI IsWindows8Point1OrGreater ( )

Definition at line 106 of file versionhelpers.h.

107 {
108  return IsWindowsVersionOrGreater(6, 3, 0);
109 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ 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 VER_NT_WORKSTATION
ULONGLONG NTAPI VerSetConditionMask(IN ULONGLONG ConditionMask, IN ULONG TypeMask, IN UCHAR Condition)
Definition: version.c:262
OSVERSIONINFO osvi
Definition: ver.c:28
#define VER_PRODUCT_TYPE
Definition: rtltypes.h:233
#define FALSE
Definition: types.h:117
BOOL WINAPI VerifyVersionInfoW(IN LPOSVERSIONINFOEXW lpVersionInformation, IN DWORD dwTypeMask, IN DWORDLONG dwlConditionMask)
Definition: version.c:118
#define VER_EQUAL
Definition: rtltypes.h:237
unsigned long long DWORDLONG
Definition: intsafe.h:93

Referenced by AboutDlgProc().

◆ IsWindowsThresholdOrGreater()

VERSIONHELPERAPI IsWindowsThresholdOrGreater ( )

Definition at line 112 of file versionhelpers.h.

113 {
114  return IsWindowsVersionOrGreater(10, 0, 0);
115 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindowsVersionOrGreater()

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

Definition at line 35 of file versionhelpers.h.

36 {
37  OSVERSIONINFOEXW osvi = { sizeof(osvi), wMajorVersion, wMinorVersion, 0, 0, {0}, wServicePackMajor, 0, 0, 0, 0 };
39  dwlConditionMask = VerSetConditionMask(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
40  dwlConditionMask = VerSetConditionMask(dwlConditionMask, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
41 
43 }
#define VER_MINORVERSION
Definition: rtltypes.h:226
ULONGLONG NTAPI VerSetConditionMask(IN ULONGLONG ConditionMask, IN ULONG TypeMask, IN UCHAR Condition)
Definition: version.c:262
OSVERSIONINFO osvi
Definition: ver.c:28
#define FALSE
Definition: types.h:117
BOOL WINAPI VerifyVersionInfoW(IN LPOSVERSIONINFOEXW lpVersionInformation, IN DWORD dwTypeMask, IN DWORDLONG dwlConditionMask)
Definition: version.c:118
#define VER_MAJORVERSION
Definition: rtltypes.h:227
#define VER_SERVICEPACKMAJOR
Definition: rtltypes.h:231
#define VER_GREATER_EQUAL
Definition: rtltypes.h:239
unsigned long long DWORDLONG
Definition: intsafe.h:93

Referenced by IsWindows10OrGreater(), IsWindows7OrGreater(), IsWindows7SP1OrGreater(), IsWindows8OrGreater(), IsWindows8Point1OrGreater(), IsWindowsThresholdOrGreater(), IsWindowsVistaOrGreater(), IsWindowsVistaSP1OrGreater(), IsWindowsVistaSP2OrGreater(), IsWindowsXPOrGreater(), IsWindowsXPSP1OrGreater(), IsWindowsXPSP2OrGreater(), and IsWindowsXPSP3OrGreater().

◆ IsWindowsVistaOrGreater()

VERSIONHELPERAPI IsWindowsVistaOrGreater ( )

Definition at line 70 of file versionhelpers.h.

71 {
72  return IsWindowsVersionOrGreater(6, 0, 0);
73 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

Referenced by START_TEST().

◆ IsWindowsVistaSP1OrGreater()

VERSIONHELPERAPI IsWindowsVistaSP1OrGreater ( )

Definition at line 76 of file versionhelpers.h.

77 {
78  return IsWindowsVersionOrGreater(6, 0, 1);
79 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindowsVistaSP2OrGreater()

VERSIONHELPERAPI IsWindowsVistaSP2OrGreater ( )

Definition at line 82 of file versionhelpers.h.

83 {
84  return IsWindowsVersionOrGreater(6, 0, 2);
85 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindowsXPOrGreater()

VERSIONHELPERAPI IsWindowsXPOrGreater ( )

Definition at line 46 of file versionhelpers.h.

47 {
48  return IsWindowsVersionOrGreater(5, 1, 0);
49 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindowsXPSP1OrGreater()

VERSIONHELPERAPI IsWindowsXPSP1OrGreater ( )

Definition at line 52 of file versionhelpers.h.

53 {
54  return IsWindowsVersionOrGreater(5, 1, 1);
55 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindowsXPSP2OrGreater()

VERSIONHELPERAPI IsWindowsXPSP2OrGreater ( )

Definition at line 58 of file versionhelpers.h.

59 {
60  return IsWindowsVersionOrGreater(5, 1, 2);
61 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

◆ IsWindowsXPSP3OrGreater()

VERSIONHELPERAPI IsWindowsXPSP3OrGreater ( )

Definition at line 64 of file versionhelpers.h.

65 {
66  return IsWindowsVersionOrGreater(5, 1, 3);
67 }
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)