Resend pdh[3:3]: remove unnecessary test done in PdhLookupPerfNameByIndexW

Jeff Latimer lats at yless4u.com.au
Thu Feb 14 04:29:47 CST 2008


Hans Leidekker wrote:
> On Thursday 14 February 2008 09:57:32 am Jeff Latimer wrote:
>
>   
>> +    machineW = pdh_strdup_aw( machine );
>> +
>> +    if (!(ret = PdhLookupPerfNameByIndexW( machineW, index, bufferW, &sizeW )))
>>     
>
> In the unlikely event that pdh_strdup_aw fails the query will be run on
> the local machine instead of the remote machine. Please check for allocation
> failures like most other functions in there do.
>
>  -Hans
>   
I looked at that and it required another test.  When I discussed this 
last with Dmitry, I said it would be best to pass machine and he agreed 
that this would be best.  The checking for alloc failures will generate 
similar amounts of code to what I am removing.  I am happy to do it but 
have a concern that the code will look to be inefficient and not 
accepted.  Logically, the patch is the correct way to proceed as machine 
should be passed even if not implemented yet.  That said, if the patch 
is acceptable, there is another case that will need to be brought into line.

Jeff



More information about the wine-devel mailing list