Use newer versionHelper API if available

This commit is contained in:
mazmazz 2018-12-13 18:27:38 -05:00
parent b9950b1cd1
commit 0aa247dbf2
3 changed files with 15 additions and 0 deletions

View file

@ -152,11 +152,16 @@ int main(int argc, char **argv)
// XP and Vista users can't use the newest exchndl.dll
// and older exchndl.dll won't work with release builds >= 2.1.21
// Check for >= Version 6.1 (>= Win7)
#if defined(_INC_VERSIONHELPERS) || defined(_versionhelpers_H_INCLUDED_)
if (IsWindows7OrGreater())
LoadLibraryA("exchndl.dll");
#else
DWORD winversion = GetVersion();
DWORD major = (DWORD)(LOBYTE(LOWORD(winversion)));
DWORD minor = (DWORD)(HIBYTE(LOWORD(winversion)));
if (major > 6 || (major == 6 && minor > 0))
LoadLibraryA("exchndl.dll");
#endif
}
}
#ifndef __MINGW32__

View file

@ -221,11 +221,16 @@ int main(int argc, char **argv)
// XP and Vista users can't use the newest exchndl.dll
// and older exchndl.dll won't work with release builds >= 2.1.21
// Check for >= Version 6.1 (>= Win7)
#if defined(_INC_VERSIONHELPERS) || defined(_versionhelpers_H_INCLUDED_)
if (IsWindows7OrGreater())
LoadLibraryA("exchndl.dll");
#else
DWORD winversion = GetVersion();
DWORD major = (DWORD)(LOBYTE(LOWORD(winversion)));
DWORD minor = (DWORD)(HIBYTE(LOWORD(winversion)));
if (major > 6 || (major == 6 && minor > 0))
LoadLibraryA("exchndl.dll");
#endif
}
}
#endif

View file

@ -668,11 +668,16 @@ int WINAPI WinMain (HINSTANCE hInstance,
// XP and Vista users can't use the newest exchndl.dll
// and older exchndl.dll won't work with release builds >= 2.1.21
// Check for >= Version 6.1 (Win7)
#if defined(_INC_VERSIONHELPERS) || defined(_versionhelpers_H_INCLUDED_)
if (IsWindows7OrGreater())
LoadLibraryA("exchndl.dll");
#else
DWORD winversion = GetVersion();
DWORD major = (DWORD)(LOBYTE(LOWORD(winversion)));
DWORD minor = (DWORD)(HIBYTE(LOWORD(winversion)));
if (major > 6 || (major == 6 && minor > 0))
LoadLibraryA("exchndl.dll");
#endif
#if 0
}
#endif