code: def valuestodict(key):
      """Convert a registry key's values to a dictionary."""
      dout = {}
      size = winreg.QueryInfoKey(key)[1]
      tz_res = None
  
      for i in range(size):
          key_name, value, dtype = winreg.EnumValue(key, i)
          if (
              dtype == winreg.REG_DWORD
              or dtype == winreg.REG_DWORD_LITTLE_ENDIAN
          ):
              # If it's a DWORD (32-bit integer), it's stored as unsigned - convert
              # that to a proper signed integer
              if value & (1 << 31):
                  value = value - (1 << 32)
          elif dtype == winreg.REG_SZ:
              # If it's a reference to the tzres DLL, load the actual string
              if value.startswith("@tzres"):
                  tz_res = tz_res or tzres()
                  value = tz_res.name_from_string(value)
  
              value = value.rstrip("\x00")  # Remove trailing nulls
  
          dout[key_name] = value
  
      return dout
  
imports: import datetime
  import struct
  from six.moves import winreg
  from six import text_type
  from ._common import tzrangebase
label_desc: Use image node_id 3 for calling a global function with example usage: valuestodict(key) and returns: dout