Class: Win32::Registry::PredefinedKey

Inherits:
Win32::Registry show all
Defined in:
lib/win32/registry.rb

Overview

Predefined Keys

Constant Summary

Constants included from Constants

Constants::HKEY_CLASSES_ROOT, Constants::HKEY_CURRENT_CONFIG, Constants::HKEY_CURRENT_USER, Constants::HKEY_DYN_DATA, Constants::HKEY_LOCAL_MACHINE, Constants::HKEY_PERFORMANCE_DATA, Constants::HKEY_PERFORMANCE_NLSTEXT, Constants::HKEY_PERFORMANCE_TEXT, Constants::HKEY_USERS, Constants::KEY_ALL_ACCESS, Constants::KEY_CREATE_LINK, Constants::KEY_CREATE_SUB_KEY, Constants::KEY_ENUMERATE_SUB_KEYS, Constants::KEY_EXECUTE, Constants::KEY_NOTIFY, Constants::KEY_QUERY_VALUE, Constants::KEY_READ, Constants::KEY_SET_VALUE, Constants::KEY_WRITE, Constants::MAX_KEY_LENGTH, Constants::MAX_VALUE_LENGTH, Constants::REG_BINARY, Constants::REG_CREATED_NEW_KEY, Constants::REG_DWORD, Constants::REG_DWORD_BIG_ENDIAN, Constants::REG_DWORD_LITTLE_ENDIAN, Constants::REG_EXPAND_SZ, Constants::REG_FORCE_RESTORE, Constants::REG_FULL_RESOURCE_DESCRIPTOR, Constants::REG_LEGAL_OPTION, Constants::REG_LINK, Constants::REG_MULTI_SZ, Constants::REG_NONE, Constants::REG_NO_LAZY_FLUSH, Constants::REG_OPENED_EXISTING_KEY, Constants::REG_OPTION_BACKUP_RESTORE, Constants::REG_OPTION_CREATE_LINK, Constants::REG_OPTION_NON_VOLATILE, Constants::REG_OPTION_OPEN_LINK, Constants::REG_OPTION_RESERVED, Constants::REG_OPTION_VOLATILE, Constants::REG_QWORD, Constants::REG_QWORD_LITTLE_ENDIAN, Constants::REG_REFRESH_HIVE, Constants::REG_RESOURCE_LIST, Constants::REG_RESOURCE_REQUIREMENTS_LIST, Constants::REG_SZ, Constants::REG_WHOLE_HIVE_VOLATILE, Constants::STANDARD_RIGHTS_READ, Constants::STANDARD_RIGHTS_WRITE

Instance Attribute Summary

Attributes inherited from Win32::Registry

#disposition, #hkey, #keyname, #parent

Instance Method Summary collapse

Methods inherited from Win32::Registry

#[], #[]=, #_dump, #create, create, #created?, #delete_key, #delete_value, #each_key, #each_value, expand_environ, #flush, #info, #inspect, #keys, #name, #open, open, #open?, #read, #read_bin, #read_i, #read_s, #read_s_expand, time2wtime, type2name, #values, #write, #write_bin, #write_i, #write_s, wtime2time

Constructor Details

#initialize(hkey, keyname) ⇒ PredefinedKey

Returns a new instance of PredefinedKey.



199
200
201
202
203
204
# File 'lib/win32/registry.rb', line 199

def initialize(hkey, keyname)
  @hkey = hkey
  @parent = nil
  @keyname = keyname
  @disposition = REG_OPENED_EXISTING_KEY
end

Instance Method Details

#classObject

Fake #class method for Registry#open, Registry#create



212
213
214
# File 'lib/win32/registry.rb', line 212

def class
  Registry
end

#closeObject

Predefined keys cannot be closed

Raises:



207
208
209
# File 'lib/win32/registry.rb', line 207

def close
  raise Error.new(5) ## ERROR_ACCESS_DENIED
end