Windows: Hold ProcessTreeLock across AFSValidateProcessEntry
AFSValidateProcessEntry() is called from AFSProcessCreate() which
holds the ProcessTree.TreeLock exclusive across the call and from
AFSCreate() and AFSRetrieveAuthGroup() where it is not held at all.
Add a parameter to AFSValidateProcessEntry() that indicates whether
or not the ProcessTree.TreeLock is held. If it is held, it must be
held exclusive. If it is not held, the lock must be acquired within
AFSValidateProcessEntry() and it must be held for the entire lifetime
of the pParentProcessCB reference. Failure to hold the TreeLock
for the lifetime of the reference permits a race with AFSProcessDestroy()
that can result in the parent ProcessCB being destroyed while its
Resource is held.