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

Method _create_vtable

windows/com.py:321–332  ·  view source on GitHub ↗
(self, interface)

Source from the content-addressed store, hash-verified

319 return True
320
321 def _create_vtable(self, interface):
322 implems = []
323 names = []
324 for index, name, method in self.extract_methods_order(interface):
325 func_implem = getattr(self, name)
326 #'this' is a COM-interface of the type we are implementing
327 types = [method.restype, interface] + list(method.argtypes)
328 implems.append(ctypes.WINFUNCTYPE(*types)(func_implem))
329 names.append(name)
330 class Vtable(ctypes.Structure):
331 _fields_ = [(name, ctypes.c_void_p) for name in names]
332 return Vtable(*[ctypes.cast(x, ctypes.c_void_p) for x in implems]), implems
333
334 def __init__(self):
335 self.verify_implem(self.IMPLEMENT)

Callers 1

__init__Method · 0.95

Calls 3

extract_methods_orderMethod · 0.95
VtableClass · 0.85
castMethod · 0.80

Tested by

no test coverage detected