Skip to content

Commit

Permalink
Bug 1950905 - Assert that win32k is available in native event code. r…
Browse files Browse the repository at this point in the history
…=bobowen

Native event processing requires the creation of an event window,
which isn't possible under win32k lockdown, resulting in a MOZ_CRASH.
This change adds an assertion about the state of win32k lockdown to
differentiate crashes that would occur because of win32k lockdown from
crashes that would occur for other reasons. This only affects the
GPU process (through nsAppShell::PrecacheEventWindow) because, since
bug 1950112, nsAppShell::Init now avoids native event processing if
win32k is unavailable.

Differential Revision: https://phabricator.services.mozilla.com/D239987
  • Loading branch information
yjugl committed Feb 28, 2025
1 parent 5fd69dc commit 76160ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions widget/windows/nsAppShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ WindowsDiagnosticsError CollectUser32SingleStepData(
//
/* static */ [[clang::optnone]] MOZ_NEVER_INLINE HWND
nsAppShell::StaticCreateEventWindow() {
// This code path would fail at CreateWindowW under win32k lockdown.
MOZ_RELEASE_ASSERT(!IsWin32kLockedDown());

// note the incoming error-state; this may be relevant to errors we get later
auto _initialErr [[maybe_unused]] = WinErrorState::Get();
// reset the error-state, to avoid ambiguity below
Expand Down

0 comments on commit 76160ed

Please sign in to comment.