NTSTATUS
IoUpdateDiskGeometry(
  IN  PDEVICE_OBJECT DeviceObject,
  IN  PDISK_GEOMETRY_EX OldDiskGeometry,
  IN  PDISK_GEOMETRY_EX NewDiskGeometry
  );

Routine Description:

    Update the disk geometry for the specific device. On an EFI disk the EFI
    partition table will be moved to the end of the disk, so the final sectors
    must be writable by the time this routine is called.

    The primary and backup partition tables must be valid for this function to
    succeed.

Arguments:

    DeviceObject - The device whose geometry has changed.

    OldDiskGeometry - The old disk geometry.

    NewDiskGeometry - The new disk geometry.

Return Value:

    NTSTATUS code