Very Stupid Bug in Windows Mobile

by no2chem 19. April 2009 23:30

I just wasted 4 hours due to a rather stupid bug in Windows Mobile (and maybe Windows CE). For future reference, in case anyone else has the same problem.

Any subkey of:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn]
cannot be deleted once created and the device is restarted.

This will call cause all sorts of havoc, including causing CAB uninstalls to fail. The reason for this, you see is if you look at the very subtle text for DeleteKey in MSDN:

”An application cannot call this function for a key that an application currently has open.”

Hmm, now let’s see.. what application has HKLM\Drivers\BuiltIn always open? …Device.exe! Oh hmm,  so we can’t exactly tell device.exe to close the key… we can’t close device.exe … and we can’t even do anything to the registry before device.exe loads… looks like we’re pretty much screwed.

but wait… Maybe we can get a handle from device.exe… We can, with OpenDeviceKey, but we can’t do anything with it since we need the handle to HKLM\Drivers\Builtin, not the subkey.

So, unless you want your key on the device for a very long time, you should install your driver as a service, activate it manually… which kind of defeats the purpose of a driver…

Alternatively, you can just delete the values… but you’ll have to leave the empty key.. doesn’t seem like the right way to go either… Besides, if you put it in a cab, the cab will be forever uninstallable, as wceload.exe will just give up when it can’t delete the key. But don’t let me get started on wceload.exe and unload.exe… You’ll just get some stupid cryptic error message that your uninstall was unsuccessful.

So come on Microsoft – please add DeleteDevice or something… what if some malicious program were to exploit this? Also, please fix wceload, it… really needs an upgrade.

Tags:

Comments


April 11. 2009 22:45 | Reply
Cobaltikus
So someone could write a small program to write tons of crap to HKLM\Drivers\BuiltIn and overload the registry leaving only the option of a hard reset.

That would suck.

Is this still true in 6.5?


United States TADOW 
April 13. 2009 12:21 | Reply
TADOW
YEA "MS" & SPRINT ISNT REALLY TRYNA BOOST THERE SALES I MEAN THEY JUST LETTING APPLE KICK THEM IN THE ASS HEAVY LIKE WITH THE APPS AN THIS DAM TOUCH PRO FOR SPRINT IS THE WORST DEVICE WATERED DOWN I SEEN I REALLY WANT A GSM TOUCH HD OR TOUCH PRO 2 ATLEAST I WOULD BE GETTING LEXUS INSTEAD OF A TOYOTA....AS FAR AS I SEE IT ITS UP TO GUUS LIKE YOU TO MAKE THESE PHONES BETTER I WOULD DONATE BUT THERES NO REASON TO WIRE 5 TO 10 BUCKS FOR A CAB OR A REGISTRY HACK....I WOULD LIKE TO SEE SOMETHING REALLY INTERESTING DONE LIKE ANIMATED BACKGROUNDS FOR INSTANT....BETTER GRAPHICS...AN A REAL GPS LOCK!!!!!!! ATLEAST FOR THE TOUCH PRO CDMA BUT IT SEEM LIKE THATS TOO MUCH TO ASK FOR WHILE THE IPHONE IS LIKE HAVING A PS3 AN THESE OTHER PHONES IS ATARI ITS SO RIDICULOUS NO HARD FEELINGS BUT I JUST FOLLOW YALL GUYS WORK TO MUCH TO SEE SMALL IMPROVEMENTS ESPECIALLY NUE...YOU BEEN AROUND SINCE I GOT MY FIRST PPC 6700 I BELIEVE THAT WAS A REAL PDA NOT THIS 528 FAKE A HURTS TOUCH PRO CRAP WHICH IS ONLY GOOD FOR SUCKING UP ENERGY.


April 13. 2009 14:20 | Reply
Cobaltikus
What's with all the yelling tadow? Does your iPhone not have any lowercase keys?

Can you control your PS3 with your iPhone?
Can you control a PC with your iPhone?
Can you use Remote Desktop from anywhere and log into your home PC using your iPhone?

The Touch Pro can. What can an iPhone do that the Touch Pro can't?

And even if you were able to answer that, no2 could still trump it all by adding whatever is missing.

Who does the iPhone have, to add missing features? Is there a iNo2 somewhere?

