From 18d70e6e57840a86f59a220dad5c1c201fa68812 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Tue, 14 May 2019 15:42:39 -0700 Subject: [PATCH] pin user32 on startup https://chromium-review.googlesource.com/c/chromium/src/+/1551709 Loading it later causes a blocking call where blocking calls aren't allowed. --- atom/app/atom_main_delegate.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/atom/app/atom_main_delegate.cc b/atom/app/atom_main_delegate.cc index 518ca75c9320..316e1dedcfb6 100644 --- a/atom/app/atom_main_delegate.cc +++ b/atom/app/atom_main_delegate.cc @@ -49,6 +49,10 @@ #include "atom/app/atom_main_delegate_mac.h" #endif +#if defined(OS_WIN) +#include "base/win/win_util.h" +#endif + namespace atom { namespace { @@ -183,6 +187,9 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { // Disable the ActiveVerifier, which is used by Chrome to track possible // bugs, but no use in Electron. base::win::DisableHandleVerifier(); + + if (IsBrowserProcess(command_line)) + base::win::PinUser32(); #endif content_client_ = std::make_unique();