# File lib/chef/win32/security/acl.rb, line 36 def self.create(aces) aces_size = aces.inject(0) { |sum,ace| sum + ace.size } acl_size = align_dword(Chef::ReservedNames::Win32::API::Security::ACLStruct.size + aces_size) # What the heck is 94??? acl = Chef::ReservedNames::Win32::Security.initialize_acl(acl_size) aces.each { |ace| Chef::ReservedNames::Win32::Security.add_ace(acl, ace) } acl end
# File lib/chef/win32/security/acl.rb, line 29 def initialize(pointer, owner = nil) @struct = Chef::ReservedNames::Win32::API::Security::ACLStruct.new pointer # Keep a reference to the actual owner of this memory so that it isn't freed out from under us # TODO this could be avoided if we could mark a pointer's parent manually @owner = owner end
# File lib/chef/win32/security/acl.rb, line 46 def ==(other) return false if length != other.length 0.upto(length-1) do |i| return false if self[i] != other[i] end return true end
# File lib/chef/win32/security/acl.rb, line 58 def [](index) Chef::ReservedNames::Win32::Security.get_ace(self, index) end
# File lib/chef/win32/security/acl.rb, line 62 def delete_at(index) Chef::ReservedNames::Win32::Security.delete_ace(self, index) end
# File lib/chef/win32/security/acl.rb, line 66 def each 0.upto(length-1) { |i| yield self[i] } end
# File lib/chef/win32/security/acl.rb, line 70 def insert(index, *aces) aces.reverse_each { |ace| add_ace(self, ace, index) } end
# File lib/chef/win32/security/acl.rb, line 74 def length struct[:AceCount] end
# File lib/chef/win32/security/acl.rb, line 54 def pointer struct.pointer end
# File lib/chef/win32/security/acl.rb, line 78 def push(*aces) aces.each { |ace| Chef::ReservedNames::Win32::Security.add_ace(self, ace) } end
# File lib/chef/win32/security/acl.rb, line 90 def to_s "[#{self.collect { |ace| ace.to_s }.join(", ")}]" end
Generated with the Darkfish Rdoc Generator 2.