wine-staging/patches/ml-patches/0022-kernel32-Set-environment-variable-PUBLIC-on-the-proc.patch
Alistair Leslie-Hughes 7da7ae71d2 Added ml-patches patchset
Patches directly from the mailing list with second sign-off if
supplied.
2018-08-03 10:39:36 +10:00

39 lines
1.6 KiB
Diff

From 6d9aadecbafcd048702db67dab8c42cf6141712a Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 31 Jul 2018 18:57:59 +0800
Subject: [PATCH 22/24] kernel32: Set environment variable %PUBLIC% on the
process start-up.
This patch fixes an installer that has "[%PUBLIC]\Documents" entry
for some of the targets being copied from a cabinet file. Under
Windows %PUBLIC% environment variable is set to C:\Users\Public.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
---
dlls/kernel32/process.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 5aa245c..65b3091 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -520,6 +520,7 @@ static void set_additional_environment(void)
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 programdataW[] = {'P','r','o','g','r','a','m','D','a','t','a',0};
+ static const WCHAR publicW[] = {'P','U','B','L','I','C',0};
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
WCHAR *profile_dir = NULL, *all_users_dir = NULL, *program_data_dir = NULL;
@@ -560,6 +561,7 @@ static void set_additional_environment(void)
if (p > value && p[-1] != '\\') *p++ = '\\';
strcpyW( p, all_users_dir );
SetEnvironmentVariableW( allusersW, value );
+ SetEnvironmentVariableW( publicW, value );
HeapFree( GetProcessHeap(), 0, value );
}
--
1.9.1