|
From: Phillip S. <ps...@cf...> - 2001-11-03 01:47:25
|
At 10:25 PM 11/1/2001 -0800, you wrote: >When a process exits, a win32k function will need to be called that will >clean up all outstanding handles in the table. This can be called from GDI32 >DLL rundown I think. Bad idea... TerminateProcess() does not call dll detach routines to cleanup, and we don't want to leak GDI objects. GDI handles are process specific anyway, so maybe we can just locate all GDI objects and the handle table in the process address space, so when that is cleaned up, they go away? If not, there should be a kernel mode callback to clean up when the process is killed. BTW: Did you make the handle value compliant with win32 with respect to how it is broken down into an index part, and a uniqueness part, to keep handle values from being reused? >I used a fast mutex to protect access to the table. Is this a reasonable >sync object to use across processes? GDI handles are process specific, so there shouldn't be a global table shared by all processes. I forget what a fast mutex is, but any sync object should work between threads of the same process at least. >GDI handles keep the process id as a field, but PsGetCurrentProcess does >not seem to be available to a kernel mode dll. Which function is available >that returns the current process id? > >Accoring to all I can find, GDI handles (and GDI functions) are not thread >safe. >So I removed all the code that was locking and unlocking individual handles. >I originally added the handle locking code based on a hint from >Wine. However, >is code involving User handles expected to be thread safe? I dont see how if >the underlying GDI calls are not, but its possible. If so we cannot reuse the >GDI handle routines for User handles as I would like to. Both USER and GDI handles must be thread safe. We don't want the kernel crashing because two threads call a function on the same object at the same time. What made you think they are not thread safe? ==================================================== = To remove yourself from this mailing list, go to = = http://www.reactos.com/home/mailing.html = ==================================================== |