Saturday, August 22, 2015

EfiPy DevicePath

Sample code name

DevicePath.py

Description

In EfiPy, it uses DevicePath and DevicePathToText to build DevicePathEfiPy.

DevicePathEfiPy inherit from DevicePath and adds output DevicePath text by __str__().

  DevicePath = (EfiPy.cast (TmpDevPath, EfiPy.POINTER(EFI_DEVICE_PATH_PROTOCOL)))[0]

  print "%s" % DevicePath

This is LocateHandle sample from EfiPy.gBS.LocateHandle()

  Status = EfiPy.gBS.LocateHandle(
             EfiPy.ByProtocol,
             EfiPy.byref(gEfiSimpleFileSystemProtocolGuid),
             None,
             EfiPy.byref(BufferSize),
             HandleArray
             )

Above results are put at array of handle.
It can be used by Python for loop to retrieve each handle.

  for Handle in HandleArray:

    TmpDevPath = EfiPy.PVOID ()

Screenshot


No comments:

Post a Comment