Commit 52bf0fbd authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Export Unix user name in WINEUSERNAME variable.

parent 081c8e1c
......@@ -377,15 +377,16 @@ static void set_wow64_environment( WCHAR **env )
static const WCHAR winehomedirW[] = {'W','I','N','E','H','O','M','E','D','I','R',0};
static const WCHAR winedatadirW[] = {'W','I','N','E','D','A','T','A','D','I','R',0};
static const WCHAR winebuilddirW[] = {'W','I','N','E','B','U','I','L','D','D','I','R',0};
static const WCHAR wineusernameW[] = {'W','I','N','E','U','S','E','R','N','A','M','E',0};
static const WCHAR wineconfigdirW[] = {'W','I','N','E','C','O','N','F','I','G','D','I','R',0};
WCHAR buf[64];
WCHAR buf[256];
UNICODE_STRING arch_strW = { sizeof(archW) - sizeof(WCHAR), sizeof(archW), archW };
UNICODE_STRING arch6432_strW = { sizeof(arch6432W) - sizeof(WCHAR), sizeof(arch6432W), arch6432W };
UNICODE_STRING valW = { 0, sizeof(buf), buf };
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
const char *path;
const char *p, *name;
WCHAR *val;
HANDLE hkey;
DWORD i;
......@@ -396,14 +397,22 @@ static void set_wow64_environment( WCHAR **env )
set_wine_path_variable( env, winehomedirW, getenv("HOME") );
set_wine_path_variable( env, winebuilddirW, wine_get_build_dir() );
set_wine_path_variable( env, wineconfigdirW, wine_get_config_dir() );
for (i = 0; (path = wine_dll_enum_load_path( i )); i++)
for (i = 0; (p = wine_dll_enum_load_path( i )); i++)
{
NTDLL_swprintf( buf, winedlldirW, i );
set_wine_path_variable( env, buf, path );
set_wine_path_variable( env, buf, p );
}
NTDLL_swprintf( buf, winedlldirW, i );
set_wine_path_variable( env, buf, NULL );
/* set user name */
name = wine_get_user_name();
if ((p = strrchr( name, '/' ))) name = p + 1;
if ((p = strrchr( name, '\\' ))) name = p + 1;
ntdll_umbstowcs( name, strlen(name) + 1, buf, ARRAY_SIZE(buf) );
set_env_var( env, wineusernameW, buf );
/* set the PROCESSOR_ARCHITECTURE variable */
if (!RtlQueryEnvironmentVariable_U( *env, &arch6432_strW, &valW ))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment