[ros-dev] IoCheckEaBufferValidity
Alex Ionescu
ionucu at videotron.ca
Tue Aug 21 18:08:39 CEST 2007
Please make sure your code is consident with the ReactOS Coding style as
well as the general kernel formatting that is already present in almost all
the kernel files.
PBYTE is not a kernel type, it is a Win32 type, and should not be used.
Please use ULONG_PTR for pointer arithmetic.
Please explain what the line "LenOfEaBuffer = ((LenOfEaBuffer + 3) &
0xFFFFFFFC);" is trying to achieve, as well as this calculation:
"EaBufferEnd->EaNameLength+EaBufferEnd->EaValueLength + 9;".
Thank you!
On 8/20/07, netzimme at aim.com <netzimme at aim.com> wrote:
>
> Hallo
>
> Have a patch that implemented the function IoCheckEaBufferValidity in
> ntoskrnl\io\iomgr\util.c.
> Tested with Windows 2000 and Vista Ultimate 64 Bit.
> Perhaps some one can comit it for me.
>
> Thanks
> dz
>
>
>
>
> ------------------------------
> *Check Out the new free AIM(R) Mail*<http://pr.atwola.com/promoclk/100122638x1081283466x1074645346/aol?redir=http%3A%2F%2Fwww%2Eaim%2Ecom%2Ffun%2Fmail%2F>-- 2 GB of storage and industry-leading spam and email virus protection.
>
>
> ===================================================================
> --- file.c (revision 28441)
> +++ file.c (working copy)
> @@ -1632,6 +1632,7 @@
> IN ULONG Options)
> {
> KPROCESSOR_MODE AccessMode;
> + ULONG EaErrorOffset;
> HANDLE LocalHandle = 0;
> LARGE_INTEGER SafeAllocationSize;
> PVOID SystemEaBuffer = NULL;
> @@ -1732,10 +1733,10 @@
> /* Validate the buffer */
> Status = IoCheckEaBufferValidity(SystemEaBuffer,
> EaLength,
> - NULL);
> + &EaErrorOffset);
> if (!NT_SUCCESS(Status))
> {
> - /* FIXME: Fail once function is implemented */
> + DPRINT1("FIXME: IoCheckEaBufferValidity failed with
> Status: %lx\n",Status);
> }
> }
> }
> Index: util.c
> ===================================================================
> --- util.c (revision 28441)
> +++ util.c (working copy)
> @@ -129,8 +129,9 @@
> return STATUS_SUCCESS;
> }
>
> +
> /*
> - * @unimplemented
> + * @implemented
> */
> NTSTATUS
> NTAPI
> @@ -138,10 +139,58 @@
> IN ULONG EaLength,
> OUT PULONG ErrorOffset)
> {
> - UNIMPLEMENTED;
> - return STATUS_NOT_IMPLEMENTED;
> + PFILE_FULL_EA_INFORMATION EaBufferEnd;
> + ULONG LenOfEaBuffer;
> + UINT IntEaLength;
> +
> + IntEaLength = EaLength;
> + EaBufferEnd = EaBuffer;
> +
> + while (IntEaLength >= 8)
> + {
> + LenOfEaBuffer =
> EaBufferEnd->EaNameLength+EaBufferEnd->EaValueLength + 9;
> + if (IntEaLength >= LenOfEaBuffer)
> + {
> + if (EaBufferEnd->EaName[EaBufferEnd->EaNameLength]==0)
> + {
> + if (EaBufferEnd->NextEntryOffset == 0)
> + {
> + IntEaLength = IntEaLength - LenOfEaBuffer;
> + if (IntEaLength>=0)
> + {
> + return STATUS_SUCCESS;
> + }
> + }
> + else
> + {
> + LenOfEaBuffer = ((LenOfEaBuffer + 3) & 0xFFFFFFFC);
> + if (EaBufferEnd->NextEntryOffset == LenOfEaBuffer)
> + {
> + if (EaBufferEnd->NextEntryOffset>0)
> + {
> + IntEaLength = IntEaLength -
> EaBufferEnd->NextEntryOffset;
> + if (IntEaLength>=0)
> + {
> + LenOfEaBuffer = EaBufferEnd->NextEntryOffset;
> + EaBufferEnd =
> (PFILE_FULL_EA_INFORMATION)((PBYTE)EaBufferEnd + LenOfEaBuffer);
> + continue;
> + }
> + }
> + }
> + }
> + }
> + }
> + break;
> + }
> + if (ErrorOffset != NULL)
> + {
> + *ErrorOffset = (ULONG)((PBYTE)EaBufferEnd - (PBYTE)EaBuffer);
> + }
> +
> + return STATUS_EA_LIST_INCONSISTENT;
> }
>
> +
> /*
> * @unimplemented
> */
>
>
>
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev
>
>
--
Best regards,
Alex Ionescu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-dev/attachments/20070821/05cf3bcc/attachment.html
More information about the Ros-dev
mailing list