| UserAccountControlGetProcessIntegrityLevel Method |
The function gets the integrity level of the current process. Integrity
level is only available on Windows Vista and newer operating systems, thus
GetProcessIntegrityLevel throws a C++ exception if it is called on systems
prior to Windows Vista.
Namespace:
TomsToolbox.Desktop
Assembly:
TomsToolbox.Desktop (in TomsToolbox.Desktop.dll)
Syntax public static int GetProcessIntegrityLevel()
Public Shared Function GetProcessIntegrityLevel As Integer
Return Value
Type:
Int32
Returns the integrity level of the current process. It is usually one of
these values:
SECURITY_MANDATORY_UNTRUSTED_RID - means untrusted level. It is used
by processes started by the Anonymous group. Blocks most write access.
(SID: S-1-16-0x0)
SECURITY_MANDATORY_LOW_RID - means low integrity level. It is used by
Protected Mode Internet Explorer. Blocks write acess to most objects
(such as files and registry keys) on the system. (SID: S-1-16-0x1000)
SECURITY_MANDATORY_MEDIUM_RID - means medium integrity level. It is
used by normal applications being launched while UAC is enabled.
(SID: S-1-16-0x2000)
SECURITY_MANDATORY_HIGH_RID - means high integrity level. It is used
by administrative applications launched through elevation when UAC is
enabled, or normal applications if UAC is disabled and the user is an
administrator. (SID: S-1-16-0x3000)
SECURITY_MANDATORY_SYSTEM_RID - means system integrity level. It is
used by services and other system-level applications (such as Wininit,
Winlogon, Smss, etc.) (SID: S-1-16-0x4000)
Exceptions Exception | Condition |
---|
Win32Exception |
When any native Windows API call fails, the function throws a Win32Exception
with the last error code.
|
See Also