diff --git a/reactos/bootdata/hivesft.inf b/reactos/bootdata/hivesft.inf index 13a119fc139..91f791c1b6a 100644 --- a/reactos/bootdata/hivesft.inf +++ b/reactos/bootdata/hivesft.inf @@ -3,11 +3,11 @@ Signature="$ReactOS$ [AddReg] -HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","Shell",0x00020000,"%SystemRoot%\System32\cmd.exe" -;HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","Shell",0x00020000,"%SystemRoot%\bin\explorer.exe" -HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","StartServices",0x00010001,0x00000001 -HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","StartGUI",0x00010001,0x00000000 -HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe," +HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\system32\cmd.exe" +;HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe" +HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartServices",0x00010001,0x00000001 +HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartGUI",0x00010001,0x00000000 +HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe" HKCU, "Control Panel\Desktop", "CursorBlinkRate",0x00000000,"530" diff --git a/reactos/lib/msgina/msgina.c b/reactos/lib/msgina/msgina.c index 472cab4b095..ca32556981c 100644 --- a/reactos/lib/msgina/msgina.c +++ b/reactos/lib/msgina/msgina.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: msgina.c,v 1.6 2003/12/07 00:04:20 weiden Exp $ +/* $Id: msgina.c,v 1.7 2003/12/27 11:09:58 weiden Exp $ * * PROJECT: ReactOS msgina.dll * FILE: lib/msgina/msgina.c @@ -195,21 +195,22 @@ WlxActivateUserShell( PROCESS_INFORMATION pi; HKEY hKey; DWORD BufSize, ValueType; - WCHAR pszUserInitApp[MAX_PATH + 1]; + WCHAR pszUserInitApp[MAX_PATH]; + WCHAR pszExpUserInitApp[MAX_PATH]; BOOL Ret; /* get the path of userinit */ if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", + L"SOFTWARE\\ReactOS\\Windows NT\\CurrentVersion\\Winlogon", 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS) { - /* FIXME - why does this always fail??? */ VirtualFree(pEnvironment, 0, MEM_RELEASE); return FALSE; } BufSize = MAX_PATH * sizeof(WCHAR); if((RegQueryValueEx(hKey, L"Userinit", NULL, &ValueType, (LPBYTE)pszUserInitApp, - &BufSize) != ERROR_SUCCESS) || (ValueType != REG_SZ)) + &BufSize) != ERROR_SUCCESS) || + !((ValueType == REG_SZ) || (ValueType == REG_EXPAND_SZ))) { RegCloseKey(hKey); VirtualFree(pEnvironment, 0, MEM_RELEASE); @@ -229,8 +230,10 @@ WlxActivateUserShell( si.cbReserved2 = 0; si.lpDesktop = pszDesktopName; + ExpandEnvironmentStrings(pszUserInitApp, pszExpUserInitApp, MAX_PATH); + Ret = CreateProcessAsUser(pgContext->UserToken, - pszUserInitApp, + pszExpUserInitApp, NULL, NULL, NULL, diff --git a/reactos/subsys/system/userinit/userinit.c b/reactos/subsys/system/userinit/userinit.c index a5d7c559fc0..5a39d9cca89 100644 --- a/reactos/subsys/system/userinit/userinit.c +++ b/reactos/subsys/system/userinit/userinit.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: userinit.c,v 1.2 2003/12/07 01:17:28 weiden Exp $ +/* $Id: userinit.c,v 1.3 2003/12/27 11:09:58 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Userinit Logon Application @@ -39,7 +39,7 @@ BOOL GetShell(WCHAR *CommandLine) BOOL Ret = FALSE; if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", + L"SOFTWARE\\ReactOS\\Windows NT\\CurrentVersion\\Winlogon", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { Size = MAX_PATH * sizeof(WCHAR); @@ -50,7 +50,7 @@ BOOL GetShell(WCHAR *CommandLine) (LPBYTE)Shell, &Size) == ERROR_SUCCESS) { - if(Type == REG_SZ) + if((Type == REG_SZ) || (Type == REG_EXPAND_SZ)) { wcscpy(CommandLine, Shell); Ret = TRUE; @@ -76,6 +76,7 @@ void StartShell(void) STARTUPINFO si; PROCESS_INFORMATION pi; WCHAR Shell[MAX_PATH]; + WCHAR ExpandedShell[MAX_PATH]; GetShell(Shell); @@ -83,8 +84,10 @@ void StartShell(void) si.cb = sizeof(STARTUPINFO); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); + ExpandEnvironmentStrings(Shell, ExpandedShell, MAX_PATH); + if(CreateProcess(NULL, - Shell, + ExpandedShell, NULL, NULL, FALSE, @@ -97,6 +100,8 @@ void StartShell(void) CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } + else + MessageBox(0, L"Userinit failed to start the shell!\n", NULL, 0); } int WINAPI