import sys import os.path sys.path.append(os.path.abspath(__file__ + "\..\..")) import windows import windows.pipe import windows.generated_def as gdef devmgr = windows.system.device_manager print("Device manager is {0}".format(devmgr)) print("Enumerating the first 3 device classes") for cls in devmgr.classes[:3]: print(" * {0}".format(cls)) print("Finding device class 'System'") # Allow devmgr.classes["name"] ? system_cls = [cls for cls in devmgr.classes if cls.name == "System"][0] print(" * {0}".format(system_cls)) print(" Enumerating some devices of 'System'") devices = system_cls.devices.all() for devinst in (devices[0], devices[25], devices[35]): # Some "random" devices to have interesting ones print(" * {0}".format(devinst)) devconf = devinst.allocated_configuration if not devconf: continue print(" Enumerating allocated resources:") for resource in devconf.resources: print(" * {0}".format(resource)) # python64 samples\device\device_manager.py # Device manager is # Enumerating the first 3 device classes # * # * # * # Finding device class 'System' # * # Enumerating some devices of 'System' # * # * # Enumerating allocated resources: # * # * # * # Enumerating allocated resources: # * # * # *