odbccp32: Implement SQLGetPrivateProfileString (try 5)
Nikolay Sivov
bunglehead at gmail.com
Tue Jun 16 04:22:28 CDT 2015
> + sect = heap_strdupAtoW(lpszSection);
> + entry = heap_strdupAtoW(lpszEntry);
> + string = heap_strdupAtoW(lpszDefault);
> + file = heap_strdupAtoW(lpszFilename);
> + retval = heap_alloc(cbRetBuffer*sizeof(WCHAR));
> +
> + ret = SQLGetPrivateProfileStringW(sect, entry, string, retval, cbRetBuffer, file);
> + if(ret)
> + {
> + WideCharToMultiByte(CP_ACP, 0, retval, -1, RetBuffer, cbRetBuffer, NULL, NULL);
> + RetBuffer[ret] = 0;
> + }
> +
> + heap_free(sect);
> + heap_free(entry);
> + heap_free(string);
> + heap_free(file);
> +
> + heap_free(retval);
Structurally it's fine, but you're using WCHAR count as CP_ACP char
count, and it's wrong assumption in general.
More information about the wine-devel
mailing list