Potentially unneccisary SafeHandle creation
kellyelton opened this issue · 1 comments
kellyelton commented
What is the purpose of putting the handle in a SafeHandle and returning it to the caller via an out
parameter? If you look at the source for WindowsIdentity.Impersonate it looks like it already duplicates the handle into a safe handle.
mattjohnsonpint commented
The version you reported this in held on to that handle and later disposed it to end the impersonation context. It was not returned to the end user, but held in a private instance field.
I have recently revised the API considerably with version 3.0.0, so this is no longer relevant. But thanks.