Thursday, December 04, 2008 12:01 AM
Michael S. Kaplan
ImmGetDescription: another casualty of the IMM to TSF migration
VB expert and long time compatriot/comrade Bill McCarthy asked over in the Suggestion Box:
Hey Michka,
Can you tell us why ImmGetDescription seems to return zero length on Vista ? Is it broken ?
Thanks.
It's funny how many people still know me as Michka

Including me. :-)
Questions like this might bring up a "greatest hits" kind of issue in your mind.
I mean, after blogs like Sprechen Sie IME? and And you think finding presidential candidates is hard? Try getting the Vista IME candidate list!, it is obvious that I have tried to make a point of pointing out how TSF broke a bunch of IMM stuff.
Since it did break a couple of interesting edge cases....
This case is due to an issue I somewhat indirectly described in That's no gap, dear; that's a huge freaking chasm!, where I said:
There are now a huge ton of IMEs that do not follow that "E" prefix rule, since their support is entirely through TSF now.
You may wonder why I am pointing out this in particular....
I'll explain by revealing secret information. You know, like in the spirit of 15 million lines of Windows code revealed...., Here are two lines olf source from the ImmGetDescriptionW function:
if (!IS_IME_KBDLAYOUT(hKL))
return 0;
Wait, that won't help. I'll have to reveal one more line of source -- the definition of the IS_IME_KBDLAYOUT function:
#define IS_IME_KBDLAYOUT(hkl) ((HIWORD((ULONG_PTR)(hkl)) & 0xf000) == 0xe000)
Ah, so we have that same 0xE0000000 problem in our code too! :-(
And now that every single inbox IME uses TSF -- the Text Services Framework -- (one way or another), unless you install a version of Office that includes those hooks to make Text Service Framework TIPs look like old style IMEs, the ImmGetDescription function is pretty much gonna be determined to fail, since there is a lack of a process that tries to artificially put the HKL values into the place that the old architecure used to put them as a design principle.
In the end, the ImmGetDescription function looks like just another victim on the IMM side of the IMM to TSF migration....
This blog brought to you by ! (U+0021, aka EXCLAMATION MARK, aka Exclamation Point, aka Bang)