Revision: 32775
http://xbmc.svn.sourceforge.net/xbmc/?rev=32775&view=rev
Author: wiso
Date: 2010-08-14 11:42:07 +0000 (Sat, 14 Aug 2010)
Log Message:
-----------
[WIN32] expand the dll_environ array and fill it with the current windows system env vars. removed the win32 special part in dll_getenv which isn't needed anymore + cosmetics.
Modified Paths:
--------------
trunk/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
Modified: trunk/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
===================================================================
--- trunk/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp 2010-08-14 11:36:47 UTC (rev 32774)
+++ trunk/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp 2010-08-14 11:42:07 UTC (rev 32775)
@@ -97,7 +97,7 @@
char* value;
};
-#define EMU_MAX_ENVIRONMENT_ITEMS 50
+#define EMU_MAX_ENVIRONMENT_ITEMS 100
static char *dll__environ_imp[EMU_MAX_ENVIRONMENT_ITEMS + 1];
extern "C" char **dll__environ;
char **dll__environ = dll__environ_imp;
@@ -111,30 +111,25 @@
InitializeCriticalSection(&dll_cs_environ);
memset(dll__environ, 0, EMU_MAX_ENVIRONMENT_ITEMS + 1);
- // libdvdnav
- dll_putenv("DVDREAD_NOKEYS=1");
- //dll_putenv("DVDREAD_VERBOSE=1");
- //dll_putenv("DVDREAD_USE_DIRECT=1");
-
- // libdvdcss
- dll_putenv("DVDCSS_METHOD=key");
- dll_putenv("DVDCSS_VERBOSE=3");
- dll_putenv("DVDCSS_CACHE=special://masterprofile/cache");
-
// python
#ifdef _XBOX
dll_putenv("OS=xbox");
#elif defined(_WIN32)
+ // fill our array with the windows system vars
+ LPTSTR lpszVariable;
+ LPTCH lpvEnv;
+ lpvEnv = GetEnvironmentStrings();
+ if (lpvEnv != NULL)
+ {
+ lpszVariable = (LPTSTR) lpvEnv;
+ while (*lpszVariable)
+ {
+ dll_putenv(lpszVariable);
+ lpszVariable += lstrlen(lpszVariable) + 1;
+ }
+ FreeEnvironmentStrings(lpvEnv);
+ }
dll_putenv("OS=win32");
- // preliminary change to get HOME* vars in Win7 x64
- // todo: dll__environ should return all system vars
- CStdString strtmp;
- CStdStringW strwtmp = _wgetenv(L"HOMEDRIVE");
- g_charsetConverter.wToUTF8(strwtmp, strtmp);
- dll_putenv(CStdString("HOMEDRIVE="+strtmp).c_str());
- strwtmp = _wgetenv(L"HOMEPATH");
- g_charsetConverter.wToUTF8(strwtmp, strtmp);
- dll_putenv(CStdString("HOMEPATH="+strtmp).c_str());
#elif defined(__APPLE__)
dll_putenv("OS=darwin");
#elif defined(_LINUX)
@@ -154,6 +149,16 @@
//dll_putenv("PYTHONMALLOCSTATS=1");
//dll_putenv("PYTHONY2K=1");
dll_putenv("TEMP=special://temp/temp"); // for python tempdir
+
+ // libdvdnav
+ dll_putenv("DVDREAD_NOKEYS=1");
+ //dll_putenv("DVDREAD_VERBOSE=1");
+ //dll_putenv("DVDREAD_USE_DIRECT=1");
+
+ // libdvdcss
+ dll_putenv("DVDCSS_METHOD=key");
+ dll_putenv("DVDCSS_VERBOSE=3");
+ dll_putenv("DVDCSS_CACHE=special://masterprofile/cache");
}
extern "C" void __stdcall update_emu_environ()
@@ -2012,15 +2017,6 @@
}
}
}
-#ifdef _WIN32
- // if value not found try the windows system env
- if(value == NULL)
- {
- char ctemp[32768];
- if(GetEnvironmentVariable(szKey,ctemp,32767) != 0)
- value = ctemp;
- }
-#endif
LeaveCriticalSection(&dll_cs_environ);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|