Resend pdh[3:3]: remove unnecessary test done inPdhLookupPerfNameByIndexW

Dmitry Timoshkov dmitry at
Thu Feb 14 05:32:26 CST 2008

"Jeff Latimer" <lats at> wrote:

> 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.

Hans means something like the following done in PdhOpenQueryA:

WCHAR *sourceW = NULL;
if (source && !(sourceW = pdh_strdup_aw( source ))) return PDH_MEMORY_ALLOCATION_FAILURE;

and that's certainly not a large amount of code. Actually all pdh_strdup_aw
callers already check for a possible NULL, but that may be sent as a separate
patch IMO.


More information about the wine-devel mailing list