Security.h (1261B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include <wil/resource.h> 5 #include <string> 6 #include <string_view> 7 8 namespace AppInstaller::Security 9 { 10 // A Windows integrity level. 11 enum class IntegrityLevel 12 { 13 Untrusted, 14 Low, 15 Medium, 16 MediumPlus, 17 High, 18 System, 19 ProtectedProcess, 20 }; 21 22 // Gets the integrity level for the current effective token. 23 // Does not know how to determine MediumPlus, if that ever matters... 24 IntegrityLevel GetEffectiveIntegrityLevel(); 25 26 // Determines if the current COM caller is the same user as the current process 27 // and is at least equal integrity level (higher will also be allowed). 28 bool IsCOMCallerSameUserAndIntegrityLevel(); 29 30 // Determines if the current COM caller is at least the minimum integrity level provided. 31 bool IsCOMCallerIntegrityLevelAtLeast(IntegrityLevel minimumLevel); 32 33 // Determines if the current integrity level is at least the minimum integrity level provided. 34 bool IsCurrentIntegrityLevelAtLeast(IntegrityLevel minimumLevel); 35 36 // Gets the string representation of the given SID. 37 std::string ToString(PSID sid); 38 }