def DumpPythonRegistry(): try: h = wincerapi.CeRegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, "Software\\Python\\PythonCore\\%s\\PythonPath" % sys.winver) except win32api.error: print("The remote device does not appear to have Python installed") return 0 path, typ = wincerapi.CeRegQueryValueEx(h, None) print("The remote PythonPath is '%s'" % (str(path), )) h.Close() return 1
def DumpRegistry(root, level=0): # A recursive dump of the remote registry to test.py most functions. h = wincerapi.CeRegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, None) level_prefix = " " * level index = 0 # Enumerate values. while 1: try: name, data, typ = wincerapi.CeRegEnumValue(root, index) except win32api.error: break print("%s%s=%s" % (level_prefix, name, repr(str(data)))) index = index + 1 # Now enumerate all keys. index = 0 while 1: try: name, klass = wincerapi.CeRegEnumKeyEx(root, index) except win32api.error: break print("%s%s\\" % (level_prefix, name)) subkey = wincerapi.CeRegOpenKeyEx(root, name) DumpRegistry(subkey, level + 1) index = index + 1