Share via


SecurityDescriptorHelpers.GetSddlForAppContainerNames Method

Definition

Get the security descriptor definition language (SDDL) for the specified Package Family Names (PFNs).

public:
 static Platform::String ^ GetSddlForAppContainerNames(Platform::Array <AppContainerNameAndAccess> ^ accessRequests, Platform::String ^ principalStringSid, unsigned int principalAccessMask);
 static winrt::hstring GetSddlForAppContainerNames(winrt::array_view <AppContainerNameAndAccess> const& accessRequests, winrt::hstring const& principalStringSid, uint32_t const& principalAccessMask);
public static string GetSddlForAppContainerNames(AppContainerNameAndAccess[] accessRequests, string principalStringSid, uint principalAccessMask);
function getSddlForAppContainerNames(accessRequests, principalStringSid, principalAccessMask)
Public Shared Function GetSddlForAppContainerNames (accessRequests As AppContainerNameAndAccess(), principalStringSid As String, principalAccessMask As UInteger) As String

Parameters

accessRequests
AppContainerNameAndAccess[]

An array of AppContainerNameAndAccess structs that specify the PFNs and access rights.

principalStringSid
String

Platform::String

winrt::hstring

The security identifier (SID) of the principal. This parameter is optional and can be null.

principalAccessMask
UInt32

unsigned int

uint32_t

The access rights for the principal.

Returns

String

Platform::String

winrt::hstring

Returns the SDDL string.

Examples

EventWaitHandle CreateShareableEvent(string name)
{
    var access = new AppContainerNameAndAccess[]
    {
        new AppContainerNameAndAccess("Contoso.Test.App_12345678",
          (uint)(EventWaitHandleRights.Modify |
                 EventWaitHandleRights.Synchronize));
    };

    string sddl = SecurityDescriptorHelpers.GetSddlForAppContainerNames(
        access, null,
        (uint)(EventWaitHandleRights.Modify |
                 EventWaitHandleRights.Synchronize));

    var security = new EventWaitHandleSecurity();
    security.SetSecurityDescriptorSddlForm(sddl);

    Boolean created;
    return new EventWaitHandle(false,
      EventResetMode.AutoReset, name, out created, security);
}

Remarks

If the principalStringSid parameter is null, the principal of the current thread is used.

Applies to

See also