[ros-dev] [ros-diffs] [tthompson] 71807: [NTFS][FREELDR] Fix ReadAttribute() and NtfsReadAttribute() in the case when an attribute contains two data runs; Remove extra if statement that prevents second data run from bei...

Pierre Schweitzer pierre at reactos.org
Wed Jul 6 19:09:26 UTC 2016


Actually, this (duplicated) function looks quite poorly designed (not
your fault, obviously :-p).
The more you fix it, the more it seems natural that the first specific
case should be integrated in the while loop for real. That would make
the function more robust, with less duplicated code (and thus, less bugs
:-p).

GSoC note: this is not a "todo" task. This is just an open discussion
about a possible improvement if some day someone's bored.

Le 04/07/2016 19:02, tthompson at svn.reactos.org a écrit :
> Author: tthompson
> Date: Mon Jul  4 17:02:10 2016
> New Revision: 71807
> 
> URL: http://svn.reactos.org/svn/reactos?rev=71807&view=rev
> Log:
> [NTFS][FREELDR]
> Fix ReadAttribute() and NtfsReadAttribute() in the case when an attribute contains two data runs; Remove extra if statement that prevents second data run from being read after it's decoded.
> 
> Modified:
>     branches/GSoC_2016/NTFS/boot/freeldr/freeldr/lib/fs/ntfs.c
>     branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
> 
> Modified: branches/GSoC_2016/NTFS/boot/freeldr/freeldr/lib/fs/ntfs.c
> URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/boot/freeldr/freeldr/lib/fs/ntfs.c?rev=71807&r1=71806&r2=71807&view=diff
> ==============================================================================
> --- branches/GSoC_2016/NTFS/boot/freeldr/freeldr/lib/fs/ntfs.c	[iso-8859-1] (original)
> +++ branches/GSoC_2016/NTFS/boot/freeldr/freeldr/lib/fs/ntfs.c	[iso-8859-1] Mon Jul  4 17:02:10 2016
> @@ -320,9 +320,6 @@
>              }
>              else
>                  DataRunStartLCN = -1;
> -
> -            if (*DataRun == 0)
> -                return AlreadyRead;
>          }
>  
>          while (Length > 0)
> 
> Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
> URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c?rev=71807&r1=71806&r2=71807&view=diff
> ==============================================================================
> --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c	[iso-8859-1] (original)
> +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c	[iso-8859-1] Mon Jul  4 17:02:10 2016
> @@ -384,9 +384,6 @@
>              }
>              else
>                  DataRunStartLCN = -1;
> -
> -            if (*DataRun == 0)
> -                return AlreadyRead;
>          }
>  
>          while (Length > 0)
> 
> 


-- 
Pierre Schweitzer <pierre at reactos.org>
System & Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3960 bytes
Desc: Signature cryptographique S/MIME
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20160706/037f700e/attachment-0001.bin>


More information about the Ros-dev mailing list