If you can use third party library try using Nini. I use it and is very easy to create/manage complex INI files and is opensource.
GetPrivateProfileString
Signature is
DWORD WINAPI GetPrivateProfileString(
_In_ LPCTSTR lpAppName,
_In_ LPCTSTR lpKeyName,
_In_ LPCTSTR lpDefault,
_Out_ LPTSTR lpReturnedString,
_In_ DWORD nSize,
_In_ LPCTSTR lpFileName
);
So out is not StringBuilder
use String