Skip to content

Commit

Permalink
Pin shell32.dll in ppapi processes
Browse files Browse the repository at this point in the history
Due to an OS bug shell32.dll may get unloaded while still in use.
Pinning shell32.dll avoids this and the associated crashes with no
downside.

This is an expansion of the fix in crrev.com/c/2505835

Bug: 1076771
Change-Id: I89153998a5dabb345db0435877201de771a60b5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2588012
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836825}
  • Loading branch information
randomascii authored and Chromium LUCI CQ committed Dec 14, 2020
1 parent d508d81 commit 34c05bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions content/ppapi_plugin/ppapi_plugin_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
const base::CommandLine& command_line = parameters.command_line;

#if defined(OS_WIN)
// https://crbug.com/1139752 Premature unload of shell32 caused process to
// crash during process shutdown.
HMODULE shell32_pin = ::LoadLibrary(L"shell32.dll");
UNREFERENCED_PARAMETER(shell32_pin);

g_target_services = parameters.sandbox_info->target_services;
#endif

Expand Down

0 comments on commit 34c05bf

Please sign in to comment.