diff --git a/Makefile b/Makefile index 49531f3..1a3824d 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ else DBG_OPT := -Wl,-s endif -CFLAGS := -Wall $(DBG_OPT) -I./include/ +CFLAGS := -Wall -D_WIN32_WINNT=0x0500 $(DBG_OPT) -I./include/ CXXFLAGS := $(CFLAGS) VERSION := r$(shell svn info | grep Revision | sed -e 's/.*: //') diff --git a/src/ipxwrapper.c b/src/ipxwrapper.c index 8ec4ed1..b2f3123 100644 --- a/src/ipxwrapper.c +++ b/src/ipxwrapper.c @@ -80,6 +80,16 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) { log_printf(LOG_INFO, "IPXWrapper %s", version_string); log_printf(LOG_INFO, "Compiled at %s", compile_time); + if(!getenv("SystemRoot")) { + log_printf(LOG_WARNING, "SystemRoot is not set in the environment"); + + char env[268] = "SystemRoot="; + GetSystemWindowsDirectory(env+11, 256); + + log_printf(LOG_INFO, "Setting SystemRoot to '%s'", env+11); + _putenv(env); + } + if(!rclient_init(&g_rclient)) { return FALSE; }