It's defensive programming so you don't depend on the callers zero-initalizing their input.

Best regards,
Alex Ionescu


On Wed, Dec 7, 2011 at 10:24 AM, Aleksey Bragin <aleksey@reactos.org> wrote:
It's done to zero-initialize all what was provided and only then check if enough params were provided. We usually use same approach in other kernel functions (zero init all what's possible, then perform more complex validation and fail if validation fails).

I'm not sure whether that's so useful there, because if the caller gets non-successful status, he shouldn't be using these parameters anyway.

WBR,
Aleksey Bragin.


On 07.12.2011 21:59, Ged Murphy wrote:
Quick typo, your param  checks in LdrpCheckForKnownDll come after your initialization


-----Original Message-----
From: ros-diffs-bounces@reactos.org [mailto:ros-diffs-bounces@reactos.org] On Behalf Of fireball@svn.reactos.org
Sent: 07 December 2011 17:51
To: ros-diffs@reactos.org
Subject: [ros-diffs] [fireball] 54606: [NTDLL/LDR] - Improve LdrpCheckForKnownDll by adding parameters validation, return status value, better failure paths handling.

Author: fireball
Date: Wed Dec  7 17:51:18 2011
New Revision: 54606

URL: http://svn.reactos.org/svn/reactos?rev=54606&view=rev
Log:
[NTDLL/LDR]
- Improve LdrpCheckForKnownDll by adding parameters validation, return status value, better failure paths handling.

Modified:
    trunk/reactos/dll/ntdll/include/ntdllp.h
    trunk/reactos/dll/ntdll/ldr/ldrutils.c




_______________________________________________
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev