Correctly document 'ConsentUIElevationReason' based on ELEVATION_REASON enum from Windows headers. Update tests to match

This commit is contained in:
James Spencer
2024-09-01 18:52:42 +10:00
parent e4ddea5267
commit 97fb10713f
8 changed files with 90 additions and 43 deletions
@@ -23,7 +23,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
Assert.AreEqual(3, d.SessionId);
Assert.AreEqual((IntPtr)0x0000000000010128, d.HWnd);
Assert.AreEqual((ConsentUIElevationType)6, d.ElevationType);
Assert.AreEqual(ConsentUIElevationReason.Request, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", d.ExecutablePath);
Assert.AreEqual("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", d.Unknown1);
@@ -42,7 +42,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther, d.Flags);
Assert.AreEqual(3, d.SessionId);
Assert.AreEqual((IntPtr)0x0000000000230370, d.HWnd);
Assert.AreEqual((ConsentUIElevationType)5, d.ElevationType);
Assert.AreEqual(ConsentUIElevationReason.Msi, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual("7-Zip 23.01 (x64 edition)", d.ProductName);
Assert.AreEqual(ConsentUIMsiAction.Install, d.Action);
@@ -65,7 +65,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual( ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
Assert.AreEqual(3, d.SessionId);
Assert.AreEqual((IntPtr)0x0, d.HWnd);
Assert.AreEqual((ConsentUIElevationType)8, d.ElevationType);
Assert.AreEqual(ConsentUIElevationReason.PackagedApp, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual("\"C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2023.807.0_x64__8wekyb3d8bbwe\\MsixPackageTool.exe\" ", d.CommandLine);
Assert.AreEqual("C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2023.807.0_x64__8wekyb3d8bbwe\\MsixPackageTool.exe", d.ExecutablePath);
@@ -84,7 +84,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual(ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther | ConsentUIFlags.InWindowsDirectory, d.Flags);
Assert.AreEqual(3, d.SessionId);
Assert.AreEqual((IntPtr)0x00000000000903c2, d.HWnd);
Assert.AreEqual((ConsentUIElevationType)4, d.ElevationType);
Assert.AreEqual(ConsentUIElevationReason.CLSID, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual(new Guid("{3ad05575-8857-4850-9277-11b85bdb8e09}"), d.ClsId);
Assert.AreEqual("C:\\Windows\\system32\\windows.storage.dll", d.ComComponentPath);