David Howells dhowells@redhat.com writes:
I'm having a little trouble deciding exactly how to emulate the "module registration" functionality in my kernel module. It occurs to me that this might be easier to accomplish with a change to the current wine server message set. My idea is:
Have the server only deal with NT Section objects and views of Sections.
Have no separate module table attached to a process.
Implement NtQuerySectionInformation/NtSetSectionInformation calls (or whatever they're called) as wineserver messages.
Add an extra Wine-specific information class for the purpose of recording the extra module information.
The wineserver process structure can then be changed so that rather than keeping a separate list of process_dlls, they can just keep a list of section views, some of which will be images/modules.
Maintaining a section list in the server is certainly something we could do, but I don't really see why you want to get rid of the modules list. What would you gain by doing that?>
Maintaining a section list in the server is certainly something we could do, but I don't really see why you want to get rid of the modules list. What would you gain by doing that?>
NtMapViewOfSection/NtUnmapViewOfSection.
Admittedly, these would be hard to implement fully in the current Wine userspace server I think (they can map a section handle into _another_ process's VM space). However, it's something I can do in kernel space reasonably easily.
And then there's NtQueryVirtualMemory. This can return a handle to the backing section (assuming I'm recalling this correctly) in some other process.
Actually, I see that you do maintain a view list in the client as well as the module list and section lists in the server. What I was thinking of was just consolidating the three into a single view list and a single section list in the server.
In effect, Wine'd still have the module list, it's just that there'd be non-modules in the list too.
This would mean that the debugger could query from the server what Windows VM mappings should be expected.
And, of course, it'd make writing the kernel module slightly easier:-)
David