Files
xp_activate32/src/utils.h
T
2025-12-04 20:23:32 -06:00

74 lines
1.7 KiB
C++

#ifndef XP_ACTIVATE32_UTILS_H_
#define XP_ACTIVATE32_UTILS_H_
#ifdef __MINGW32__
extern "C" {
static __inline__ __attribute__((always_inline)) unsigned long long __emulu(
const unsigned int a, const unsigned int b) {
unsigned long long retval;
__asm__("mull %[b]" : "=A"(retval) : [a] "a"(a), [b] "rm"(b));
return retval;
}
#define __noop(...) ((void)0)
}
#endif // __MINGW32__
#include <intrin.h>
#include "constants.h"
#include "framework.h"
#include "globals.h"
#include "resource.h"
#include "strings.h"
#include "version.h"
extern wchar_t strings[16][256];
static std::string NT_FEATURE_VERSION;
static std::string NT_POST_STRING;
// Function to load arbitrary .ico from arbitrary .dll
HANDLE LoadImageFromDLL(LPCWSTR dllName,
UINT resourceId,
UINT imgType,
int width,
int height,
UINT flags);
// Decide what icon to use for main dialog
HICON getDialogIcon(bool use_custom_icon, int resource, int x, int y);
// App version getter functions
std::string getVersionA();
std::wstring getVersionW();
// Converts version ints to float we can read
float concatToFloat(int major, int minor);
// Windows version getter functions
bool getWinNTVersion();
extern unsigned long WinVer;
std::string const GetOSNameA();
std::wstring const GetOSNameW();
std::string const GetWinVersionA();
std::wstring const GetWinVersionW();
// Debug functions
inline void NotReachedImpl(std::string func_name);
#ifndef NOTREACHED
#define NOTREACHED() \
std::string func_name(__FUNC__); \
NotReachedImpl(func_name);
#endif // NOTREACHED
#endif // XP_ACTIVATE32_UTILS_H_