kernel32: Set COMPUTERNAME environment variable.
This commit is contained in:
parent
5e13e7f809
commit
e404d7fea3
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue