Monday, April 2, 2007

Managed UMDF breathes!

It's alive! After a long night of stupid user errors, I have a do-nothing UMDF driver up and running that's completely managed. There's a tiny C shim that loads .NET and my driver assembly, and everything else is managed from that point. I was hoping to get the automatic COM activation support working (for a completely unmanaged-code-free experience), but alas, 'twas not so.

Having crashed the driver several hundred times getting to this point, I'm pretty impressed with the robustness of the UMDF reflector. There's a scary display flash sometimes when a user-mode driver fails, but the system stays up and everything is happy. I only BSOD'd once during the whole ordeal, and given the iffy hardware I'm running on, I can't necessarily attribute it to the UMDF reflector crashing.

Turned out the stack corruption I was experiencing was just a missing QueryInterface call right after I started the framework. I've been used to things just returning the right interface- casting that IUnknown* to an IAppDomainSetup* was, in retrospect, a bad idea. What's weird is that the DDK build environment won't seem to build me a PDB with everything for my stuff- I can't see a number of my locals while debugging (including the HRESULT I'm using all over the place). I'm sure it's one of the hundreds of makefile options, but I don't feel like tracking it down.

Anyway, the Optimus Sideshow driver is progressing well. If I get really bored, I might try and release the managed UMDF framework I'm building on its own. I don't know how useful building drivers in managed code really is, but we've found at least one case for it. I'm trying to keep this stuff generic enough that it could be reused without much hassle.

Oy- it's late. Gonna be a bleary-eyed day at the office tomorrow.


Dan said...

Hi Matt,

Any chanse the managed UMDF framework will be released ?

It will be fantastic.

Thanks in advance, Dan

Matt Davis said...

I've heard rumor that they're still working on a "real" managed UMDF at MS, but don't know the status... It's been so long, I don't think I even have the code for mine any more.