def read_values(base, key):
 try:
  handle = RegOpenKeyEx(base, key)
 except RegError:
  return None
 d = {}
 i = 0
 while 1:
  try:
   (name, value, type) = RegEnumValue(handle, i)
  except RegError:
   break
  name = name.lower()
  d[convert_mbcs(name)] = convert_mbcs(value)
  i = (i + 1)
 return d

def read_values ( base , key ) : try : handle = RegOpenKeyEx ( base , key ) except RegError : return None d = { } i = 0 while 1 : try : ( name , value , type ) = RegEnumValue ( handle , i ) except RegError : break name = name . lower ( ) d [ convert_mbcs ( name ) ] = convert_mbcs ( value ) i = ( i + 1 ) return d
return dict of registry keys and values .