From da2959cd0ee9aa3ea0ac185ca613a926417f5db9 Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Fri, 18 Apr 2008 10:57:12 +0000 Subject: [PATCH] - the shell should load from 'Windows NT' key, not 'Windows' - this should fix loading cmd instead of explorer from the key. svn path=/trunk/; revision=33020 --- reactos/base/system/userinit/userinit.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/reactos/base/system/userinit/userinit.c b/reactos/base/system/userinit/userinit.c index 27b9c13edd2..d339ee3cbde 100644 --- a/reactos/base/system/userinit/userinit.c +++ b/reactos/base/system/userinit/userinit.c @@ -133,6 +133,7 @@ cleanup: if (ControlKey != NULL) RegCloseKey(ControlKey); HeapFree(GetProcessHeap(), 0, SystemStartOptions); + TRACE("IsConsoleShell() returning %d\n", ret); return ret; } @@ -150,17 +151,17 @@ BOOL GetShell( TRACE("(%p, %p)\n", CommandLine, hRootKey); - rc = RegOpenKeyEx(hRootKey, REGSTR_PATH_WINLOGON, - 0, KEY_QUERY_VALUE, &hKey); + rc = RegOpenKeyExW(hRootKey, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", + 0, KEY_QUERY_VALUE, &hKey); if (rc == ERROR_SUCCESS) { Size = MAX_PATH * sizeof(WCHAR); - rc = RegQueryValueEx(hKey, - ConsoleShell ? L"ConsoleShell" : L"Shell", - NULL, - &Type, - (LPBYTE)Shell, - &Size); + rc = RegQueryValueExW(hKey, + ConsoleShell ? L"ConsoleShell" : L"Shell", + NULL, + &Type, + (LPBYTE)Shell, + &Size); if (rc == ERROR_SUCCESS) { if ((Type == REG_SZ) || (Type == REG_EXPAND_SZ)) @@ -279,14 +280,14 @@ VOID StartShell(VOID) /* Try to run shell in user key */ if (GetShell(Shell, HKEY_CURRENT_USER) && TryToStartShell(Shell)) { - TRACE("Failed to start a shell from HKEY_CURRENT_USER\n"); + TRACE("Started shell from HKEY_CURRENT_USER\n"); return; } /* Try to run shell in local machine key */ if (GetShell(Shell, HKEY_LOCAL_MACHINE) && TryToStartShell(Shell)) { - TRACE("Failed to start a shell from HKEY_LOCAL_MACHINE\n"); + TRACE("Started shell from HKEY_LOCAL_MACHINE\n"); return; }