Allow system lock down test debug hook to work with new wldp API (fixes system lock down tests) (#18962)

This commit is contained in:
Paul Higinbotham 2023-01-18 14:24:34 -08:00 committed by GitHub
parent 3fb4bb277b
commit 5f8f15a24c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,9 +110,9 @@ namespace System.Management.Automation.Security
{
SafeHandle fileHandle = fileStream.SafeFileHandle;
// First check latest WDAC APIs if available.
// First check latest WDAC APIs if available. Also revert to legacy APIs if debug hook is in effect.
Exception errorException = null;
if (s_wldpCanExecuteAvailable)
if (s_wldpCanExecuteAvailable && !s_allowDebugOverridePolicy)
{
try
{