From 0ae9117fc521b59e56a7e9c774d5fface3202427 Mon Sep 17 00:00:00 2001 From: Bo Branten Date: Wed, 19 Jun 2024 01:39:12 +0200 Subject: [PATCH] corrected an error that made the debug version of the driver crash --- Ext4Fsd/ext3/generic.c | 8 ++++---- Ext4Fsd/fsctl.c | 4 ++-- Ext4Fsd/memory.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Ext4Fsd/ext3/generic.c b/Ext4Fsd/ext3/generic.c index e938a84..cc7910a 100644 --- a/Ext4Fsd/ext3/generic.c +++ b/Ext4Fsd/ext3/generic.c @@ -510,7 +510,7 @@ Ext2LoadInode (IN PEXT2_VCB Vcb, } if (!Ext2LoadBuffer(NULL, Vcb, offset, EXT4_INODE_SIZE(Inode->i_sb), ext4i)) { - ExFreePool(ext4i); + Ext2FreePool(ext4i, EXT2_INODE_MAGIC); return FALSE; } @@ -518,7 +518,7 @@ Ext2LoadInode (IN PEXT2_VCB Vcb, ext4_inode_csum_verify(Inode, ext4i, &unused); - ExFreePool(ext4i); + Ext2FreePool(ext4i, EXT2_INODE_MAGIC); return TRUE; } @@ -572,7 +572,7 @@ Ext2SaveInode ( IN PEXT2_IRP_CONTEXT IrpContext, rc = Ext2LoadBuffer(NULL, Vcb, offset, EXT4_INODE_SIZE(Inode->i_sb), ext4i); if (!rc) { DEBUG(DL_ERR, ( "Ext2SaveInode: failed reading inode %u.\n", Inode->i_ino)); - ExFreePool(ext4i); + Ext2FreePool(ext4i, EXT2_INODE_MAGIC); goto errorout; } @@ -586,7 +586,7 @@ Ext2SaveInode ( IN PEXT2_IRP_CONTEXT IrpContext, Ext2StartFloppyFlushDpc(Vcb, NULL, NULL); } - ExFreePool(ext4i); + Ext2FreePool(ext4i, EXT2_INODE_MAGIC); errorout: return rc; diff --git a/Ext4Fsd/fsctl.c b/Ext4Fsd/fsctl.c index f11c770..0596fe8 100644 --- a/Ext4Fsd/fsctl.c +++ b/Ext4Fsd/fsctl.c @@ -622,7 +622,7 @@ Ext2IsVolumeDirty ( IrpSp = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); // - // Get a pointer to the output buffer. Look at the system buffer field in th + // Get a pointer to the output buffer. Look at the system buffer field in the // irp first. Then the Irp Mdl. // @@ -2677,7 +2677,7 @@ Ext2CheckDismount ( if (NewVpb != NULL) { DEBUG(DL_DBG, ( "Ext2CheckDismount: freeing new Vpb %p\n", NewVpb)); - ExFreePoolWithTag(NewVpb, TAG_VPB); + Ext2FreePool(NewVpb, TAG_VPB); DEC_MEM_COUNT(PS_VPB, NewVpb, sizeof(VPB)); } diff --git a/Ext4Fsd/memory.c b/Ext4Fsd/memory.c index 7893194..b92e094 100644 --- a/Ext4Fsd/memory.c +++ b/Ext4Fsd/memory.c @@ -433,7 +433,7 @@ VOID Ext2FreeEntry (IN struct dentry *de) ASSERT(de != NULL); if (de->d_name.name) - ExFreePool(de->d_name.name); + Ext2FreePool(de->d_name.name, 'EB2E'); ExFreeToNPagedLookasideList(&(Ext2Global->Ext2DentryLookasideList), de); DEC_MEM_COUNT(PS_DENTRY, de, sizeof(struct dentry)); @@ -2819,7 +2819,7 @@ Ext2DestroyVcb (IN PEXT2_VCB Vcb) if (IsFlagOn(Vcb->Flags, VCB_NEW_VPB)) { ASSERT(Vcb->Vpb2 != NULL); DEBUG(DL_DBG, ("Ext2DestroyVcb: Vpb2 to be freed: %p\n", Vcb->Vpb2)); - ExFreePoolWithTag(Vcb->Vpb2, TAG_VPB); + Ext2FreePool(Vcb->Vpb2, TAG_VPB); DEC_MEM_COUNT(PS_VPB, Vcb->Vpb2, sizeof(VPB)); Vcb->Vpb2 = NULL; }