From 1800 the Castle was owned by the War Office and run as a barracks. Many alterations were made to the Great Hall, which became an accommodation block, to the Chapel Royal, which became a lecture theatre and dining hall, to the King's Old Building, which became an infirmary and to the Royal Palace, which became the Officer's Mess. A number of new buildings were also constructed, including the prison and powder magazine, at the Nether Bailey, in 1810. Queen Victoria visited in 1842, and the Prince of Wales in 1859.