small fixes

svn path=/trunk/; revision=7261
This commit is contained in:
Thomas Bluemel 2003-12-27 11:09:58 +00:00
parent 3d94ef5e21
commit b5391fbee5
3 changed files with 23 additions and 15 deletions

View file

@ -3,11 +3,11 @@ Signature="$ReactOS$
[AddReg] [AddReg]
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","Shell",0x00020000,"%SystemRoot%\System32\cmd.exe" 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","Shell",0x00020000,"%SystemRoot%\explorer.exe"
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","StartServices",0x00010001,0x00000001 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","StartGUI",0x00010001,0x00000000
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\WinLogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe," HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe"
HKCU, "Control Panel\Desktop", "CursorBlinkRate",0x00000000,"530" HKCU, "Control Panel\Desktop", "CursorBlinkRate",0x00000000,"530"

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * PROJECT: ReactOS msgina.dll
* FILE: lib/msgina/msgina.c * FILE: lib/msgina/msgina.c
@ -195,21 +195,22 @@ WlxActivateUserShell(
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
HKEY hKey; HKEY hKey;
DWORD BufSize, ValueType; DWORD BufSize, ValueType;
WCHAR pszUserInitApp[MAX_PATH + 1]; WCHAR pszUserInitApp[MAX_PATH];
WCHAR pszExpUserInitApp[MAX_PATH];
BOOL Ret; BOOL Ret;
/* get the path of userinit */ /* get the path of userinit */
if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, 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) 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
{ {
/* FIXME - why does this always fail??? */
VirtualFree(pEnvironment, 0, MEM_RELEASE); VirtualFree(pEnvironment, 0, MEM_RELEASE);
return FALSE; return FALSE;
} }
BufSize = MAX_PATH * sizeof(WCHAR); BufSize = MAX_PATH * sizeof(WCHAR);
if((RegQueryValueEx(hKey, L"Userinit", NULL, &ValueType, (LPBYTE)pszUserInitApp, 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); RegCloseKey(hKey);
VirtualFree(pEnvironment, 0, MEM_RELEASE); VirtualFree(pEnvironment, 0, MEM_RELEASE);
@ -229,8 +230,10 @@ WlxActivateUserShell(
si.cbReserved2 = 0; si.cbReserved2 = 0;
si.lpDesktop = pszDesktopName; si.lpDesktop = pszDesktopName;
ExpandEnvironmentStrings(pszUserInitApp, pszExpUserInitApp, MAX_PATH);
Ret = CreateProcessAsUser(pgContext->UserToken, Ret = CreateProcessAsUser(pgContext->UserToken,
pszUserInitApp, pszExpUserInitApp,
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Userinit Logon Application * PROJECT: ReactOS Userinit Logon Application
@ -39,7 +39,7 @@ BOOL GetShell(WCHAR *CommandLine)
BOOL Ret = FALSE; BOOL Ret = FALSE;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, 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) 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
{ {
Size = MAX_PATH * sizeof(WCHAR); Size = MAX_PATH * sizeof(WCHAR);
@ -50,7 +50,7 @@ BOOL GetShell(WCHAR *CommandLine)
(LPBYTE)Shell, (LPBYTE)Shell,
&Size) == ERROR_SUCCESS) &Size) == ERROR_SUCCESS)
{ {
if(Type == REG_SZ) if((Type == REG_SZ) || (Type == REG_EXPAND_SZ))
{ {
wcscpy(CommandLine, Shell); wcscpy(CommandLine, Shell);
Ret = TRUE; Ret = TRUE;
@ -76,6 +76,7 @@ void StartShell(void)
STARTUPINFO si; STARTUPINFO si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
WCHAR Shell[MAX_PATH]; WCHAR Shell[MAX_PATH];
WCHAR ExpandedShell[MAX_PATH];
GetShell(Shell); GetShell(Shell);
@ -83,8 +84,10 @@ void StartShell(void)
si.cb = sizeof(STARTUPINFO); si.cb = sizeof(STARTUPINFO);
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
ExpandEnvironmentStrings(Shell, ExpandedShell, MAX_PATH);
if(CreateProcess(NULL, if(CreateProcess(NULL,
Shell, ExpandedShell,
NULL, NULL,
NULL, NULL,
FALSE, FALSE,
@ -97,6 +100,8 @@ void StartShell(void)
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
} }
else
MessageBox(0, L"Userinit failed to start the shell!\n", NULL, 0);
} }
int WINAPI int WINAPI