Merge pull request #17 from lithnet/fix/enum-fixes
Correctly document 'ConsentUIElevationReason' based on ELEVATION_REASON.
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Lithnet.CredentialProvider.UnitTests
|
|||||||
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
|
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
|
||||||
Assert.AreEqual(3, d.SessionId);
|
Assert.AreEqual(3, d.SessionId);
|
||||||
Assert.AreEqual((IntPtr)0x0000000000010128, d.HWnd);
|
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(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.ExecutablePath);
|
||||||
Assert.AreEqual("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", d.Unknown1);
|
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(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther, d.Flags);
|
||||||
Assert.AreEqual(3, d.SessionId);
|
Assert.AreEqual(3, d.SessionId);
|
||||||
Assert.AreEqual((IntPtr)0x0000000000230370, d.HWnd);
|
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(ConsentUIPromptType.Credentials, d.PromptType);
|
||||||
Assert.AreEqual("7-Zip 23.01 (x64 edition)", d.ProductName);
|
Assert.AreEqual("7-Zip 23.01 (x64 edition)", d.ProductName);
|
||||||
Assert.AreEqual(ConsentUIMsiAction.Install, d.Action);
|
Assert.AreEqual(ConsentUIMsiAction.Install, d.Action);
|
||||||
@@ -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((ConsentUIElevationType)8, d.ElevationType);
|
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((ConsentUIElevationType)4, d.ElevationType);
|
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);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Lithnet.CredentialProvider.UnitTests
|
|||||||
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
|
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
|
||||||
Assert.AreEqual(3, d.SessionId);
|
Assert.AreEqual(3, d.SessionId);
|
||||||
Assert.AreEqual((IntPtr)0x0, d.HWnd); // this seems odd
|
Assert.AreEqual((IntPtr)0x0, d.HWnd); // this seems odd
|
||||||
Assert.AreEqual((ConsentUIElevationType)6, d.ElevationType);
|
Assert.AreEqual(ConsentUIElevationReason.Request, d.ElevationReason);
|
||||||
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
|
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.ExecutablePath);
|
||||||
Assert.AreEqual("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", d.Unknown1);
|
Assert.AreEqual("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", d.Unknown1);
|
||||||
@@ -43,7 +43,7 @@ namespace Lithnet.CredentialProvider.UnitTests
|
|||||||
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther, d.Flags);
|
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther, d.Flags);
|
||||||
Assert.AreEqual(2, d.SessionId);
|
Assert.AreEqual(2, d.SessionId);
|
||||||
Assert.AreEqual((IntPtr)0x00000000001e033a, d.HWnd);
|
Assert.AreEqual((IntPtr)0x00000000001e033a, d.HWnd);
|
||||||
Assert.AreEqual((ConsentUIElevationType)5, d.ElevationType);
|
Assert.AreEqual(ConsentUIElevationReason.Msi, d.ElevationReason);
|
||||||
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
|
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
|
||||||
Assert.AreEqual("7-Zip 24.08 (x64 edition)", d.ProductName);
|
Assert.AreEqual("7-Zip 24.08 (x64 edition)", d.ProductName);
|
||||||
Assert.AreEqual(ConsentUIMsiAction.Install, d.Action);
|
Assert.AreEqual(ConsentUIMsiAction.Install, d.Action);
|
||||||
@@ -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((ConsentUIElevationType)8, d.ElevationType);
|
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((ConsentUIElevationType)4, d.ElevationType);
|
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);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Lithnet.CredentialProvider.UnitTests
|
|||||||
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
|
Assert.AreEqual(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.Unknown3, d.Flags);
|
||||||
Assert.AreEqual(2, d.SessionId);
|
Assert.AreEqual(2, d.SessionId);
|
||||||
Assert.AreEqual((IntPtr)0x0006056a, d.HWnd);
|
Assert.AreEqual((IntPtr)0x0006056a, d.HWnd);
|
||||||
Assert.AreEqual((ConsentUIElevationType)6, d.ElevationType);
|
Assert.AreEqual(ConsentUIElevationReason.Request, d.ElevationReason);
|
||||||
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
|
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.ExecutablePath);
|
||||||
Assert.AreEqual("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", d.Unknown1);
|
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(ConsentUIFlags.InWindowsDirectory | ConsentUIFlags.SecureDesktop | ConsentUIFlags.AutoElevationOther, d.Flags);
|
||||||
Assert.AreEqual(2, d.SessionId);
|
Assert.AreEqual(2, d.SessionId);
|
||||||
Assert.AreEqual((IntPtr)0x000705bc, d.HWnd);
|
Assert.AreEqual((IntPtr)0x000705bc, d.HWnd);
|
||||||
Assert.AreEqual((ConsentUIElevationType)5, d.ElevationType);
|
Assert.AreEqual(ConsentUIElevationReason.Msi, d.ElevationReason);
|
||||||
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
|
Assert.AreEqual(ConsentUIPromptType.Credentials, d.PromptType);
|
||||||
Assert.AreEqual("7-Zip 23.01", d.ProductName);
|
Assert.AreEqual("7-Zip 23.01", d.ProductName);
|
||||||
Assert.AreEqual(ConsentUIMsiAction.Install, d.Action);
|
Assert.AreEqual(ConsentUIMsiAction.Install, d.Action);
|
||||||
@@ -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((ConsentUIElevationType)8, d.ElevationType);
|
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((ConsentUIElevationType)4, d.ElevationType);
|
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);
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ namespace Lithnet.CredentialProvider
|
|||||||
public ConsentUIType Type => this.header.Type;
|
public ConsentUIType Type => this.header.Type;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating the consent prompt type
|
/// Gets a value indicating how UAC has been told to fetch approval.
|
||||||
|
/// In the case where a Credential Provider is initialised, this should always be `Credentials`.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ConsentUIPromptType PromptType => this.header.PromptType;
|
public ConsentUIPromptType PromptType => this.header.PromptType;
|
||||||
|
|
||||||
@@ -46,13 +47,13 @@ namespace Lithnet.CredentialProvider
|
|||||||
public IntPtr HWnd => this.header.hWindow;
|
public IntPtr HWnd => this.header.hWindow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the method that ConsentUI has been told to fetch approval.
|
/// Gets the reason why `consent.exe` was started in the first place. In other words,
|
||||||
/// In the case where a Credential Provider is initialised, this should always be `Credentials`.
|
/// the type of action that led to an elevation request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ConsentUIElevationType ElevationType => this.header.ElevationType;
|
public ConsentUIElevationReason ElevationReason => this.header.ElevationReason;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A series of flags that AppInfo passes to ConsentUI to signifiy actions that need to
|
/// A series of flags that AppInfo passes to ConsentUI to signify actions that need to
|
||||||
/// take place on the UI side.
|
/// take place on the UI side.
|
||||||
/// This includes specifics around the UI that should be presented & signature verification settings.
|
/// This includes specifics around the UI that should be presented & signature verification settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
namespace Lithnet.CredentialProvider
|
||||||
|
{
|
||||||
|
public enum ConsentUIElevationReason
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Application Compatibility
|
||||||
|
/// e.g. "Run this program as an Administrator" explicitly configured
|
||||||
|
///
|
||||||
|
/// > "The AppCompat database stores information in the application
|
||||||
|
/// > compatibility fix entries for an application."
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_APPCOMPAT_EXPLICIT (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
AppCompatExplicit = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Application Compatibility
|
||||||
|
/// e.g. "Run this program as an Administrator" set via Windows heuristics
|
||||||
|
///
|
||||||
|
/// > "The AppCompat database stores information in the application
|
||||||
|
/// > compatibility fix entries for an application."
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_APPCOMPAT_HEURISTIC (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
AppCompatHeuristic = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Application manifest
|
||||||
|
/// > "The Fusion database stores information from application
|
||||||
|
/// > manifests that describe the applications. The manifest schema
|
||||||
|
/// > is updated to add a new requested execution level field."
|
||||||
|
/// See also: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#trustinfo
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_FUSION (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
Fusion = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Automatically detected Windows Installer package (e.g. an EXE installer)
|
||||||
|
/// > "Installer detection detects setup files, which helps prevent installations
|
||||||
|
/// > from being run without the user's knowledge and consent."
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_INSTALLER (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
Installer = 3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// COM elevation action
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_CLSID (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
Clsid = 4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Windows Installer package installation (MSI)
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_MSI (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
Msi = 5,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Run as Administrator..." (e.g. manual UAC)
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_REQUEST (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
Request = 6,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ActiveX Installer Service (AXIS)
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_AXIS (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
Axis = 7,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Packaged Applications (MSIX / APPX)
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_PACKAGED_APP (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
Msix = 8,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unknown
|
||||||
|
///
|
||||||
|
/// `ELEVATION_REASON.ELEVATION_REASON_NUM_REASONS (ole32.dll)`
|
||||||
|
/// </summary>
|
||||||
|
NumReasons = 9,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
namespace Lithnet.CredentialProvider
|
|
||||||
{
|
|
||||||
public enum ConsentUIElevationType
|
|
||||||
{
|
|
||||||
Unknown = 0,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Automatic Admin Mode.
|
|
||||||
/// This seems to be an instance where UAC creates a local, secondary
|
|
||||||
/// account called '%username%_admin' which is used to elevate a process.
|
|
||||||
/// </summary>
|
|
||||||
AutomaticAdmin = 1,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Prompt the user for consent (i.e. Yes or No)
|
|
||||||
/// </summary>
|
|
||||||
Consent = 2,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Prompt the user for credentials
|
|
||||||
/// </summary>
|
|
||||||
Credentials = 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -62,7 +62,7 @@ namespace Lithnet.CredentialProvider
|
|||||||
BlockElevation = 0x1000,
|
BlockElevation = 0x1000,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Corresponds to `ConsentUIElevationType.AutomaticAdmin`
|
/// Corresponds to `ConsentUIPromptType.AutomaticAdmin`
|
||||||
/// This seems to be an instance where UAC creates a local, secondary
|
/// This seems to be an instance where UAC creates a local, secondary
|
||||||
/// account called '%username%_admin' which is used to elevate a process.
|
/// account called '%username%_admin' which is used to elevate a process.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Lithnet.CredentialProvider.Interop
|
|||||||
|
|
||||||
// 32
|
// 32
|
||||||
|
|
||||||
public ConsentUIElevationType ElevationType; // 4
|
public ConsentUIElevationReason ElevationReason; // 4
|
||||||
public int sessionId; // 4
|
public int sessionId; // 4
|
||||||
public IntPtr hMutex; // 8
|
public IntPtr hMutex; // 8
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user