[advapi32/service #2] Fix buffersize calculations for
GetServiceDisplayNameA
Paul Vriens
paul.vriens.wine at gmail.com
Thu Jul 26 08:51:09 CDT 2007
Paul Vriens wrote:
> Alexandre Julliard wrote:
>> Paul Vriens <paul.vriens.wine at gmail.com> writes:
>>
>>> So how do you suggest I'm going to fix this? Maybe we should call the
>>> W function as well as deal with the differences?
>>
>> If you want to replicate the exact behavior then yes you have to call
>> the W function. But returning the correct size is probably OK too, at
>> least until we find an app that depends on the broken Windows
>> behavior...
>>
> Hi again,
>
> What about the attached patch? This fixes all todo_wine's for
> GetDisplayName with respect to buffer sizes.
>
> Cheers,
>
> Paul.
>
>
>
I could of course leave the 'not-so-clean' way of setting the size out:
if (!lpDisplayName && lpcchBuffer && !ret && (GLE ==
ERROR_INSUFFICIENT_BUFFER))
{
/* Request for buffersize.
*
* Only set the size for ERROR_INSUFFICIENT_BUFFER
*/
size = sizeW * sizeof(WCHAR);
}
else if (lpDisplayName && lpcchBuffer && !ret)
{
/* Request for displayname.
*
* size has to be set if this fails
*/
size = sizeW * sizeof(WCHAR);
}
This will only mean we leave a few todo_wine's in that will be accompanied with
a comment.
Cheers,
Paul.
More information about the wine-devel
mailing list