Microsoft had all the cards back in 2008, maybe. The missteps started with Vista and Zune, and continued with Windows Phone 7, and were magnified with Windows 8, Windows 8 RT, and now XBox One. There's also the big non-step of trying to starve the iPad by not porting Office to it -- which has made it glaringly obvious how little we need Office to get stuff done.
I'd say Microsoft's problem now is pretty intractable. I think it's quite possible there will be no victor in XBox One vs. PS4 just as there was no victor in Bluray vs. HD-DVD (Bluray just lost more slowly).