Add TRACEs to NtCreateFile returns (second try)

James Hawkins truiken at gmail.com
Mon Aug 25 14:39:20 CDT 2008


On Mon, Aug 25, 2008 at 2:29 PM, Markus Hitter <mah at jump-ing.de> wrote:
>
> Am 25.08.2008 um 17:58 schrieb James Hawkins:
>
>> On Mon, Aug 25, 2008 at 3:12 AM, Markus Hitter <mah at jump-ing.de> wrote:
>>>
>>> Am 25.08.2008 um 01:31 schrieb James Hawkins:
>>>
>>>> 2008/8/24 Markus Hitter <mah at jump-ing.de>:
>>>>
>>>> -    if (!attr || !attr->ObjectName) return STATUS_INVALID_PARAMETER;
>>>> +    if (!attr || !attr->ObjectName)
>>>> +    {
>>>> +        TRACE("returning STATUS_INVALID_PARAMETER\n");
>>>> +        return STATUS_INVALID_PARAMETER;
>>>> +    }
>>
>> If attr is NULL, you'll crash in the TRACE.
>
> Pardon. If attr is NULL, the TRACE() isn't even reached.
>

Have you even gone back to look at the code?  Do you know what a side
note is?  I've said it twice now that I wasn't talking about your
patch.  As the code stands now, regardless of your patch, the check
for NULL attr on line 154 of dlls/kernel32/file.c will never be hit
because we will crash in the TRACE on line 148 of
dlls/kernel32/file.c.

> As I obviously can't follow you how the additional TRACE() makes the code
> more fragile, please go ahead and post a short sample code showing how the
> above snippet is done right. Thanks.
>

The added TRACE has nothing to do with the fragility of the code.  My
comment still stands that the added TRACE is absolutely superfluous.

-- 
James Hawkins



More information about the wine-devel mailing list