[setupapi] fix return values and GUID string in SetupDiOpenClassRegKeyExW

Joris Huizer jorishuizer at planet.nl
Mon Jul 3 03:34:14 CDT 2006


Damjan Jovanovic wrote:
> +    guidStringWithBraces[0] = (WCHAR) '{';
> +    CopyMemory(&guidStringWithBraces[1], lpGuidString,
> +        (MAX_GUID_STRING_LEN - 3)*sizeof(WCHAR));
> +    guidStringWithBraces[MAX_GUID_STRING_LEN - 2] = (WCHAR) '}';
> +    guidStringWithBraces[MAX_GUID_STRING_LEN - 1] = 0;
> +    RpcStringFreeW(&lpGuidString);

Just wondering, shouldn't that be something like

     guidStringWithBraces[0] = (WCHAR) '{';
     CopyMemory(&guidStringWithBraces[1], lpGuidString,
         (MAX_GUID_STRING_LEN - 3)*sizeof(WCHAR));
     guidStringWithBraces[1 + strlenW(lpGuidString)] = (WCHAR) '}';
     guidStringWithBraces[2 + strlenW(lpGuidString)] = 0;
     RpcStringFreeW(&lpGuidString);

HTH,

Joris



More information about the wine-devel mailing list