libobs: Log whether user is running as administrator
parent
cbc1f63990
commit
50aec61d39
|
@ -181,6 +181,25 @@ static void log_windows_version(void)
|
||||||
ver.major, ver.minor, ver.build, ver.revis);
|
ver.major, ver.minor, ver.build, ver.revis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void log_admin_status(void)
|
||||||
|
{
|
||||||
|
SID_IDENTIFIER_AUTHORITY auth = SECURITY_NT_AUTHORITY;
|
||||||
|
PSID admin_group;
|
||||||
|
BOOL success;
|
||||||
|
|
||||||
|
success = AllocateAndInitializeSid(&auth, 2,
|
||||||
|
SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,
|
||||||
|
0, 0, 0, 0, 0, 0, &admin_group);
|
||||||
|
if (success) {
|
||||||
|
if (!CheckTokenMembership(NULL, admin_group, &success))
|
||||||
|
success = false;
|
||||||
|
FreeSid(admin_group);
|
||||||
|
}
|
||||||
|
|
||||||
|
blog(LOG_INFO, "Running as administrator: %s",
|
||||||
|
success ? "true" : "false");
|
||||||
|
}
|
||||||
|
|
||||||
typedef HRESULT (WINAPI *dwm_is_composition_enabled_t)(BOOL*);
|
typedef HRESULT (WINAPI *dwm_is_composition_enabled_t)(BOOL*);
|
||||||
|
|
||||||
static void log_aero(void)
|
static void log_aero(void)
|
||||||
|
@ -219,6 +238,7 @@ void log_system_info(void)
|
||||||
log_processor_cores();
|
log_processor_cores();
|
||||||
log_available_memory();
|
log_available_memory();
|
||||||
log_windows_version();
|
log_windows_version();
|
||||||
|
log_admin_status();
|
||||||
log_aero();
|
log_aero();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue