Commit e404d7fe authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

kernel32: Set COMPUTERNAME environment variable.

parent 5e13e7f8
...@@ -512,13 +512,20 @@ static void set_additional_environment(void) ...@@ -512,13 +512,20 @@ static void set_additional_environment(void)
'P','r','o','f','i','l','e','L','i','s','t',0}; 'P','r','o','f','i','l','e','L','i','s','t',0};
static const WCHAR profiles_valueW[] = {'P','r','o','f','i','l','e','s','D','i','r','e','c','t','o','r','y',0}; static const WCHAR profiles_valueW[] = {'P','r','o','f','i','l','e','s','D','i','r','e','c','t','o','r','y',0};
static const WCHAR all_users_valueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}; static const WCHAR all_users_valueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'};
static const WCHAR computernameW[] = {'C','O','M','P','U','T','E','R','N','A','M','E',0};
static const WCHAR allusersW[] = {'A','L','L','U','S','E','R','S','P','R','O','F','I','L','E',0}; static const WCHAR allusersW[] = {'A','L','L','U','S','E','R','S','P','R','O','F','I','L','E',0};
OBJECT_ATTRIBUTES attr; OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW; UNICODE_STRING nameW;
WCHAR *profile_dir = NULL, *all_users_dir = NULL; WCHAR *profile_dir = NULL, *all_users_dir = NULL;
WCHAR buf[MAX_COMPUTERNAME_LENGTH];
HANDLE hkey; HANDLE hkey;
DWORD len; DWORD len;
/* ComputerName */
len = sizeof(buf) / sizeof(WCHAR);
if (GetComputerNameW( buf, &len ))
SetEnvironmentVariableW( computernameW, buf );
/* set the ALLUSERSPROFILE variables */ /* set the ALLUSERSPROFILE variables */
attr.Length = sizeof(attr); attr.Length = sizeof(attr);
......
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