Re: odbccp32: Implement SQLGetPrivateProfileString (try 5)
16 Jun
2015
16 Jun
'15
4:22 a.m.
+ 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.
3832
Age (days ago)
3832
Last active (days ago)
0 comments
1 participants
participants (1)
-
Nikolay Sivov