This commit is contained in:
Reece Wilson 2023-08-27 18:34:28 +01:00
parent b8458990c9
commit 6a3b278ea0
2 changed files with 16 additions and 2 deletions

View File

@ -91,7 +91,6 @@ namespace Aurora
ADD_GET_PROC(Nt, NtQueryInformationProcess) ADD_GET_PROC(Nt, NtQueryInformationProcess)
ADD_GET_PROC(Nt, NtNotifyChangeDirectoryFile) ADD_GET_PROC(Nt, NtNotifyChangeDirectoryFile)
ADD_GET_PROC(Nt, NtTerminateProcess) ADD_GET_PROC(Nt, NtTerminateProcess)
ADD_GET_PROC(Nt, VerSetConditionMask)
ADD_GET_PROC_BI(Kernel32, KernelBase, VirtualAlloc2) ADD_GET_PROC_BI(Kernel32, KernelBase, VirtualAlloc2)
ADD_GET_PROC_BI(Kernel32, KernelBase, MapViewOfFile3) ADD_GET_PROC_BI(Kernel32, KernelBase, MapViewOfFile3)
@ -115,6 +114,7 @@ namespace Aurora
ADD_GET_PROC(Kernel32, GetLocaleInfoW) ADD_GET_PROC(Kernel32, GetLocaleInfoW)
ADD_GET_PROC(Kernel32, GetThreadId) ADD_GET_PROC(Kernel32, GetThreadId)
ADD_GET_PROC(Kernel32, VerifyVersionInfoW) ADD_GET_PROC(Kernel32, VerifyVersionInfoW)
ADD_GET_PROC(Kernel32, VerSetConditionMask)
ADD_GET_PROC_BI2(Kernel32, PSAPILegacy, K32GetProcessMemoryInfo, GetProcessMemoryInfo) ADD_GET_PROC_BI2(Kernel32, PSAPILegacy, K32GetProcessMemoryInfo, GetProcessMemoryInfo)

View File

@ -72,6 +72,20 @@ namespace Aurora::SWInfo
return strValue.size(); return strValue.size();
} }
static void Win32SetIsServer(OSInformation &osInfo)
{
if (!pVerSetConditionMask ||
!pVerifyVersionInfoW)
{
return;
}
OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION };
const DWORDLONG dwlConditionMask = pVerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL);
osInfo.bIsServer = !pVerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask);
}
#endif #endif
void InitNTInfo(OSInformation &osInfo) void InitNTInfo(OSInformation &osInfo)
@ -82,7 +96,7 @@ namespace Aurora::SWInfo
osInfo = AuMove(OSInformation(&gKernelString, &gUserlandBrand, &gUserlandDesktopEnv, &gBuildString, Aurora::Build::EPlatform::eEnumInvalid)); osInfo = AuMove(OSInformation(&gKernelString, &gUserlandBrand, &gUserlandDesktopEnv, &gBuildString, Aurora::Build::EPlatform::eEnumInvalid));
#if defined(AURORA_PLATFORM_WIN32) #if defined(AURORA_PLATFORM_WIN32)
osInfo.bIsServer = IsWindowsServer(); Win32SetIsServer(osInfo);
osInfo.bIsEnterprise = osInfo.bIsServer;//IsWindowsEnterpriseBranch(); osInfo.bIsEnterprise = osInfo.bIsServer;//IsWindowsEnterpriseBranch();
#else #else
osInfo.bIsServer = false; osInfo.bIsServer = false;