123456789_123456789_123456789_123456789_123456789_

Module: Win32

Overview

Implements bindings to Win32 SSPI functions, focused on authentication to a proxy server over HTTP.

Constant Summary

  • LOCALE =
    # File 'ext/win32/lib/win32/registry.rb', line 71
    Encoding.find(Encoding.locale_charmap)
  • WCHAR =

    Win32 Registry

    win32/registry is registry accessor library for Win32 platform. It uses importer to call Win32 Registry APIs.

    example
    Win32::Registry::HKEY_CURRENT_USER.open('SOFTWARE\foo') do |reg|
      value = reg['foo']                               # read a value
      value = reg['foo', Win32::Registry::REG_SZ]      # read a value with type
      type, value = reg.read('foo')                    # read a value
      reg['foo'] = 'bar'                               # write a value
      reg['foo', Win32::Registry::REG_SZ] = 'bar'      # write a value with type
      reg.write('foo', Win32::Registry::REG_SZ, 'bar') # write a value
    
      reg.each_value { |name, type, data| ... }        # Enumerate values
      reg.each_key { |key, wtime| ... }                # Enumerate subkeys
    
      reg.delete_value(name)                         # Delete a value
      reg.delete_key(name)                           # Delete a subkey
      reg.delete_key(name, true)                     # Delete a subkey recursively
    end

    Reference

    ::Win32::Registry class

    — info

    — num_keys

    — max_key_length

    — num_values

    — max_value_name_length

    — max_value_length

    — descriptor_length

    — wtime

    Returns an item of key information.
    constants

    — HKEY_CLASSES_ROOT

    — HKEY_CURRENT_USER

    — HKEY_LOCAL_MACHINE

    — HKEY_PERFORMANCE_DATA

    — HKEY_CURRENT_CONFIG

    — HKEY_DYN_DATA

    Win32::Registry object whose key is predefined key.

    For detail, see the MSDN article.

    # File 'ext/win32/lib/win32/registry.rb', line 67
    Encoding::UTF_16LE
  • WCHAR_CR =
    # File 'ext/win32/lib/win32/registry.rb', line 69
    "\r".encode(WCHAR).freeze
  • WCHAR_NUL =
    # File 'ext/win32/lib/win32/registry.rb', line 68
    "\0".encode(WCHAR).freeze
  • WCHAR_SIZE =
    # File 'ext/win32/lib/win32/registry.rb', line 70
    WCHAR_NUL.bytesize