mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Corporate environment detection not working correctly
This commit is contained in:
@@ -749,13 +749,14 @@ namespace hex {
|
||||
DSROLE_PRIMARY_DOMAIN_INFO_BASIC * info;
|
||||
if ((DsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE *)&info) == ERROR_SUCCESS) && (info != nullptr))
|
||||
{
|
||||
bool result = std::wstring(info->DomainNameFlat).empty();
|
||||
bool result = std::wstring(info->DomainNameFlat) != L"WORKGROUP";
|
||||
DsRoleFreeMemory(info);
|
||||
|
||||
return result;
|
||||
} else {
|
||||
DWORD size = 1024;
|
||||
::GetComputerNameExA(ComputerNameDnsDomain, nullptr, &size);
|
||||
DWORD size = 128;
|
||||
char buffer[128];
|
||||
::GetComputerNameExA(ComputerNameDnsDomain, buffer, &size);
|
||||
return size > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user