Is Research In Motion (NASDAQ:RIMM) losing its stranglehold on hordes of fanatically dedicated BlackBerry users? IT research firm Gartner seems to think so, as a senior analyst spills the beans on a pretty bleak outlook for RIM's market position. But it's not all bad news.

Gartner VP Ken Dulaney sees RIM's market share in the burgeoning smartphone segment shrinking over the years, moving from a 20% unit share today to a mere 12.8% at the end of 2012. The BlackBerry will be leapfrogged by the Apple (NASDAQ:AAPL) iPhone, Microsoft (NASDAQ:MSFT) Windows Mobile, and Google (NASDAQ:GOOG) Android platforms in three years, according to Gartner. And Nokia (NYSE:NOK), the global market leader in smartphone sales, is expected to lose gobs of market share to the surging competition.

So that's the bad news: lower market shares for RIM and Nokia. Dang it!

Now for the good news: The market will expand so rapidly that the share losses might not be as painful as headline numbers might demonstrate. According to Gartner, RIM sold 7.7 million handsets in the smartphone class last quarter. By the fourth quarter of 2012, Gartner sees a staggering 65 million RIM smartphones in the hands of active users. The total smartphone market saw 41 million units sold last quarter. Accounting for upgraded old smartphones and whatnot, Gartner thinks we'll see 522 million smartphones in use by 2012.

That's a huge market, and we're nowhere near that market size today. Losing market share is never a positive, but even under dire predictions, RIM still looks like an explosive growth opportunity based on smartphone growth alone. Gartner believes even little Palm (NASDAQ:PALM) should sell some 10 million units of the Pre and its successors, for crying out loud. Palm hasn't released sales figures for the Pre, but it's generally believed that around half a million units were sold last quarter.

So, yeah, RIM might be losing its claims to uniqueness and unmatched features, but it will make up for that in volume. Analyst firm Robert W. Baird agrees with that thinking, moving RIM from "hold" to "buy" on a depressed valuation and upcoming catalysts like the Storm 2 handset.

Now, there's always a chance that both of these analysts misjudged this market's growth prospects, and as we've seen with the Palm Pre, there are no guarantees that the Storm 2 will be a hit. Still, according to Gartner, most market-loss share will come at the hands of the Android and Windows Mobile. These are capable competitors, but they're also more difficult to cash in on. Google and Microsoft don’t make nearly the kind of profit from their smartphone software as BlackBerry does with its enclosed system, which commands strong hardware margins. While RIM may have some competitive question marks going forward, it's still a pretty smart way to invest in heady smartphone growth.

So I might not agree with every point of Gartner's fine print, but I do agree with its conclusions: RIM has a lot of long-term growth ahead, and so does Nokia -- even while their market shares are shrinking.