add is64bitwindows helper
This commit is contained in:
13
wufuc/util.c
13
wufuc/util.c
@@ -86,6 +86,19 @@ BOOL WindowsVersionCompare(BYTE Operator, DWORD dwMajorVersion, DWORD dwMinorVer
|
|||||||
return VerifyVersionInfo(&osvi, dwTypeMask, dwlConditionMask);
|
return VerifyVersionInfo(&osvi, dwTypeMask, dwlConditionMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL Is64BitWindows(void) {
|
||||||
|
#if defined(_WIN64)
|
||||||
|
return TRUE; // 64-bit programs run only on Win64
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
// 32-bit programs run on both 32-bit and 64-bit Windows
|
||||||
|
// so must sniff
|
||||||
|
BOOL f64 = FALSE;
|
||||||
|
return IsWow64Process(GetCurrentProcess(), &f64) && f64;
|
||||||
|
#else
|
||||||
|
return FALSE; // Win64 does not support Win16
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
VOID _wdbgprintf(LPCWSTR format, ...) {
|
VOID _wdbgprintf(LPCWSTR format, ...) {
|
||||||
WCHAR buffer[0x1000];
|
WCHAR buffer[0x1000];
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
|
@@ -20,6 +20,8 @@ VOID ResumeAndCloseThreads(HANDLE *lphThreads, SIZE_T dwSize);
|
|||||||
|
|
||||||
BOOL WindowsVersionCompare(BYTE Operator, DWORD dwMajorVersion, DWORD dwMinorVersion, WORD wServicePackMajor, WORD wServicePackMinor, DWORD dwTypeMask);
|
BOOL WindowsVersionCompare(BYTE Operator, DWORD dwMajorVersion, DWORD dwMinorVersion, WORD wServicePackMajor, WORD wServicePackMinor, DWORD dwTypeMask);
|
||||||
|
|
||||||
|
BOOL Is64BitWindows(void);
|
||||||
|
|
||||||
VOID _wdbgprintf(LPCWSTR format, ...);
|
VOID _wdbgprintf(LPCWSTR format, ...);
|
||||||
VOID _dbgprintf(LPCSTR format, ...);
|
VOID _dbgprintf(LPCSTR format, ...);
|
||||||
//#ifdef _DEBUG
|
//#ifdef _DEBUG
|
||||||
|
Reference in New Issue
Block a user