My code is like this:
#include <Windows.h>
#include <tchar.h>
int main () {
TCHAR conffigPath[MAX_PATH] = {0};
GetCurrentDirectory(MAX_PATH, conffigPath);
_tcscat_s(conffigPath, MAX_PATH, _T("\\config.ini"));
TCHAR szValue[MAX_PATH] = {0};
GetPrivateProfileString(_T("361"), _T("DLL"), NULL, szValue, MAX_PATH, conffigPath);
return 0;
}
The context of config.ini is following:
[361]
Dll=daemon.dll
But when GetPrivateProfileString was called, the context of szValue is empty! And when I disable the pageheap, the context of szValue is "daemon.dll". And when I enable pageheap with flags(full traces),the context of szVaule is "daemon.dll".
Is there a bug of the API GetPrivateProfileString?