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

Function Ext2SetRenameInfo

Ext4Fsd/fileinfo.c:1310–1648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1308}
1309
1310NTSTATUS
1311Ext2SetRenameInfo(
1312 PEXT2_IRP_CONTEXT IrpContext,
1313 PEXT2_VCB Vcb,
1314 PEXT2_FCB Fcb,
1315 PEXT2_CCB Ccb
1316)
1317{
1318 PEXT2_MCB Mcb = Fcb->Mcb;
1319
1320 PEXT2_FCB TargetDcb = NULL; /* Dcb of target directory */
1321 PEXT2_MCB TargetMcb = NULL;
1322 PEXT2_FCB ParentDcb = NULL; /* Dcb of it's current parent */
1323 PEXT2_MCB ParentMcb = NULL;
1324
1325 PEXT2_FCB ExistingFcb = NULL; /* Target file Fcb if it exists*/
1326 PEXT2_MCB ExistingMcb = NULL;
1327
1328 UNICODE_STRING FileName;
1329
1330 NTSTATUS Status;
1331
1332 PIRP Irp;
1333 PIO_STACK_LOCATION IrpSp;
1334
1335 PFILE_OBJECT FileObject;
1336 PFILE_OBJECT TargetObject;
1337
1338 struct dentry *NewEntry = NULL;
1339
1340 BOOLEAN ReplaceIfExists;
1341 BOOLEAN bMove = FALSE;
1342 BOOLEAN bTargetRemoved = FALSE;
1343
1344 BOOLEAN bFcbLockAcquired = FALSE;
1345
1346 PFILE_RENAME_INFORMATION FRI;
1347
1348 if (Ccb->SymLink) {
1349 Mcb = Ccb->SymLink;
1350 }
1351
1352 if (Mcb->Inode.i_ino == EXT2_ROOT_INO) {
1353 Status = STATUS_INVALID_PARAMETER;
1354 goto errorout;
1355 }
1356
1357 Irp = IrpContext->Irp;
1358 IrpSp = IoGetCurrentIrpStackLocation(Irp);
1359
1360 FileObject = IrpSp->FileObject;
1361 TargetObject = IrpSp->Parameters.SetFile.FileObject;
1362 ReplaceIfExists = IrpSp->Parameters.SetFile.ReplaceIfExists;
1363
1364 FRI = (PFILE_RENAME_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
1365
1366 if (TargetObject == NULL) {
1367

Callers 1

Ext2SetFileInformationFunction · 0.85

Calls 13

Ext2AllocateFcbFunction · 0.85
Ext2LookupFileFunction · 0.85
Ext2IsFileRemovableFunction · 0.85
Ext2DeleteFileFunction · 0.85
Ext2RemoveEntryFunction · 0.85
Ext2AddEntryFunction · 0.85
Ext2SetParentEntryFunction · 0.85
Ext2NotifyReportChangeFunction · 0.85
Ext2RemoveMcbFunction · 0.85
Ext2InsertMcbFunction · 0.85
Ext2BuildNameFunction · 0.85
Ext2FreeEntryFunction · 0.85

Tested by

no test coverage detected