MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / APFSPartitionUUIDExtract

Function APFSPartitionUUIDExtract

rEFIt_UEFI/Platform/APFS.cpp:40–55  ·  view source on GitHub ↗

* Function for obtaining unique part id from APFS partition * IN: DevicePath * OUT: EFI_GUID * returns null if it is not APFS part */

Source from the content-addressed store, hash-verified

38 * returns null if it is not APFS part
39 */
40EFI_GUID *APFSPartitionUUIDExtract(
41 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
42 )
43{
44 while (!IsDevicePathEndType(DevicePath) &&
45 !(DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP)) {
46 DevicePath = NextDevicePathNode(DevicePath);
47 }
48 if (DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP) {
49 //Check that vendor-assigned GUID defines APFS Container Partition
50 if ( GuidLEToXString8((EFI_GUID *)((UINT8 *)DevicePath+0x04)).equalIC(ApfsSignatureUUID) ) {
51 return (EFI_GUID *)((UINT8 *)DevicePath+0x14);
52 }
53 }
54 return NULL;
55}
56
57/*
58 * Function for obtaining unique part id from APFS partition

Callers 2

IsOsxHibernatedFunction · 0.85

Calls 6

GuidLEToXString8Function · 0.85
equalICMethod · 0.80
IsDevicePathEndTypeFunction · 0.50
DevicePathTypeFunction · 0.50
DevicePathSubTypeFunction · 0.50
NextDevicePathNodeFunction · 0.50

Tested by

no test coverage detected