def self.get_security_attributes_for_user
user = get_current_user
psd_information = malloc_ptr(Win::SECURITY_DESCRIPTOR.size)
raise_error_if_zero(
Win.InitializeSecurityDescriptor(psd_information,
Win::REVISION))
raise_error_if_zero(
Win.SetSecurityDescriptorOwner(psd_information, user.SID,
0))
raise_error_if_zero(
Win.IsValidSecurityDescriptor(psd_information))
nLength = Win::SECURITY_ATTRIBUTES.size
lpSecurityDescriptor = psd_information
bInheritHandle = 1
sa = [nLength, lpSecurityDescriptor.to_i,
bInheritHandle].pack("LLC")
return sa
end