Add TRACEs to NtCreateFile returns (second try)

Markus Hitter mah at jump-ing.de
Mon Aug 25 03:12:49 CDT 2008


Am 25.08.2008 um 01:31 schrieb James Hawkins:

> 2008/8/24 Markus Hitter <mah at jump-ing.de>:
>>
>
> +    if (!attr || !attr->ObjectName)
> +    {
> +        TRACE("returning STATUS_INVALID_PARAMETER\n");
> +        return STATUS_INVALID_PARAMETER;
> +    }
>
>
> These are all very useless TRACES, except for possibly the returned
> handle value.

Well, the idea is to TRACE() something for all possible return  
values. Michael Karcher, Rob Shearman and me obviously consider them  
as useful:

<http://thread.gmane.org/gmane.comp.emulators.wine.patches/54527/>

> As a side note of something I just noticed, the check for NULL attr  
> will never be true because we'll crash in the TRACE when we  
> dereference attr.

In case of (attr == NULL), same as (!attr), the code right to the ||  
shouldn't be reached, so no dereferencing should take place, then.  
TRACE()/printf() is capable of handling 0/NULL/nil values as well.

BTW., the TRACE() in the code you cited doesn't dereference anything  
and for the other parts of the patch, dereferencing only takes place  
where the current code dereferences anyways.


MarKus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/







More information about the wine-devel mailing list