As Dmitry rightly pointed out, wine-devel is a good place to post stuff for help/comments/review, so here is an (almost) full diff of my tree against cvs. Without going as far as making wineserver a user mode ntoskrnl like mike_m suggested, this code allows kernel mode drivers to work decently in wine, naturally not many have been tested but it's a start. Alexadre's main complaint is that it's ugly to pass handles to ntoskrnl because it's a client process, currently we pass a pointer to a DEVICE_OBJECT, that obviously won't do but we're not sure what would do, suggestions are welcome. secdrv.sys from safedisc 1 works. Some code used to work around the anti debugger checks has been removed, so you can't run safedisc in winedbg with this patch. Running tools/make_requests and a full ./config.status && make depend && make is needed to build this patch.
Ivan.