From
MSDN:
lpszReturnBuffer [out]
A pointer to a buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character.
So, if your INI file is:
[Hello]
a=1
b=2
[World]
c=3
d=4
pSecNames will be "Hello\0World\0\0", and retVal will be 13.
You'll need some kind of loop to read them all:
std::list<std::wstring> l;
for (wchar_t * p = pSecNames; *p; ++p)
{
std::wstring ws(p);
l.push_back(ws);
p += ws.size();
ASSERT(0 == *p);
}
Hope this helps,
Pablo.