As the last leg of my journey (for now) implementing Windows' thousand synchronization objects, I arrive at ERESOURCE. Unlike the last three forms of mutex, these can be recursively acquired, and so it's necessary to keep track of who is holding them. I have a complete implementation that passes its own tests, but only with KeGetCurrentThread() stubbed to return the TID.
A proper implementation of KeGetCurrentThread() is already required by some drivers (bug 45844). What would be necessary to implement this function in an acceptable way? If simply returning the TID isn't enough (and I believe this approach has been rejected before), how much of the structure need we correctly implement? How can we find out what that structure is, undocumented as it is? (For a slightly more concrete question: is [1] a legally safe source?)
ἔρρωσθε, Zeb