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 authored and GitHub committed 2023-01-18 14:24:34 -08:00
1 parent 3fb4bb277b
commit 5f8f15a24c
1 file changed
+2 -2
@@ -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
{