=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: kernel32: Set COMPUTERNAME environment variable.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 28 02:24:35 CDT 2014


Module: wine
Branch: master
Commit: e404d7fea3f889ce273d74e5ec274efe8a45296c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e404d7fea3f889ce273d74e5ec274efe8a45296c

Author: André Hentschel <nerv at dawncrow.de>
Date:   Mon Oct 27 23:50:34 2014 +0100

kernel32: Set COMPUTERNAME environment variable.

---

 dlls/kernel32/process.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 138273b..0a087ab 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -512,13 +512,20 @@ static void set_additional_environment(void)
                                          '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 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};
     OBJECT_ATTRIBUTES attr;
     UNICODE_STRING nameW;
     WCHAR *profile_dir = NULL, *all_users_dir = NULL;
+    WCHAR buf[MAX_COMPUTERNAME_LENGTH];
     HANDLE hkey;
     DWORD len;
 
+    /* ComputerName */
+    len = sizeof(buf) / sizeof(WCHAR);
+    if (GetComputerNameW( buf, &len ))
+        SetEnvironmentVariableW( computernameW, buf );
+
     /* set the ALLUSERSPROFILE variables */
 
     attr.Length = sizeof(attr);




More information about the wine-cvs mailing list