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 <[email protected]> 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: [email protected] [mailto:ros-diffs-bounces@**
>> reactos.org <[email protected]>] On Behalf Of
>> [email protected]
>> Sent: 07 December 2011 17:51
>> To: [email protected]
>> 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<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
> [email protected]
> http://www.reactos.org/**mailman/listinfo/ros-dev<http://www.reactos.org/mailman/listinfo/ros-dev>
>
_______________________________________________
Ros-dev mailing list
[email protected]
http://www.reactos.org/mailman/listinfo/ros-dev

Reply via email to