protected override bool ReleaseHandle() { // Check whether the handle is set AND whether the handle has been successfully closed return handle != IntPtr.Zero && NativeMethods.CloseHandle(handle); }