""who would get Windsor castle if Queen Elizabeth and Prince Philip split up?"
"Would it not be logical that it went to the blood heir of the throne? I'm sure there is a prenup in place so that anything Royal Family inherited stays with the Queen anyhow."
Windsor Castle, like all royal palaces that belong to the Crown Estate, belong to the state itself and are not private property. That means that members of the royal household cannot sell or profit from the palaces and that their ownership and management is carried out on their behalf by the state. (For further information, see http://www.culture.gov.uk/what_we_do/historic_environment/4170.aspx)
The Royal Family do not inherit the royal palaces, it is bestowed on them by the state. The Queen, in reality, has no hold or control over the property. Prince Philip married into the Royal Family and therefore would certainly not have any claim in this way either.
Balmoral Castle, on the other hand, is a private property that was bought by Queen Victoria and is therefore not part of the Crown Estate. It has been passed down successively between the royal generations, Queen Elizabeth inheriting it when her father, King George VI, died.