Skip DXGI device discovery if Win32k system calls are disabled - #29755
Merged
adrastogi merged 4 commits intoJul 23, 2026
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens Windows device discovery for sandboxed processes by avoiding DXGI-based D3D12 adapter enumeration when Win32k system calls are disabled, preventing an access violation during DXGI factory initialization under Win32k lockdown.
Changes:
- Gate both SetupDi-based discovery and D3D12/DXGI-based discovery behind a Win32k-disallowed mitigation policy check.
- Preserve device enumeration via DXCore-only paths under Win32k lockdown (CPU still falls back to CPUID).
- Update inline comments and logging to reflect the expanded skip behavior.
shiyi (shiyi9801)
force-pushed
the
skip_dxgi_if_win32k_lockdown
branch
from
July 20, 2026 03:19
19ae009 to
fc3552a
Compare
Contributor
Author
|
Hi, adrastogi Scott McKay (@skottmckay) Could you take a look? thanks! |
Contributor
adrastogi
previously approved these changes
Jul 21, 2026
adrastogi
left a comment
Contributor
There was a problem hiding this comment.
One nit, but looks good to me otherwise.
37 tasks
Scott McKay (skottmckay)
previously approved these changes
Jul 22, 2026
shiyi (shiyi9801)
dismissed stale reviews from Scott McKay (skottmckay) and adrastogi
via
July 23, 2026 06:09
62c5a6e
Contributor
Author
|
Looks like Lint / Python format (pull_request) failed. I updated the code with clang formatted. Please help merge this PR if it looks good to you, thanks! |
Scott McKay (skottmckay)
approved these changes
Jul 23, 2026
adrastogi
added a commit
that referenced
this pull request
Aug 12, 2026
This was referenced Aug 19, 2026
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Skip DXGI device discovery when Win32k system calls are disabled.
DXGI internally calls
gdi32!DdQueryDisplaySettingsUniqueness, which reads from the GDI shared memory section. Under Win32k lockdown this section may not be mapped (depending on the host's gdi32 initialization strategy), causing an access violation.Motivation and Context
WebNN is migrating ORT graph compilation to a sandboxed process with PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY.DisallowWin32kSystemCalls enabled. This prevents calls through GDI for security hardening.
This change has no effect on normal (unsandboxed) processes.