Updated with SafeHandle & ScopedSRWLock