Thomas Weidenmueller wrote:
Hartmut Birr wrote:
If a handle is created, the reference count of an object is dropped to zero. If an object is dereferenced we must look to the handle and the reference count.
after an object was created the reference counter should be 1. dereferencing that object directly after it was created should decrement it to 0 and delete it. the handle count should match the number of handles that exist for the object. When creating the first handle the reference counter should be incremented by 1, when deleting the last handle to the object it should be decremented by 1. For additional handles it should remain unchanged. I implemented this behavior in a local branch that completely replaces the handle implementation using generic executive handle tables. But i still have to track down a few bugs.
Of course, it is interesting to note that one of the reasons I have made an Ob rewrite is because of the way we incorrectly manage handles and references. Not only are our ObCreate/Insert routines badly implemented (which can create problems with drivers) but we also sometimes create handles out of thin air. There are other problems as well which influence the registry, like the fact that we don't send a parse context to the parse routine, and many more implementation issues. I have been waiting on Thomas to get the handle table working, because that will directly plug in with my Ob. Expect a branch in around 2 weeks (which won't compile or boot), and hopefully my design will have worked around this problem; it's entirely based on Windows'.
Best regards, Alex Ionescu