onnxruntime
a8baf5c4 - Skip SetupDi device discovery if Win32k system calls are disabled (#28535)

Commit
104 days ago
Skip SetupDi device discovery if Win32k system calls are disabled (#28535) ### Description Skip SetupDi device discovery when Win32k system calls are disabled. `SetupDiGetClassDevs` depends on win32k.sys and will crash with an SEH exception that cannot be caught by C++ try/catch. ``` 00 0000004f`545fb2b0 00007ffa`a47a8911 KERNELBASE!RaiseException+0x8a 01 0000004f`545fb3b0 00007ffa`a47e014d SETUPAPI!_delayLoadHelper2+0x521 02 0000004f`545fb460 00007ffa`a479e1af SETUPAPI!_tailMerge_user32_dll+0x3f 03 0000004f`545fb4d0 00007ffa`a479d791 SETUPAPI!IsInteractiveWindowStation+0x113 04 0000004f`545fb560 00007ffa`a479d484 SETUPAPI!AllocateDeviceInfoSet+0x121 05 0000004f`545fb5c0 00007ffa`a479c6bd SETUPAPI!SetupDiCreateDeviceInfoListExW+0x74 06 0000004f`545fb870 00007ffa`a479c2d6 SETUPAPI!SetupDiGetClassDevsExW+0x1ed 07 0000004f`545fb8f0 00007ff9`b6d12a72 SETUPAPI!SetupDiGetClassDevsA+0x76 08 0000004f`545fb960 00007ff9`b6d10aeb onnxruntime!onnxruntime::`anonymous namespace'::GetDeviceInfoSetupApi+0x1a2 ``` ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> WebNN is migrating ORT graph compilation to a sandboxed process with PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY.DisallowWin32kSystemCalls enabled. This prevents kernel-mode system calls through win32k.sys for security hardening. This change has no effect on normal (unsandboxed) processes.
Author
Parents
Loading