EfiPy2 also supports gBS.InstallMultipleProtocolInterfaces().
By EDK II definition,
typedef
EFI_STATUS
(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)(
IN OUT EFI_HANDLE *Handle,
...
);
EfiPy2 follows this rule as possible as it can.
EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES = CFUNCTYPE (
EFI_STATUS,
POINTER(EFI_HANDLE) # IN OUT *Handle
)
In run time, EfiPy2 changes ctypes CFUNCTYPE argument by re-arrange arguments members.
EfiPy.gBS.InstallMultipleProtocolInterfaces.argtypes = [
EfiPy.POINTER(EfiPy.EFI_HANDLE),
EfiPy.POINTER(EfiPy.EFI_GUID),
EfiPy.POINTER(EfiPy.PVOID),
EfiPy.POINTER(EfiPy.PVOID)
]
Finally, calling EfiPy.gBS.InstallMultipleProtocolInterfaces() for install protocols in one time.
Status = EfiPy.gBS.InstallMultipleProtocolInterfaces (
EfiPy.byref (Handle1),
EfiPy.byref (TestGuid1),
EfiPy.byref (TestProtocol1),
None
)
The same is as EfiPy.gBS.UninstallMultipleProtocolInterfaces()
Screenshot
Sample code in GitHub is EfiPy2ProtocolSample3.py
No comments:
Post a Comment