user32: Resend Check for NULL pData in DdeClientTransAction expectingto be passed a handle

Jeff Latimer lats at
Sun Sep 7 07:26:44 CDT 2008

Dmitry Timoshkov wrote:
>> +    if (pData == NULL)
>> +    {
>> +        if (cbData == (DWORD)-1)
>> +            pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
>> +        else
>> +            pConv->instance->lastError = DMLERR_MEMORY_ERROR;
>> +        return NULL;
>> +    }
> Alexandre suggested to use the existing 'if (cbData == (DWORD)-1)' block,
> not introduce a new one.
True, though when looking how we handle invalid parameters in most other 
code, the check is upfront where possible and return is as quickly as 
possible.  In this case it looks a lot cleaner and more understandable 
to put in the extra block rather than to work it into the logic.  It 
looks like more elses and I would have to handle the  
WDML_AllocTransaction as it is not be needed if pData was NULL.  It 
seems to complicate the logic and I don't see the benefit.
> The formatting of the above block is strange. Set the tab size in your
> editor to 8 and you will see the mess.
True, I generally use 4 for the tabstop but I can fix that.


More information about the wine-devel mailing list