#NEWLINE# def read_registry( self ) : #NEWLINE# #INDENT# 'Extract resolver configuration from the Windows registry.' #NEWLINE# lm = _winreg . ConnectRegistry ( None , _winreg . HKEY_LOCAL_MACHINE ) #NEWLINE# want_scan = False #NEWLINE# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# tcp_params = _winreg . OpenKey ( lm , 'SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters' ) #NEWLINE# want_scan = True #NEWLINE# #UNINDENT# except EnvironmentError : #NEWLINE# #INDENT# tcp_params = _winreg . OpenKey ( lm , 'SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . _config_win32_fromkey ( tcp_params ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# tcp_params . Close ( ) #NEWLINE# #UNINDENT# if want_scan : #NEWLINE# #INDENT# interfaces = _winreg . OpenKey ( lm , 'SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces' ) #NEWLINE# try : #NEWLINE# #INDENT# i = 0 #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# guid = _winreg . EnumKey ( interfaces , i ) #NEWLINE# i += 1 #NEWLINE# key = _winreg . OpenKey ( interfaces , guid ) #NEWLINE# if ( not self . _win32_is_nic_enabled ( lm , guid , key ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . _config_win32_fromkey ( tcp_params ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# key . Close ( ) #NEWLINE# #UNINDENT# #UNINDENT# except EnvironmentError : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# interfaces . Close ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# lm . Close ( )