/* Save the save the mapping database to NV variable. */
EFI_STATUS CommitChanges(IN EFI_CALLBACK_INFO *Private, IN UINT16 KeyValue, IN PLAT_OVER_MNGR_DATA *FakeNvData)
/* Save the save the mapping database to NV variable. */
EFI_STATUS CommitChanges(IN EFI_CALLBACK_INFO *Private, IN UINT16 KeyValue, IN PLAT_OVER_MNGR_DATA *FakeNvData)
{
  EFI_STATUS                Status;
  UINTN                     Index;
  UINTN                     SelectedDriverImageNum;
  EFI_DEVICE_PATH_PROTOCOL  *LoadedImageDevicePath;
  DeleteDriverImage (mControllerDevicePathProtocol[mSelectedCtrIndex], NULL, &mMappingDataBase);
  for (SelectedDriverImageNum = 0; SelectedDriverImageNum < mSelectedDriverImageNum; SelectedDriverImageNum++) {
    Index = FakeNvData->DriOrder[SelectedDriverImageNum] - 1;
    LoadedImageDevicePath = NULL;
    Status                = gBS->HandleProtocol (
                                   mDriverImageHandleBuffer[Index],
                                   &gEfiLoadedImageDevicePathProtocolGuid,
                                   (VOID **)&LoadedImageDevicePath
                                   );
    ASSERT (LoadedImageDevicePath != NULL);
    InsertDriverImage (
      mControllerDevicePathProtocol[mSelectedCtrIndex],
      LoadedImageDevicePath,
      &mMappingDataBase,
      (UINT32)SelectedDriverImageNum + 1
      );
  }
  Status = SaveOverridesMapping (&mMappingDataBase);
  return Status;
}