1

私のコードは次のようなものです:

#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;
}

config.ini のコンテキストは次のとおりです。

[361]
Dll=daemon.dll

しかし、GetPrivateProfileString が呼び出されたとき、szValue のコンテキストは空です! そして、ページヒープを無効にすると、szValue のコンテキストは "daemon.dll" になります。また、フラグ (完全なトレース) を使用してページヒープを有効にすると、szVaule のコンテキストは "daemon.dll" になります。

API GetPrivateProfileString のバグはありますか?

4

0 に答える 0