Chromium Code Reviews| 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..5f3794805f5c1ab1e693f14c776d1133181092fc 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 |
|
Sergey Ulanov
2017/06/29 23:57:23
// defined(OS_WIN) && defined(OFFICIAL_BUILD)
jam
2017/06/30 14:39:58
Done.
|
| + |
| +} // 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) { |