MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / create_instance_enum

Method create_instance_enum

windows/winobject/wmi.py:354–372  ·  view source on GitHub ↗

Enumerate the instances of ``clsname``. Deep allows to enumerate the instance of subclasses as well :returns: :class:`WmiEnumeration` Example: >>> windows.system.wmi["root\\subscription"].create_instance_enum("__EventConsumer", deep=False).all() []

(self, clsname, flags=DEFAULT_ENUM_FLAGS, deep=True)

Source from the content-addressed store, hash-verified

352 return self.create_class_enum(None, deep=True)
353
354 def create_instance_enum(self, clsname, flags=DEFAULT_ENUM_FLAGS, deep=True):
355 """Enumerate the instances of ``clsname``. Deep allows to enumerate the instance of subclasses as well
356
357 :returns: :class:`WmiEnumeration`
358
359 Example:
360 >>> windows.system.wmi["root\\subscription"].create_instance_enum("__EventConsumer", deep=False).all()
361 []
362 >>> windows.system.wmi["root\\subscription"].create_instance_enum("__EventConsumer", deep=True).all()
363 [<WmiObject instance of "NTEventLogEventConsumer">]
364
365 .. note::
366
367 See https://docs.microsoft.com/en-us/windows/desktop/api/wbemcli/nf-wbemcli-iwbemservices-createinstanceenum
368 """
369 flags |= gdef.WBEM_FLAG_DEEP if deep else gdef.WBEM_FLAG_SHALLOW
370 enumerator = WmiEnumeration()
371 self.CreateInstanceEnum(clsname, flags, None, enumerator)
372 return enumerator
373
374 def get_object(self, path):
375 """Return the object matching ``path``. If ``path`` is a class name return the class object``

Callers 1

selectMethod · 0.95

Calls 1

WmiEnumerationClass · 0.85

Tested by

no test coverage detected