提交 50aec61d 编写于 作者: J jp9000

libobs: Log whether user is running as administrator

上级 cbc1f639
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册