[PATCH 2/5] mpr: Implement provider selection given remote name.
Nikolay Sivov
bunglehead at gmail.com
Tue Aug 2 07:22:18 CDT 2016
On 02.08.2016 15:17, Pierre Schweitzer wrote:
> Le 02/08/2016 à 14:13, Nikolay Sivov a écrit :
>> On 02.08.2016 14:31, Pierre Schweitzer wrote:
>>> + len = WideCharToMultiByte(CP_ACP, 0, provider->lpProvider, -1, NULL, 0, NULL, NULL);
>>> + provider_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
>>> + if (provider_name)
>>> + memcpy(provider_name, provider->lpProvider, len * sizeof(WCHAR));
>>> +
>>> + HeapFree(GetProcessHeap(), 0, provider);
>>> +
>>> + return provider_name;
>>
>> This is confusing. WNetGetResourceInformationW return W string, you
>> convert it to A, and use A length to allocate another W buffer? What's
>> going on?
>
> I'm just getting string length for a local recopy, as it is done in
> other places.
> Should I use something else? Like some strdupW if it exists?
If you already have W string, strlenW will give you length. What are the
other places where it's done like that?
More information about the wine-devel
mailing list