[PATCH v4] ntoskrnl.exe: Implement ZwLoadDriver and ZwUnloadDriver

Sebastian Lackner sebastian at fds-team.de
Sat Jan 23 10:29:32 CST 2016


On 23.01.2016 15:44, Alexandre Julliard wrote:
> Sebastian Lackner <sebastian at fds-team.de> writes:
> 
>> > * In theory, all drivers should be loaded into the same address space. This means,
>> >   winedevice and the wineserver has to keep track of them, and its not sufficient to
>> >   maintain a list in ntoskrnl.exe.
> We may want a system-wide list of drivers at some point, but so far we
> haven't needed that. If it turns out to be necessary, it can certainly
> be added later.
> 
> However, the goal is not to load all drivers in the same address space,
> that would be very fragile. Drivers should be in separate processes,
> except when they truly need to talk to each other; that what's this
> patch is supposed to make possible.

We already have bugs for issues caused by drivers trying to communicate with
each other: https://bugs.winehq.org/show_bug.cgi?id=37356.

How do you want to decide which drivers should go into the same process, and
which not? As mentioned above, loading the same driver twice is something
which is not supported in most cases. 

If a solution with marshalling all structs back and forth is preferred, there
is also no need to move the code for loading the driver. Instead, ZwLoadDriver
should spawn a new service then. However that only works as long as drivers
use officially documented structures.




More information about the wine-devel mailing list