2 Aug
2016
2 Aug
'16
12:13 p.m.
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?