You have a lot of nerve saying no2chem's work is not worth a donation. If you are unable to benefit from his very generous work then mind your own and go play with your iPhone and leave the Touch Pro threads to people who actually enjoy a truly versatile mobile device.


Germany anon ymous 
April 14. 2009 01:09 | Reply
anon ymous
yeah, you're right! iphone is not good, it's only money-making for nerds! and i am a mac-user, not an apple-hater...! so i'm not very emotional when telling you iphone has some really bad bugs: no a2dp with avrcp - which is f***ing-good and stylish, especially when watching movies in vga on diamond (i have no pro, but diamond is not bad also!) Wink i like it, and remember:
a community that makes a device better is worth much more than a crowd of arrogant style-a**holes...!



June 15. 2009 15:22 | Reply
my blog 2009



The things that will been true much in this site because of the factor that can be the affect the
availability of the posting.Thanks


August 3. 2009 06:25 | Reply
Farmers Branch Real Estate
Well, haven't used Windows CE and only seen it so can't really say about it much but ofcourse being a Windows thing it would be buggy somewhere. Softwares aren't 100% bug-free but I've a question, what approach they take to test out software before releasing? They can get so many testers and test it from every angle. Anyway, the reason I am commenting is because I wanted to say that now pretty soon, Linux Smartphones are also near so anyhow MS will have to compete well to stay in the market with other smartphones already existing. I am just waiting for the time when Linux-based SmartPhone will hit the market, I will try it out once it gets a bit stable.

August 3. 2009 07:20 | Reply
Cobaltikus
You know there is an Android (Linux) OS for the Touch Pro... As far as I know it does not yet support sound at the moment but it seems to be coming along quite nicely.



September 5. 2009 04:50 | Reply
mobile diabetes management
I just couldnt leave your website before saying that I really enjoyed the quality information you offer to your visitors... Will be back often to check up on new stuff you post!


September 6. 2009 04:28 | Reply
payday loans
I leave a lot of comments on a lot of blogs each week - but there is one situation where I rarely leave a comment - even if the post deserves it.Good work


September 13. 2009 11:52 | Reply
How to Fix a Slow Computer
Hi,
I was looking for that solution nearly all day.Can i copy this article into my blog?If you  are agree,we can exchange useful articles in the future?

Best Regards,
Chris


October 14. 2009 15:04 | Reply
Hosting
can i know how to solve the windows mobile contact sorting problem?


October 15. 2009 20:57 | Reply
Mobile Phones
A complete range of Mobile Phones, PDA Smartphones, Notebooks and GPS Solutions from Organiser World! Live stock availability. Featuring brands such as HTC, Nokia, Palm, HP, Sony, Sony Ericsson, Sandisk, Motorola, Asus, TomTom.


October 26. 2009 01:19 | Reply
tiffany jewelry
good


December 17. 2009 15:22 | Reply
reverse cell phone number look up
The things that will been true much in this site because of the factor that can be the affect the
availability of the posting.


January 10. 2010 01:33 | Reply
Franklin
Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that.


January 11. 2010 13:54 | Reply
India Phone Card
I think you are really an expert in writing unique blog. I am crazy about your thoughts.


January 16. 2010 08:32 | Reply
comfortable fitting bras
Your blog is one of the best ones. I think it is important to inform us about  different kinds of problems so that we are informed before we come across something. Your time is not lost, it is great that I am not the only person who admires your blogs! Continue in the same way!


February 17. 2010 06:12 | Reply
Dial India
Do you always write this stuff, over you head.. Great article! Tell me more, let it come.. You are master. Laughing


February 17. 2010 06:13 | Reply
Unlimited Calling Card to India
Excellent post.I want to thank you for this informative read, I really appreciate sharing this great post. Keep up your work…

Add comment


(Will show your Gravatar icon)
Type If you can out:

  Country flag

biuquote
  • Comment
  • Preview
Loading



Disclaimer
Windows Mobile is a registered trademark of Microsoft Corporation in the United States and other countries.

Wei Enterprises is not affiliated in any way with Microsoft, HTC, Sprint, or any other wireless carrier/phone manufacturer otherwise mentioned on this site.

Copyright 2010 2009 Wei Enterprises