我寻找 ntfs-4 源代码并查看说下一个代码NtfsSetRenameInfo
//
// Do a quick check that the caller is allowed to do the rename.
// The opener must have opened the main data stream by name and this can't be
// a system file.
//
if (!FlagOn( Ccb->Flags, CCB_FLAG_OPEN_AS_FILE ) ||
(Lcb == NULL) ||
(NtfsSegmentNumber( &Fcb->FileReference ) < FIRST_USER_FILE_NUMBER)) {
DebugTrace( -1, Dbg, ("NtfsSetRenameInfo: Exit -> %08lx\n", STATUS_INVALID_PARAMETER) );
return STATUS_INVALID_PARAMETER;
}
FileDispositionInformation
和FILE_DELETE_ON_CLOSE
选项(1)的情况相同
if (FlagOn( Ccb->Flags, CCB_FLAG_DELETE_ON_CLOSE )) {
if (FlagOn( Ccb->Flags, CCB_FLAG_OPEN_AS_FILE )) {
因此,如果未在文件中设置,由于某种原因 ntfs 不允许重命名或删除CCB_FLAG_OPEN_AS_FILE
文件。(id打开文件时不设置)