This is just for my personal curiosity. I'm trying to understand how would someone use ExSetResourceOwnerPointerEx function to transfer ownership of the resource from one thread to another. Somehow if I call it with its OwnerPointer argument set to anything other than the current thread address (with its lower 2 bits set) it always bug-checks with RESOURCE_OWNER_POINTER_INVALID (132).
My understanding was that I can first call ExAcquireResourceSharedLite(Resource, TRUE) in one thread, then call ExSetResourceOwnerPointerEx(Resource, AnotherThreadAddress, FLAG_OWNER_POINTER_IS_THREAD) to transfer its ownership to AnotherThread, and then from AnotherThread I can then call ExReleaseResourceForThreadLite(Resource, FirstThreadAddr).
But I don't think I fully understand those two functions.