* Function for obtaining unique part id from APFS partition * IN: DevicePath * OUT: EFI_GUID * returns null if it is not APFS part */
| 38 | * returns null if it is not APFS part |
| 39 | */ |
| 40 | EFI_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 |
no test coverage detected