def delete_value(hive, key, vname=None, use_32bit_registry=False):
 if PY2:
  local_hive = _mbcs_to_unicode(hive)
  local_key = _unicode_to_mbcs(key)
  local_vname = _unicode_to_mbcs(vname)
 else:
  local_hive = hive
  local_key = key
  local_vname = vname
 registry = Registry()
 hkey = registry.hkeys[local_hive]
 access_mask = (registry.registry_32[use_32bit_registry] | _winreg.KEY_ALL_ACCESS)
 try:
  handle = _winreg.OpenKey(hkey, local_key, 0, access_mask)
  _winreg.DeleteValue(handle, local_vname)
  _winreg.CloseKey(handle)
  broadcast_change()
  return True
 except WindowsError as exc:
  log.error(exc, exc_info=True)
  log.error(u'Hive: {0}'.format(local_hive))
  log.error(u'Key: {0}'.format(local_key))
  log.error(u'ValueName: {0}'.format(local_vname))
  log.error(u'32bit Reg: {0}'.format(use_32bit_registry))
  return False

def delete_value ( hive , key , vname = None , use_32bit_registry = False ) : if PY2 : local_hive = _mbcs_to_unicode ( hive ) local_key = _unicode_to_mbcs ( key ) local_vname = _unicode_to_mbcs ( vname ) else : local_hive = hive local_key = key local_vname = vname registry = Registry ( ) hkey = registry . hkeys [ local_hive ] access_mask = ( registry . registry_32 [ use_32bit_registry ] | _winreg . KEY_ALL_ACCESS ) try : handle = _winreg . OpenKey ( hkey , local_key , 0 , access_mask ) _winreg . DeleteValue ( handle , local_vname ) _winreg . CloseKey ( handle ) broadcast_change ( ) return True except WindowsError as exc : log . error ( exc , exc_info = True ) log . error ( u'Hive: {0}' . format ( local_hive ) ) log . error ( u'Key: {0}' . format ( local_key ) ) log . error ( u'ValueName: {0}' . format ( local_vname ) ) log . error ( u'32bit Reg: {0}' . format ( use_32bit_registry ) ) return False
delete a registry value entry or the default value for a key .