On 07.07.2015 11:15, Alistair Leslie-Hughes wrote:
- retval = heap_alloc(cbRetBuffer*sizeof(WCHAR));
- ret = SQLGetPrivateProfileStringW(sect, entry, string, retval, cbRetBuffer, file);
cbRetBuffer is A-buffer length, you're still using it as W-buffer length.