I am turning part of my answer on question What rights do passengers have when flights in the USA are delayed?, into a new question.
The EU made very elaborate passengers rights on EU-based airlines. These rights apply as soon as you fly with such an airline, but do the rules still apply if you booked with an EU-based airlines, but the flight is operated under code-sharing with a (non-EU) partner airline?