done with ScopedHandle.