From 82c323c59b9ccc10bdaed2ce6dc041702a967e46 Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Thu, 27 Nov 2025 14:09:17 -0800 Subject: [PATCH] update framework.h to not need winsdkver.h/sdkddkver.h, add initial support for cr_base library --- BUILD.gn | 9 ++++++--- src/framework.h | 18 +++++++----------- src/xp_activate32.cc | 4 ++++ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 6751d26..9482134 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -8,7 +8,6 @@ import("//build/config/win/manifest.gni") executable("xp_activate32") { configs -= [ "//build/config/win:console", - "//build/config/win:nominmax", ] configs += [ @@ -29,8 +28,6 @@ precompiled_header("precompiled") { } source_set("xp_activate32_sources") { - configs -= [ "//build/config/win:nominmax", ] - # Must explicitly set this for sources configs += [ "//build/config/win:windowed", ] @@ -57,12 +54,18 @@ source_set("xp_activate32_sources") { "src/utils.cc", "src/xp_activate32.cc", ] + + public_deps = [ + "../cr_base:cr_base" + ] } # Program-specific build config config("xp_activate32_config") { + defines = [] cflags = [] ldflags = [] + defines += [ "USING_CR_BASE" ] libs = [ "comctl32.lib", "kernel32.lib", diff --git a/src/framework.h b/src/framework.h index 4b86960..d0242ba 100644 --- a/src/framework.h +++ b/src/framework.h @@ -12,18 +12,18 @@ #define _UNICODE #endif -#ifndef __MINGW32__ - #include -#endif // not __MINGW32__ - #ifndef WINVER - #define WINVER _WIN32_WINNT_WINXP + #define WINVER 0x0501 #endif // WINVER #ifndef _WIN32_WINNT - #define _WIN32_WINNT _WIN32_WINNT_WINXP + #if defined(_M_X64) || defined(__amd64__) || defined(_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 // _WIN32_WINNT #ifndef _WIN64_WINNT - #define _WIN64_WINNT _WIN32_WINNT_WS03s // Minimum version for 64 bit + #define _WIN64_WINNT 0x0502 // Minimum version for 64 bit #endif // _WIN64_WINNT #ifndef _WIN32_IE #define _WIN32_IE 0x0600 // Minimum Internet Explorer version @@ -35,10 +35,6 @@ #define _ATL_XP_TARGETING #endif // _ATL_XP_TARGETING -#ifndef __MINGW32__ - #include -#endif // not __MINGW32__ - #include #include #include diff --git a/src/xp_activate32.cc b/src/xp_activate32.cc index 6be1e9b..80de7bc 100644 --- a/src/xp_activate32.cc +++ b/src/xp_activate32.cc @@ -1,5 +1,9 @@ #include "xp_activate32.h" +#ifdef USING_CR_BASE + #include "base/logging.h" +#endif // USING_CR_BASE + #include "keygen.h" #include "utils.h"