libobs: Log whether user is running as administrator

master
jp9000 2016-08-06 20:00:48 -07:00
parent cbc1f63990
commit 50aec61d39
1 changed files with 20 additions and 0 deletions

View File

@ -181,6 +181,25 @@ static void log_windows_version(void)
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*);
static void log_aero(void)
@ -219,6 +238,7 @@ void log_system_info(void)
log_processor_cores();
log_available_memory();
log_windows_version();
log_admin_status();
log_aero();
}