On 07/23/2010 08:57 AM, Vitaliy Margolen wrote:
On 07/21/2010 10:23 AM, Andrew Eikum wrote: Please more-less follow the format of the file and don't add yet one more.
- if(outLen == 0)
return 0;
Need space between "if" and "(".
- if(!buf){
Curly bracket goes on to separate line.
You're right I should've checked the entire file. Because Wine's formatting is so inconsistent already, I usually just bother to follow the immediate function's standards, which in this case, there was none.
- buf = HeapAlloc(GetProcessHeap(), 0, outLen * sizeof(WCHAR));
- ret = GetPrivateProfileStringW(appName, keyName, NULL, buf, outLen, filename);
strcpyW(out, buf);
- HeapFree(GetProcessHeap(), 0, buf);
Why do you need extra buffer here? Use passed buffer instead.
GetPrivateProfileString with NULL keyName fills the buffer with all of the available keys, separated by nuls. This shlwapi function only fills the buffer with the first available key, leaving the rest of the buffer unmodified. I had tests for this, but must've forgotten them when I rewrote the tests before submitting. Attached patch demonstrates.
Thanks for reviewing, Andrew