    # File lib/chef/win32/security.rb, line 301
          def self.lookup_privilege_name(system_name, luid)
            system_name = system_name.to_wstring if system_name
            name_size = FFI::Buffer.new(:long).write_long(0)
            if LookupPrivilegeNameW(system_name, luid, nil, name_size)
              raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupPrivilegeName, and got no error!"
            elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER
              Chef::ReservedNames::Win32::Error.raise!
            end

            name = FFI::MemoryPointer.new :char, (name_size.read_long*2)
            unless LookupPrivilegeNameW(system_name, luid, name, name_size)
              Chef::ReservedNames::Win32::Error.raise!
            end

            name.read_wstring(name_size.read_long)
          end