Microsoft on Thursday announced net income of $5 billion and revenues of $19.9 billion for the quarter ending June 30, plus operating income of $26.76 billion on total revenues of $77.85 billion for its most recent fiscal year. But the company revealed stunning setback as well: It has written off $900 million related to Surface RT inventory adjustments.

“While our fourth quarter results were impacted by the decline in the PC market, we continue to see strong demand for our enterprise and cloud offerings, resulting in a record unearned revenue balance this quarter,” said Microsoft CFO Amy Hood. “We also saw increasing consumer demand for services like Office 365, Outlook.com, Skype, and Xbox LIVE. While we have work ahead of us, we are making the focused investments needed to deliver on long-term growth opportunities like cloud services.”

Related: "Short Takes: Special Microsoft Earnings Edition, July 19, 2013"

Microsoft CEO Steve Ballmer also chose to focus on the future.

“We are working hard to deliver compelling new devices and high-value experiences from Microsoft and our partners in the coming months, including new Windows 8.1 tablets and PCs,” he said. “Our new products and the strategic realignment we announced last week position us well for long-term success, as we focus our energy and resources on creating a family of devices and services for individuals and businesses that empower people around the globe at home, at work, and on the go, for the activities they value the most.”

The Surface RT write-off was more than enough to offset a $782 million gain of previously deferred revenue related to the Office Upgrade Offer. Microsoft obviously made too many of the devices and then took a financial hit related to recent industry-event giveaways, plus the recently announced and controversial $150 price cut for consumers. Sources say the charge is also related to parts and accessories, and not just the tablets themselves.

Beyond Surface RT, however, Microsoft’s five main businesses all reported solid gains in the quarter and fiscal year when compared with year-ago numbers. (It’s unclear how or whether this reporting will change over the next few quarters, given Microsoft’s recent reorganization.)

Office remained Microsoft’s biggest business, with revenue in the Business Division growing 14 percent for the fourth quarter and 3 percent for the fiscal year. Microsoft noted that Office 365 is now on a $1.5 billion annual revenue run rate.

Windows, which one might assume would be adversely impacted by a tough market for PCs and the soft launch of Windows 8, actually performed incredibly well, given the conditions. Microsoft’s second-biggest business saw revenue growth of 6 percent in the quarter and 5 percent for the fiscal year. And even when you exclude the impact of prior-year Windows Upgrade Offer revenue deferrals, the division saw only a 6 percent revenue decline in the quarter year over year, and just 1 percent for the full year. That is honestly pretty astonishing.

The Server Division continued strong growth of 9 percent for both the quarter and year, with Microsoft noting double-digit percentage revenue growth for both SQL Server and System Center. The Entertainment and Devices Division, which is responsible for Xbox, saw 8 percent revenue growth in the quarter and 6 percent for the fiscal year.