mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
fix versionhelpers for legacy build
This commit is contained in:
parent
1017b235a4
commit
6f4339f16a
@ -29,13 +29,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
|
#if (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
|
||||||
#define RtlVerifyVersionInfo(a,b,c) 1
|
|
||||||
#define VerifyVersionInfoW(a,b,c) 0
|
#define VerifyVersionInfoW(a,b,c) 0
|
||||||
#define VerSetConditionMask(a,b,c) 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void verhelp_init();
|
void verhelp_init();
|
||||||
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask);
|
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask);
|
||||||
|
ULONGLONG verhelp_set_mask(ULONGLONG ConditionMask, DWORD TypeMask, BYTE Condition);
|
||||||
const char* verhelp_wine_get_version();
|
const char* verhelp_wine_get_version();
|
||||||
void verhelp_wine_get_host_version(const char** sysname, const char** release);
|
void verhelp_wine_get_host_version(const char** sysname, const char** release);
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ VERSIONHELPERAPI IsWindowsVersionOrGreater(DWORD major, DWORD minor, DWORD build
|
|||||||
{
|
{
|
||||||
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},servpack };
|
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},servpack };
|
||||||
return verhelp_verify_version(&vi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_SERVICEPACKMAJOR,
|
return verhelp_verify_version(&vi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_SERVICEPACKMAJOR,
|
||||||
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
|
verhelp_set_mask(verhelp_set_mask(verhelp_set_mask(verhelp_set_mask(0,
|
||||||
VER_MAJORVERSION, VER_GREATER_EQUAL),
|
VER_MAJORVERSION, VER_GREATER_EQUAL),
|
||||||
VER_MINORVERSION, VER_GREATER_EQUAL),
|
VER_MINORVERSION, VER_GREATER_EQUAL),
|
||||||
VER_BUILDNUMBER, VER_GREATER_EQUAL),
|
VER_BUILDNUMBER, VER_GREATER_EQUAL),
|
||||||
@ -54,7 +53,7 @@ VERSIONHELPERAPI IsWindowsVersion(DWORD major, DWORD minor, DWORD build, WORD se
|
|||||||
{
|
{
|
||||||
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},servpack };
|
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},servpack };
|
||||||
return verhelp_verify_version(&vi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_SERVICEPACKMAJOR,
|
return verhelp_verify_version(&vi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_SERVICEPACKMAJOR,
|
||||||
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
|
verhelp_set_mask(verhelp_set_mask(verhelp_set_mask(verhelp_set_mask(0,
|
||||||
VER_MAJORVERSION, VER_EQUAL),
|
VER_MAJORVERSION, VER_EQUAL),
|
||||||
VER_MINORVERSION, VER_EQUAL),
|
VER_MINORVERSION, VER_EQUAL),
|
||||||
VER_BUILDNUMBER, VER_GREATER_EQUAL),
|
VER_BUILDNUMBER, VER_GREATER_EQUAL),
|
||||||
@ -65,7 +64,7 @@ VERSIONHELPERAPI IsWindowsVersionAnySP(DWORD major, DWORD minor, DWORD build)
|
|||||||
{
|
{
|
||||||
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},0 };
|
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},0 };
|
||||||
return verhelp_verify_version(&vi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_SERVICEPACKMAJOR,
|
return verhelp_verify_version(&vi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_SERVICEPACKMAJOR,
|
||||||
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
|
verhelp_set_mask(verhelp_set_mask(verhelp_set_mask(verhelp_set_mask(0,
|
||||||
VER_MAJORVERSION, VER_EQUAL),
|
VER_MAJORVERSION, VER_EQUAL),
|
||||||
VER_MINORVERSION, VER_EQUAL),
|
VER_MINORVERSION, VER_EQUAL),
|
||||||
VER_BUILDNUMBER, VER_GREATER_EQUAL),
|
VER_BUILDNUMBER, VER_GREATER_EQUAL),
|
||||||
@ -134,7 +133,7 @@ VERSIONHELPERAPI IsWindows11OrGreater(void) {
|
|||||||
|
|
||||||
VERSIONHELPERAPI IsWindowsServer(void) {
|
VERSIONHELPERAPI IsWindowsServer(void) {
|
||||||
OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION};
|
OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION};
|
||||||
return !verhelp_verify_version(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL));
|
return !verhelp_verify_version(&vi, VER_PRODUCT_TYPE, verhelp_set_mask(0, VER_PRODUCT_TYPE, VER_EQUAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
VERSIONHELPERAPI IsWindowsXP(void) {
|
VERSIONHELPERAPI IsWindowsXP(void) {
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
#include "versionhelpers.h"
|
#include "versionhelpers.h"
|
||||||
|
|
||||||
typedef NTSTATUS(WINAPI* RTLVERIFYVERSIONINFOPROC)(PRTL_OSVERSIONINFOEXW, ULONG, ULONGLONG);
|
typedef NTSTATUS(WINAPI* RTLVERIFYVERSIONINFOPROC)(PRTL_OSVERSIONINFOEXW, ULONG, ULONGLONG);
|
||||||
|
typedef ULONGLONG(WINAPI* VERSETCONDITIONMASKPROC)(ULONGLONG, DWORD, BYTE);
|
||||||
typedef const char* (CDECL* WINE_GET_VERSIONPROC)();
|
typedef const char* (CDECL* WINE_GET_VERSIONPROC)();
|
||||||
typedef void (CDECL* WINE_GET_HOST_VERSIONPROC)(const char** sysname, const char** release);
|
typedef void (CDECL* WINE_GET_HOST_VERSIONPROC)(const char** sysname, const char** release);
|
||||||
|
|
||||||
static RTLVERIFYVERSIONINFOPROC RtlVerifyVersionInfo;
|
static RTLVERIFYVERSIONINFOPROC RtlVerifyVersionInfo;
|
||||||
|
static VERSETCONDITIONMASKPROC VerSetConditionMaskProc;
|
||||||
static WINE_GET_VERSIONPROC wine_get_version;
|
static WINE_GET_VERSIONPROC wine_get_version;
|
||||||
static WINE_GET_HOST_VERSIONPROC wine_get_host_version;
|
static WINE_GET_HOST_VERSIONPROC wine_get_host_version;
|
||||||
|
|
||||||
@ -19,6 +21,12 @@ void verhelp_init()
|
|||||||
wine_get_version = (WINE_GET_VERSIONPROC)GetProcAddress(mod, "wine_get_version");
|
wine_get_version = (WINE_GET_VERSIONPROC)GetProcAddress(mod, "wine_get_version");
|
||||||
wine_get_host_version = (WINE_GET_HOST_VERSIONPROC)GetProcAddress(mod, "wine_get_host_version");
|
wine_get_host_version = (WINE_GET_HOST_VERSIONPROC)GetProcAddress(mod, "wine_get_host_version");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod = GetModuleHandleA("Kernel32.dll");
|
||||||
|
if (mod)
|
||||||
|
{
|
||||||
|
VerSetConditionMaskProc = (VERSETCONDITIONMASKPROC)GetProcAddress(mod, "VerSetConditionMask");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask)
|
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask)
|
||||||
@ -28,6 +36,11 @@ BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, U
|
|||||||
VerifyVersionInfoW(versionInfo, typeMask, conditionMask);
|
VerifyVersionInfoW(versionInfo, typeMask, conditionMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONGLONG verhelp_set_mask(ULONGLONG ConditionMask, DWORD TypeMask, BYTE Condition)
|
||||||
|
{
|
||||||
|
return VerSetConditionMaskProc ? VerSetConditionMaskProc(ConditionMask, TypeMask, Condition) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
const char* verhelp_wine_get_version()
|
const char* verhelp_wine_get_version()
|
||||||
{
|
{
|
||||||
return wine_get_version ? wine_get_version() : NULL;
|
return wine_get_version ? wine_get_version() : NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user