Win32 APIs
- C
- D
- E
- F
- O
- Q
- S
- C
- M
- P
- U
- W
Source: show
# File ext/win32/lib/win32/registry.rb, line 335 def CloseKey(hkey) check RegCloseKey.call(hkey) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 281 def CreateKey(hkey, name, opt, desired) result = packhandle(0) disp = packdw(0) check RegCreateKeyExW.call(hkey, make_wstr(name), 0, 0, opt, desired, 0, result, disp) [ unpackhandle(result), unpackdw(disp) ] end
Source: show
# File ext/win32/lib/win32/registry.rb, line 327 def DeleteKey(hkey, name) check RegDeleteKey.call(hkey, make_wstr(name)) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 323 def DeleteValue(hkey, name) check RegDeleteValue.call(hkey, make_wstr(name)) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 296 def EnumKey(hkey, index) name = WCHAR_NUL * Constants::MAX_KEY_LENGTH size = packdw(Constants::MAX_KEY_LENGTH) wtime = ' ' * 8 check RegEnumKeyExW.call(hkey, index, name, size, 0, 0, 0, wtime) [ name[0, unpackdw(size)], unpackqw(wtime) ] end
Source: show
# File ext/win32/lib/win32/registry.rb, line 289 def EnumValue(hkey, index) name = WCHAR_NUL * Constants::MAX_KEY_LENGTH size = packdw(Constants::MAX_KEY_LENGTH) check RegEnumValueW.call(hkey, index, name, size, 0, 0, 0, 0) name[0, unpackdw(size)] end
Source: show
# File ext/win32/lib/win32/registry.rb, line 331 def FlushKey(hkey) check RegFlushKey.call(hkey) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 275 def OpenKey(hkey, name, opt, desired) result = packhandle(0) check RegOpenKeyExW.call(hkey, make_wstr(name), opt, desired, result) unpackhandle(result) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 339 def QueryInfoKey(hkey) subkeys = packdw(0) maxsubkeylen = packdw(0) values = packdw(0) maxvaluenamelen = packdw(0) maxvaluelen = packdw(0) secdescs = packdw(0) wtime = ' ' * 8 check RegQueryInfoKey.call(hkey, 0, 0, 0, subkeys, maxsubkeylen, 0, values, maxvaluenamelen, maxvaluelen, secdescs, wtime) [ unpackdw(subkeys), unpackdw(maxsubkeylen), unpackdw(values), unpackdw(maxvaluenamelen), unpackdw(maxvaluelen), unpackdw(secdescs), unpackqw(wtime) ] end
Source: show
# File ext/win32/lib/win32/registry.rb, line 304 def QueryValue(hkey, name) type = packdw(0) size = packdw(0) name = make_wstr(name) check RegQueryValueExW.call(hkey, name, 0, type, 0, size) data = "\0".force_encoding('ASCII-8BIT') * unpackdw(size) check RegQueryValueExW.call(hkey, name, 0, type, data, size) [ unpackdw(type), data[0, unpackdw(size)] ] end
Source: show
# File ext/win32/lib/win32/registry.rb, line 314 def SetValue(hkey, name, type, data, size) case type when REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ data = data.encode(WCHAR) size ||= data.size + 1 end check RegSetValueExW.call(hkey, make_wstr(name), 0, type, data, size) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 237 def check(result) raise Error, result, caller(1) if result != 0 end
Source: show
# File ext/win32/lib/win32/registry.rb, line 271 def make_wstr(str) str.encode(WCHAR) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 253 def packdw(dw) [dw].pack('V') end
Source: show
# File ext/win32/lib/win32/registry.rb, line 245 def packhandle(h) win64? ? packqw(h) : packdw(h) end
Source: show
# File ext/win32/lib/win32/registry.rb, line 262 def packqw(qw) [ qw & 0xFFFFFFFF, qw >> 32 ].pack('VV') end
Source: show
# File ext/win32/lib/win32/registry.rb, line 257 def unpackdw(dw) dw += [0].pack('V') dw.unpack('V')[0] end
Source: show
# File ext/win32/lib/win32/registry.rb, line 249 def unpackhandle(h) win64? ? unpackqw(h) : unpackdw(h) end