/// <summary>
 /// Gets the security descriptor for the folder. Not available to Task Scheduler 1.0.
 /// </summary>
 /// <param name="includeSections">Section(s) of the security descriptor to return.</param>
 /// <returns>The security descriptor for the folder.</returns>
 /// <exception cref="NotV1SupportedException">Not supported under Task Scheduler 1.0.</exception>
 public string GetSecurityDescriptorSddlForm(System.Security.AccessControl.SecurityInfos includeSections = Task.defaultSecurityInfosSections)
 {
     if (v2Folder != null)
     {
         return(v2Folder.GetSecurityDescriptor((int)includeSections));
     }
     throw new NotV1SupportedException();
 }
Пример #2
0
 public static extern int GetNamedSecurityInfo(
     string objectName,
     SE_OBJECT_TYPE objectType,
     System.Security.AccessControl.SecurityInfos securityInfo,
     out IntPtr sidOwner,
     out IntPtr sidGroup,
     out IntPtr dacl,
     out IntPtr sacl,
     out IntPtr securityDescriptor);
 /// <summary>
 /// Sets the security descriptor for the folder. Not available to Task Scheduler 1.0.
 /// </summary>
 /// <param name="sddlForm">The security descriptor for the folder.</param>
 /// <param name="includeSections">Section(s) of the security descriptor to set.</param>
 /// <exception cref="NotV1SupportedException">Not supported under Task Scheduler 1.0.</exception>
 public void SetSecurityDescriptorSddlForm(string sddlForm, System.Security.AccessControl.SecurityInfos includeSections = Task.defaultSecurityInfosSections)
 {
     if (v2Folder != null)
     {
         v2Folder.SetSecurityDescriptor(sddlForm, (int)includeSections);
     }
     else
     {
         throw new NotV1SupportedException();
     }
 }
Пример #4
0
 public static extern bool ConvertSecurityDescriptorToStringSecurityDescriptor(
     IntPtr SecurityDescriptor,
     uint StringSDRevision,
     System.Security.AccessControl.SecurityInfos SecurityInformation,
     out string StringSecurityDescriptor,
     out int StringSecurityDescriptorSize);
 public static extern bool SetServiceObjectSecurity(SafeHandle serviceHandle,
                                                    System.Security.AccessControl.SecurityInfos secInfos,
                                                    byte[] lpSecDesrBuf);
 public static extern bool QueryServiceObjectSecurity(SafeHandle serviceHandle,
                                                      System.Security.AccessControl.SecurityInfos secInfo,
                                                      byte[] lpSecDesrBuf,
                                                      uint bufSize,
                                                      out uint bufSizeNeeded);
 public static extern bool QueryServiceObjectSecurity(IntPtr serviceHandle,
                                                      System.Security.AccessControl.SecurityInfos secInfo,
                                                      ref SECURITY_DESCRIPTOR lpSecDesrBuf,
                                                      uint bufSize,
                                                      out uint bufSizeNeeded);
 public void SetSecurityDescriptor(System.Security.AccessControl.GenericSecurityDescriptor sd, System.Security.AccessControl.SecurityInfos includeSections = Task.defaultSecurityInfosSections)
 {
     this.SetSecurityDescriptorSddlForm(sd.GetSddlForm((System.Security.AccessControl.AccessControlSections)includeSections), includeSections);
 }
 public System.Security.AccessControl.GenericSecurityDescriptor GetSecurityDescriptor(System.Security.AccessControl.SecurityInfos includeSections = Task.defaultSecurityInfosSections)
 {
     return(new System.Security.AccessControl.RawSecurityDescriptor(GetSecurityDescriptorSddlForm(includeSections)));
 }