Sha256: fa7f76d6fb4c8794ab3e665dfadc1d15d90009cf59218049d7450c40a39d7dc0
Contents?: true
Size: 440 Bytes
Versions: 17
Compression:
Stored size: 440 Bytes
Contents
# frozen_string_literal: true require 'facter/resolvers/windows/ffi/ffi' module IdentityFFI extend FFI::Library ffi_convention :stdcall ffi_lib :secur32 attach_function :GetUserNameExW, %i[uint32 lpwstr pointer], :win32_bool ffi_convention :stdcall ffi_lib :shell32 attach_function :IsUserAnAdmin, [], :win32_bool def self.privileged? result = self.IsUserAnAdmin() result && result != FFI::WIN32FALSE end end
Version data entries
17 entries across 17 versions & 1 rubygems