3 * Copyright (C) 2001, 2002 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: userinit.c,v 1.1 2003/12/07 01:12:58 weiden Exp $
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS Userinit Logon Application
23 * FILE: subsys/system/userinit/userinit.c
24 * PROGRAMMERS: Thomas Weidenmueller (w3seek@users.sourceforge.net)
29 /* GLOBALS ******************************************************************/
31 /* FUNCTIONS ****************************************************************/
34 BOOL
GetShell(WCHAR
*CommandLine
)
38 WCHAR Shell
[MAX_PATH
];
41 if(RegOpenKeyEx(HKEY_LOCAL_MACHINE
,
42 L
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
43 0, KEY_QUERY_VALUE
, &hKey
) == ERROR_SUCCESS
)
45 Size
= MAX_PATH
* sizeof(WCHAR
);
46 if(RegQueryValueEx(hKey
,
51 &Size
) == ERROR_SUCCESS
)
55 wcscpy(CommandLine
, Shell
);
64 if(GetWindowsDirectory(CommandLine
, MAX_PATH
- 13))
65 wcscat(CommandLine
, L
"\\explorer.exe");
67 wcscpy(CommandLine
, L
"explorer.exe");
74 WinMain(HINSTANCE hInst
,
75 HINSTANCE hPrevInstance
,
80 PROCESS_INFORMATION pi
;
81 WCHAR Shell
[MAX_PATH
];
85 ZeroMemory(&si
, sizeof(STARTUPINFO
));
86 si
.cb
= sizeof(STARTUPINFO
);
88 if(CreateProcess(NULL
,
93 NORMAL_PRIORITY_CLASS
,
99 CloseHandle(pi
.hProcess
);
100 CloseHandle(pi
.hThread
);