Method: Puppet::Util::Windows::Security#get_max_generic_acl_size

Defined in:
lib/puppet/util/windows/security.rb

#get_max_generic_acl_size(ace_count) ⇒ Object



579
580
581
582
583
584
585
586
# File 'lib/puppet/util/windows/security.rb', line 579

def get_max_generic_acl_size(ace_count)
  # https://msdn.microsoft.com/en-us/library/windows/desktop/aa378853(v=vs.85).aspx
  # To calculate the initial size of an ACL, add the following together, and then align the result to the nearest DWORD:
  # * Size of the ACL structure.
  # * Size of each ACE structure that the ACL is to contain minus the SidStart member (DWORD) of the ACE.
  # * Length of the SID that each ACE is to contain.
  ACL.size + ace_count * MAXIMUM_GENERIC_ACE_SIZE
end