diff --git a/src/constants.h b/src/constants.h index 00e444c..769487b 100644 --- a/src/constants.h +++ b/src/constants.h @@ -6,8 +6,6 @@ #include #include -#include "resource.h" - #define assert(x) /*nothing*/ #ifndef __FUNC__ @@ -30,8 +28,12 @@ static const IID licenseAgentIID2 = {0x6A07C5A3, 0x9C67, 0x4BB6, {0xB0, 0x20, 0x const LPCWSTR XP_MISMATCH = L"It seems you are not running Windows XP, \nwould you like to run the program anyway \nin debug mode for testing?"; -__inline static constexpr float XP_NTVER = 5.1f; +inline static constexpr unsigned long WIN_2K = 0x0500UL; +inline static constexpr unsigned long WIN_XP = 0x0501UL; +inline static constexpr unsigned long WIN_2003 = 0x0502UL; +inline static constexpr unsigned long WIN_VISTA = 0x0600UL; +inline static constexpr unsigned long WIN_7 = 0x0601UL; -__inline static constexpr float XP64_NTVER = 5.2f; +constexpr char kUtf8ByteOrderMark[] = "\xEF\xBB\xBF"; #endif // XP_ACTIVATE32_CONSTANTS_H_ diff --git a/src/framework.h b/src/framework.h index d0242ba..686174b 100644 --- a/src/framework.h +++ b/src/framework.h @@ -12,19 +12,31 @@ #define _UNICODE #endif +#if defined(_M_X64) || defined(__amd64__) || defined(_WIN64) + inline static constexpr bool IsAMD64 = true; + #ifndef _WIN64 + #define _WIN64 + #endif +#else + inline static constexpr bool IsAMD64 = false; +#endif // defined(_M_X64) || defined(__amd64__) || defined(_WIN64) + #ifndef WINVER #define WINVER 0x0501 #endif // WINVER + #ifndef _WIN32_WINNT - #if defined(_M_X64) || defined(__amd64__) || defined(_WIN64) + #ifdef _WIN64 #define _WIN32_WINNT 0x0502 // Windows XP x64/Server 2003 #else #define _WIN32_WINNT 0x0501 // Windows XP x86 - #endif // defined(_M_X64) || defined(__amd64__) || defined(_WIN64) + #endif // _WIN64 #endif // _WIN32_WINNT + #ifndef _WIN64_WINNT #define _WIN64_WINNT 0x0502 // Minimum version for 64 bit #endif // _WIN64_WINNT + #ifndef _WIN32_IE #define _WIN32_IE 0x0600 // Minimum Internet Explorer version #endif // _WIN32_IE @@ -40,5 +52,10 @@ #include #include #include +#include +#include #include +#include #include +#include +#include