fix bug about file IsOpened and INVALID_HANDLE_VALUE