diff options
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index e8dfb4b..31cf389 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -7,6 +7,8 @@ #include <shlobj.h> #include <wininet.h> +#include <atlsecurity.h> + #include "base/file_util.h" #include "base/file_version_info.h" #include "base/lazy_instance.h" @@ -1127,6 +1129,19 @@ bool IsIBrowserServicePatchEnabled() { return patch_method == PATCH_METHOD_IBROWSER; } +bool IsSystemProcess() { + bool is_system = false; + CAccessToken process_token; + if (process_token.GetProcessToken(TOKEN_QUERY, GetCurrentProcess())) { + CSid logon_sid; + if (process_token.GetUser(&logon_sid)) { + is_system = logon_sid == Sids::System(); + } + } + return is_system; +} + + std::string BindStatus2Str(ULONG bind_status) { std::string s; static const char* const bindstatus_txt[] = { |