 He served as an engineering officer during the war, was frequently subject to enemy fire, and was appointed a brevet first lieutenant for his services at Contreras and Churubusco and to captain for his service at Chapultepec.He performed reconnaissance missions for Maj. Gen. Winfield Scott, a close friend of McClellan's father.McClellan's experiences in the war would shape his military and political life.