[PATCH 2/2] wineboot: Set Flags and ProfileImagePath user profile values
Alex Henrie
alexhenrie24 at gmail.com
Sun Sep 23 15:24:38 CDT 2018
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38659
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
programs/wineboot/Makefile.in | 2 +-
programs/wineboot/wineboot.c | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in
index 2006067c4e..1069626b87 100644
--- a/programs/wineboot/Makefile.in
+++ b/programs/wineboot/Makefile.in
@@ -1,6 +1,6 @@
MODULE = wineboot.exe
APPMODE = -mconsole
-IMPORTS = uuid advapi32
+IMPORTS = uuid advapi32 userenv
DELAYIMPORTS = shell32 shlwapi version user32
C_SRCS = \
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 043cc64ab6..cf9c04b6c2 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -82,6 +82,7 @@
#include <shlwapi.h>
#include <shellapi.h>
#include <sddl.h>
+#include <userenv.h>
#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(wineboot);
@@ -426,6 +427,9 @@ static void create_volatile_environment_registry_key(void)
/* create a profile key for the current user */
static void create_user_profile_registry_key(void)
{
+ static const WCHAR FlagsW[] = {'F','l','a','g','s',0};
+ static const WCHAR ProfileImagePathW[] = {'P','r','o','f','i','l','e','I','m','a','g','e','P','a','t','h',0};
+ static const DWORD flags = 0;
WCHAR profile_key_path[512] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s',' ','N','T','\\',
@@ -435,6 +439,8 @@ static void create_user_profile_registry_key(void)
char buffer[512];
WCHAR *sid_str;
HKEY profile_key;
+ WCHAR profile_dir[MAX_PATH];
+ DWORD profile_dir_len = ARRAY_SIZE(profile_dir);
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
GetTokenInformation(token, TokenUser, buffer, sizeof(buffer), NULL);
@@ -444,6 +450,11 @@ static void create_user_profile_registry_key(void)
RegCreateKeyExW(HKEY_LOCAL_MACHINE, profile_key_path, 0, NULL, 0, KEY_WRITE, NULL, &profile_key, NULL);
+ RegSetValueExW(profile_key, FlagsW, 0, REG_DWORD, (BYTE *)&flags, sizeof(flags));
+
+ GetUserProfileDirectoryW(token, profile_dir, &profile_dir_len);
+ RegSetValueExW(profile_key, ProfileImagePathW, 0, REG_SZ, (BYTE *)profile_dir, (profile_dir_len + 1) * sizeof(WCHAR));
+
RegCloseKey(profile_key);
CloseHandle(token);
}
--
2.19.0
More information about the wine-devel
mailing list