GetEnvironmentVariable is the one - tested by commenting. The setup functions that import it from the system DLL work fine without crashing the game, although whether they successfully import it remains to be seen.

Edit: You would think from the programming forums I've visited in the past that I'd have learned to post full working examples. Here is a short program to demonstrate the problem - assuming my computer isn't just borked, this example will produce the error "Empty function called" instead of properly creating the Test Game folder under ProgramData.

Code:
#include <acknex.h>
#include <windows.h>
DWORD WINAPI GetEnvironmentVariable(char* lpName, char* lpBuffer, DWORD nSize);

STRING* profileTempStr = "#128";
int main()
{
	GetEnvironmentVariable = GetProcAddress(GetModuleHandle("kernel32.dll"), "GetEnvironmentVariableA");
	str_cpy(profileTempStr, "");
	GetEnvironmentVariable("AllUsersProfile", _chr(profileTempStr), 128);
	str_cat(profileTempStr, "\\Test Game");
	CreateDirectory(_chr(profileTempStr), 0);
}


Last edited by MatAllum; 07/08/16 01:58. Reason: Added example