In order to reduce the frequency of wineserver calls, as well as to simplify certain operations on NT kernel objects, it is proposed that a Linux kernel module be developed that supports the following NT kernel objects:
In order for a process to use an object, it must possess a handle to it. Handles are valid within the context of a single process. (Threads share the handle table.)
Handles can be transferred from one process to another by using DuplicateHandle.
NT handles will be implemented as file descriptors. The NT handle table will be implemented using the unix file descriptor table.
DuplicateHandle will not be supported directly. Process that wish to transfer file descriptors can do so by sending them over a unix socket or by opening the other process's fds directly in /proc.
Mutexes, events, semaphores and waitable timers can optionally be given names when they are created. Threads and processes have a name (a TID or PID) assigned by the NT kernel.
Those objects that are named can be opened later by using the appropriate per-object-type open function.
Mutexes, events, semaphores and waitable timers share a single namespace. I believe that threads and processes also share a single namespace among the two of them. (Window Terminal Server has the concept of global and local object names, but that will not be supported here.)
When the last handle referring to a mutex, event, semaphore or waitable timer is closed, the object and its name are deleted. Process and thread objects stay alive as long as there is an open handle, the process has at least on live thread object, or the thread is still running.
WineFS will provide a filesystem that will implement the namespaces. Each object type will have its own directory containing the named objects of that type. (Anonymous objects will not be represented in the filesystem.)