On resources and KTHREAD

Zebediah Figura z.figura12 at gmail.com
Thu Jan 31 21:44:16 CST 2019


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

[1] https://www.nirsoft.net/kernel_struct/vista/index.html



More information about the wine-devel mailing list