Alternative ways to get (TEMP path) / (Environment Variable) in windows
1- GetTempPathW Api/GetTempPathA in kernel32.dll
wchar_t tmpPath[MAX_PATH];
GetTempPathW(MAX_PATH, tmpPath);
2- GetEnvironmentVariableW/GetEnvironmentVariableA in kernel32.dll
wchar_t buf[MAX_PATH];
GetEnvironmentVariableW(L"TEMP",buf, MAX_PATH);
3- _wdupenv_s/_dupenv_s
wchar_t *buf;
size_t bufLen;
errno_t tt= _wdupenv_s(&buf, &bufLen, L"TEMP");
4- RtlQueryEnvironmentVariable in ntdll
wchar_t buf[260];
size_t retLen;
RtlQueryEnvironmentVariable(NULL, L"TEMP", 4, buf, 260, &retLen);
Please Vote this post if you like it.
Please Follow me if you like my posts.
If you have any questions about this post, ask in comments.
Follow me on :
DTube
Hive