Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Unified Diff: remoting/host/it2me/it2me_native_messaging_host_main.cc

Issue 2961333002: Fix field trials not working in utility processes. (Closed)
Patch Set: review comment Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/it2me/it2me_native_messaging_host_main.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host_main.cc b/remoting/host/it2me/it2me_native_messaging_host_main.cc
index 129d7e1818afb2c8fd3d05e102d7cf7b75143418..8bf9a2883ccb10ab6a171e90516fcf6f2533f4ec 100644
--- a/remoting/host/it2me/it2me_native_messaging_host_main.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host_main.cc
@@ -40,11 +40,30 @@
#include <commctrl.h>
#include "remoting/host/switches.h"
-#include "remoting/host/win/elevation_helpers.h"
#endif // defined(OS_WIN)
namespace remoting {
+namespace {
+
+#if defined(OS_WIN) && defined(OFFICIAL_BUILD)
+bool CurrentProcessHasUiAccess() {
+ HANDLE process_token;
+ OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &process_token);
+
+ DWORD size;
+ DWORD uiaccess_value = 0;
+ if (!GetTokenInformation(process_token, TokenUIAccess, &uiaccess_value,
+ sizeof(uiaccess_value), &size)) {
+ PLOG(ERROR) << "GetTokenInformation() failed";
+ }
+ CloseHandle(process_token);
+ return uiaccess_value != 0;
+}
+#endif // defined(OS_WIN) && defined(OFFICIAL_BUILD)
+
+} // namespace
+
// Creates a It2MeNativeMessagingHost instance, attaches it to stdin/stdout and
// runs the message loop until It2MeNativeMessagingHost signals shutdown.
int It2MeNativeMessagingHostMain(int argc, char** argv) {

Powered by Google App Engine
This is Rietveld 408576698