MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2IsFileRemovable

Function Ext2IsFileRemovable

Ext4Fsd/fileinfo.c:1224–1265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222}
1223
1224NTSTATUS
1225Ext2IsFileRemovable(
1226 IN PEXT2_IRP_CONTEXT IrpContext,
1227 IN PEXT2_VCB Vcb,
1228 IN PEXT2_FCB Fcb,
1229 IN PEXT2_CCB Ccb
1230)
1231{
1232 PEXT2_MCB Mcb = Fcb->Mcb;
1233
1234 if (Mcb->Inode.i_ino == EXT2_ROOT_INO) {
1235 return STATUS_CANNOT_DELETE;
1236 }
1237
1238 if (IsMcbDirectory(Mcb)) {
1239 if (!Ext2IsDirectoryEmpty(IrpContext, Vcb, Mcb)) {
1240 return STATUS_DIRECTORY_NOT_EMPTY;
1241 }
1242 }
1243
1244 if (!MmFlushImageSection(&Fcb->SectionObject,
1245 MmFlushForDelete )) {
1246 return STATUS_CANNOT_DELETE;
1247 }
1248
1249 if (IsMcbDirectory(Mcb)) {
1250 FsRtlNotifyFullChangeDirectory(
1251 Vcb->NotifySync,
1252 &Vcb->NotifyList,
1253 Ccb,
1254 NULL,
1255 FALSE,
1256 FALSE,
1257 0,
1258 NULL,
1259 NULL,
1260 NULL
1261 );
1262 }
1263
1264 return STATUS_SUCCESS;
1265}
1266
1267NTSTATUS
1268Ext2SetDispositionInfo(

Callers 4

Ext2SetDispositionInfoFunction · 0.85
Ext2SetRenameInfoFunction · 0.85
Ext2SetLinkInfoFunction · 0.85
Ext2CreateFileFunction · 0.85

Calls 1

Ext2IsDirectoryEmptyFunction · 0.85

Tested by

no test coverage detected