Re: [ros-dev] [ros-diffs] [pschweitzer] 64617: [NTFS] - Add a directory entry into FCB which will be a copy of the $FILE_NAME attribute of the FILE record. Though, it won't contain the name itself (in
Ah yes! Oopsie :-$ Let's not add more leaks into it! On 08/10/2014 21:54, Thomas Faber wrote: > On 2014-10-08 21:32, pschweit...@svn.reactos.org wrote: >> +MftRecord = ExAllocatePoolWithTag(NonPagedPool, >> + Vcb->NtfsInfo.BytesPerFileRecord, >> + TAG_NTFS); >> +if (MftRecord == NULL) >> +{ >> +return NULL; >> +} >> + >> +if (!NT_SUCCESS(ReadFileRecord(Vcb, NTFS_FILE_ROOT, MftRecord))) >> +{ >> +return NULL; >> +} >> + >> +FileName = GetFileNameFromRecord(MftRecord); >> +if (!FileName) >> +{ >> +return NULL; >> +} >> >> Fcb = NtfsCreateFCB(L"\\", Vcb); >> - >> -//memset(Fcb->entry.Filename, ' ', 11); >> - >> -//Fcb->Entry.DataLengthL = Vcb->CdInfo.RootSize; >> -//Fcb->Entry.ExtentLocationL = Vcb->CdInfo.RootStart; >> -//Fcb->Entry.FileFlags = 0x02; // FILE_ATTRIBUTE_DIRECTORY; >> +if (!Fcb) >> +{ >> +return NULL; >> +} > > > These failure cases look like they're all at least leaking MftRecord :p > > ___ > Ros-dev mailing list > Ros-dev@reactos.org > http://www.reactos.org/mailman/listinfo/ros-dev > -- Pierre Schweitzer System & Network Administrator Senior Kernel Developer ReactOS Deutschland e.V. smime.p7s Description: S/MIME Cryptographic Signature ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [pschweitzer] 64617: [NTFS] - Add a directory entry into FCB which will be a copy of the $FILE_NAME attribute of the FILE record. Though, it won't contain the name itself (in
On 2014-10-08 21:32, pschweit...@svn.reactos.org wrote: > +MftRecord = ExAllocatePoolWithTag(NonPagedPool, > + Vcb->NtfsInfo.BytesPerFileRecord, > + TAG_NTFS); > +if (MftRecord == NULL) > +{ > +return NULL; > +} > + > +if (!NT_SUCCESS(ReadFileRecord(Vcb, NTFS_FILE_ROOT, MftRecord))) > +{ > +return NULL; > +} > + > +FileName = GetFileNameFromRecord(MftRecord); > +if (!FileName) > +{ > +return NULL; > +} > > Fcb = NtfsCreateFCB(L"\\", Vcb); > - > -//memset(Fcb->entry.Filename, ' ', 11); > - > -//Fcb->Entry.DataLengthL = Vcb->CdInfo.RootSize; > -//Fcb->Entry.ExtentLocationL = Vcb->CdInfo.RootStart; > -//Fcb->Entry.FileFlags = 0x02; // FILE_ATTRIBUTE_DIRECTORY; > +if (!Fcb) > +{ > +return NULL; > +} These failure cases look like they're all at least leaking MftRecord :p ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev