Update names of ConsentUIElevationReason struct members

This commit is contained in:
James Spencer
2024-09-01 20:46:37 +10:00
parent 97fb10713f
commit 27fe73e32e
4 changed files with 29 additions and 10 deletions
@@ -65,7 +65,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual( ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags); Assert.AreEqual( ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
Assert.AreEqual(3, d.SessionId); Assert.AreEqual(3, d.SessionId);
Assert.AreEqual((IntPtr)0x0, d.HWnd); Assert.AreEqual((IntPtr)0x0, d.HWnd);
Assert.AreEqual(ConsentUIElevationReason.PackagedApp, d.ElevationReason); Assert.AreEqual(ConsentUIElevationReason.Msix, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType); 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.CommandLine);
Assert.AreEqual("C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2023.807.0_x64__8wekyb3d8bbwe\\MsixPackageTool.exe", d.ExecutablePath); 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(ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther | ConsentUIFlags.InWindowsDirectory, d.Flags);
Assert.AreEqual(3, d.SessionId); Assert.AreEqual(3, d.SessionId);
Assert.AreEqual((IntPtr)0x00000000000903c2, d.HWnd); Assert.AreEqual((IntPtr)0x00000000000903c2, d.HWnd);
Assert.AreEqual(ConsentUIElevationReason.CLSID, d.ElevationReason); Assert.AreEqual(ConsentUIElevationReason.Clsid, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType); Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual(new Guid("{3ad05575-8857-4850-9277-11b85bdb8e09}"), d.ClsId); Assert.AreEqual(new Guid("{3ad05575-8857-4850-9277-11b85bdb8e09}"), d.ClsId);
Assert.AreEqual("C:\\Windows\\system32\\windows.storage.dll", d.ComComponentPath); Assert.AreEqual("C:\\Windows\\system32\\windows.storage.dll", d.ComComponentPath);
@@ -66,7 +66,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual(ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags); Assert.AreEqual(ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
Assert.AreEqual(2, d.SessionId); Assert.AreEqual(2, d.SessionId);
Assert.AreEqual((IntPtr)0x0, d.HWnd); Assert.AreEqual((IntPtr)0x0, d.HWnd);
Assert.AreEqual(ConsentUIElevationReason.PackagedApp, d.ElevationReason); Assert.AreEqual(ConsentUIElevationReason.Msix, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType); Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual("\"C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2024.405.0_x64__8wekyb3d8bbwe\\MsixPackageTool.exe\" ", d.CommandLine); Assert.AreEqual("\"C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2024.405.0_x64__8wekyb3d8bbwe\\MsixPackageTool.exe\" ", d.CommandLine);
Assert.AreEqual("C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2024.405.0_x64__8wekyb3d8bbwe\\MsixPackageTool.exe", d.ExecutablePath); Assert.AreEqual("C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2024.405.0_x64__8wekyb3d8bbwe\\MsixPackageTool.exe", d.ExecutablePath);
@@ -85,7 +85,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual(ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther | ConsentUIFlags.InWindowsDirectory, d.Flags); Assert.AreEqual(ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther | ConsentUIFlags.InWindowsDirectory, d.Flags);
Assert.AreEqual(2, d.SessionId); Assert.AreEqual(2, d.SessionId);
Assert.AreEqual((IntPtr)0x00000000000d021e, d.HWnd); Assert.AreEqual((IntPtr)0x00000000000d021e, d.HWnd);
Assert.AreEqual(ConsentUIElevationReason.CLSID, d.ElevationReason); Assert.AreEqual(ConsentUIElevationReason.Clsid, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType); Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual(new Guid("{3ad05575-8857-4850-9277-11b85bdb8e09}"), d.ClsId); Assert.AreEqual(new Guid("{3ad05575-8857-4850-9277-11b85bdb8e09}"), d.ClsId);
Assert.AreEqual("C:\\WINDOWS\\system32\\windows.storage.dll", d.ComComponentPath); Assert.AreEqual("C:\\WINDOWS\\system32\\windows.storage.dll", d.ComComponentPath);
@@ -65,7 +65,7 @@ namespace Lithnet.CredentialProvider.UnitTests
Assert.AreEqual( ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags); Assert.AreEqual( ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
Assert.AreEqual(2, d.SessionId); Assert.AreEqual(2, d.SessionId);
Assert.AreEqual((IntPtr)0x0, d.HWnd); Assert.AreEqual((IntPtr)0x0, d.HWnd);
Assert.AreEqual(ConsentUIElevationReason.PackagedApp, d.ElevationReason); Assert.AreEqual(ConsentUIElevationReason.Msix, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType); Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual("\"C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2023.807.0_x86__8wekyb3d8bbwe\\MsixPackageTool.exe\" ", d.CommandLine); Assert.AreEqual("\"C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2023.807.0_x86__8wekyb3d8bbwe\\MsixPackageTool.exe\" ", d.CommandLine);
Assert.AreEqual("C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2023.807.0_x86__8wekyb3d8bbwe\\MsixPackageTool.exe", d.ExecutablePath); Assert.AreEqual("C:\\Program Files\\WindowsApps\\Microsoft.MSIXPackagingTool_1.2023.807.0_x86__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(ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther | ConsentUIFlags.InWindowsDirectory, d.Flags);
Assert.AreEqual(2, d.SessionId); Assert.AreEqual(2, d.SessionId);
Assert.AreEqual((IntPtr)0x000b0586, d.HWnd); Assert.AreEqual((IntPtr)0x000b0586, d.HWnd);
Assert.AreEqual(ConsentUIElevationReason.CLSID, d.ElevationReason); Assert.AreEqual(ConsentUIElevationReason.Clsid, d.ElevationReason);
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType); Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
Assert.AreEqual(new Guid("{3ad05575-8857-4850-9277-11b85bdb8e09}"), d.ClsId); Assert.AreEqual(new Guid("{3ad05575-8857-4850-9277-11b85bdb8e09}"), d.ClsId);
Assert.AreEqual("C:\\Windows\\system32\\windows.storage.dll", d.ComComponentPath); Assert.AreEqual("C:\\Windows\\system32\\windows.storage.dll", d.ComComponentPath);
@@ -8,6 +8,8 @@
/// ///
/// > "The AppCompat database stores information in the application /// > "The AppCompat database stores information in the application
/// > compatibility fix entries for an application." /// > compatibility fix entries for an application."
///
/// `ELEVATION_REASON.ELEVATION_REASON_APPCOMPAT_EXPLICIT (ole32.dll)`
/// </summary> /// </summary>
AppCompatExplicit = 0, AppCompatExplicit = 0,
@@ -17,6 +19,8 @@
/// ///
/// > "The AppCompat database stores information in the application /// > "The AppCompat database stores information in the application
/// > compatibility fix entries for an application." /// > compatibility fix entries for an application."
///
/// `ELEVATION_REASON.ELEVATION_REASON_APPCOMPAT_HEURISTIC (ole32.dll)`
/// </summary> /// </summary>
AppCompatHeuristic = 1, AppCompatHeuristic = 1,
@@ -25,8 +29,9 @@
/// > "The Fusion database stores information from application /// > "The Fusion database stores information from application
/// > manifests that describe the applications. The manifest schema /// > manifests that describe the applications. The manifest schema
/// > is updated to add a new requested execution level field." /// > is updated to add a new requested execution level field."
///
/// See also: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#trustinfo /// See also: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#trustinfo
///
/// `ELEVATION_REASON.ELEVATION_REASON_FUSION (ole32.dll)`
/// </summary> /// </summary>
Fusion = 2, Fusion = 2,
@@ -34,36 +39,50 @@
/// Automatically detected Windows Installer package (e.g. an EXE installer) /// Automatically detected Windows Installer package (e.g. an EXE installer)
/// > "Installer detection detects setup files, which helps prevent installations /// > "Installer detection detects setup files, which helps prevent installations
/// > from being run without the user's knowledge and consent." /// > from being run without the user's knowledge and consent."
///
/// `ELEVATION_REASON.ELEVATION_REASON_INSTALLER (ole32.dll)`
/// </summary> /// </summary>
Installer = 3, Installer = 3,
/// <summary> /// <summary>
/// COM elevation action /// COM elevation action
///
/// `ELEVATION_REASON.ELEVATION_REASON_CLSID (ole32.dll)`
/// </summary> /// </summary>
CLSID = 4, Clsid = 4,
/// <summary> /// <summary>
/// Windows Installer package installation (MSI) /// Windows Installer package installation (MSI)
///
/// `ELEVATION_REASON.ELEVATION_REASON_MSI (ole32.dll)`
/// </summary> /// </summary>
Msi = 5, Msi = 5,
/// <summary> /// <summary>
/// "Run as Administrator..." (e.g. manual UAC) /// "Run as Administrator..." (e.g. manual UAC)
///
/// `ELEVATION_REASON.ELEVATION_REASON_REQUEST (ole32.dll)`
/// </summary> /// </summary>
Request = 6, Request = 6,
/// <summary> /// <summary>
/// ActiveX Installer Service (AXIS) /// ActiveX Installer Service (AXIS)
///
/// `ELEVATION_REASON.ELEVATION_REASON_AXIS (ole32.dll)`
/// </summary> /// </summary>
AxIS = 7, Axis = 7,
/// <summary> /// <summary>
/// Packaged Applications (MSIX / APPX) /// Packaged Applications (MSIX / APPX)
///
/// `ELEVATION_REASON.ELEVATION_REASON_PACKAGED_APP (ole32.dll)`
/// </summary> /// </summary>
PackagedApp = 8, Msix = 8,
/// <summary> /// <summary>
/// Unknown /// Unknown
///
/// `ELEVATION_REASON.ELEVATION_REASON_NUM_REASONS (ole32.dll)`
/// </summary> /// </summary>
NumReasons = 9, NumReasons = 9,
} }