mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
added userinit application
svn path=/trunk/; revision=6877
This commit is contained in:
parent
157d55a8aa
commit
2be74a0eb2
6 changed files with 176 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.187 2003/12/06 23:22:30 mf Exp $
|
# $Id: Makefile,v 1.188 2003/12/07 01:12:58 weiden Exp $
|
||||||
#
|
#
|
||||||
# Global makefile
|
# Global makefile
|
||||||
#
|
#
|
||||||
|
@ -88,7 +88,7 @@ STORAGE_DRIVERS = atapi cdrom class2 disk scsiport diskdump
|
||||||
|
|
||||||
# System applications
|
# System applications
|
||||||
# autochk cmd format services setup usetup welcome winlogon
|
# autochk cmd format services setup usetup welcome winlogon
|
||||||
SYS_APPS = autochk cmd format services setup usetup welcome winlogon
|
SYS_APPS = autochk cmd format services setup usetup welcome winlogon userinit
|
||||||
|
|
||||||
# System services
|
# System services
|
||||||
# rpcss eventlog
|
# rpcss eventlog
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.5 2003/12/01 18:21:04 weiden Exp $
|
# $Id: Makefile,v 1.6 2003/12/07 01:12:58 weiden Exp $
|
||||||
|
|
||||||
PATH_TO_TOP = ../..
|
PATH_TO_TOP = ../..
|
||||||
|
|
||||||
|
@ -6,11 +6,14 @@ TARGET_TYPE = dynlink
|
||||||
|
|
||||||
TARGET_NAME = msgina
|
TARGET_NAME = msgina
|
||||||
|
|
||||||
|
TARGET_INSTALLDIR = system32
|
||||||
|
|
||||||
TARGET_BASE = 0x75970000
|
TARGET_BASE = 0x75970000
|
||||||
|
|
||||||
TARGET_CFLAGS = \
|
TARGET_CFLAGS = \
|
||||||
-I./include \
|
-I./include \
|
||||||
-DUNICODE \
|
-DUNICODE \
|
||||||
|
-D_UNICODE \
|
||||||
-D__REACTOS__ \
|
-D__REACTOS__ \
|
||||||
-Wall \
|
-Wall \
|
||||||
-Werror \
|
-Werror \
|
||||||
|
|
6
reactos/subsys/system/userinit/.cvsignore
Normal file
6
reactos/subsys/system/userinit/.cvsignore
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
*.o
|
||||||
|
*.d
|
||||||
|
*.exe
|
||||||
|
*.coff
|
||||||
|
*.sym
|
||||||
|
*.map
|
21
reactos/subsys/system/userinit/Makefile
Normal file
21
reactos/subsys/system/userinit/Makefile
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# $Id: Makefile,v 1.1 2003/12/07 01:12:58 weiden Exp $
|
||||||
|
|
||||||
|
PATH_TO_TOP = ../../..
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = windows
|
||||||
|
|
||||||
|
TARGET_NAME = userinit
|
||||||
|
|
||||||
|
TARGET_INSTALLDIR = system32
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -DUNICODE -D_UNICODE
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = kernel32.a gdi32.a user32.a advapi32.a ntdll.a
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
106
reactos/subsys/system/userinit/userinit.c
Normal file
106
reactos/subsys/system/userinit/userinit.c
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
/*
|
||||||
|
* ReactOS applications
|
||||||
|
* Copyright (C) 2001, 2002 ReactOS Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* 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.1 2003/12/07 01:12:58 weiden Exp $
|
||||||
|
*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS Userinit Logon Application
|
||||||
|
* FILE: subsys/system/userinit/userinit.c
|
||||||
|
* PROGRAMMERS: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
||||||
|
*/
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* GLOBALS ******************************************************************/
|
||||||
|
|
||||||
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
static
|
||||||
|
BOOL GetShell(WCHAR *CommandLine)
|
||||||
|
{
|
||||||
|
HKEY hKey;
|
||||||
|
DWORD Type, Size;
|
||||||
|
WCHAR Shell[MAX_PATH];
|
||||||
|
BOOL Ret = FALSE;
|
||||||
|
|
||||||
|
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
|
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
|
||||||
|
0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
Size = MAX_PATH * sizeof(WCHAR);
|
||||||
|
if(RegQueryValueEx(hKey,
|
||||||
|
L"Shell",
|
||||||
|
NULL,
|
||||||
|
&Type,
|
||||||
|
(LPBYTE)Shell,
|
||||||
|
&Size) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if(Type == REG_SZ)
|
||||||
|
{
|
||||||
|
wcscpy(CommandLine, Shell);
|
||||||
|
Ret = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Ret)
|
||||||
|
{
|
||||||
|
if(GetWindowsDirectory(CommandLine, MAX_PATH - 13))
|
||||||
|
wcscat(CommandLine, L"\\explorer.exe");
|
||||||
|
else
|
||||||
|
wcscpy(CommandLine, L"explorer.exe");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int WINAPI
|
||||||
|
WinMain(HINSTANCE hInst,
|
||||||
|
HINSTANCE hPrevInstance,
|
||||||
|
LPSTR lpszCmdLine,
|
||||||
|
int nCmdShow)
|
||||||
|
{
|
||||||
|
STARTUPINFO si;
|
||||||
|
PROCESS_INFORMATION pi;
|
||||||
|
WCHAR Shell[MAX_PATH];
|
||||||
|
|
||||||
|
GetShell(Shell);
|
||||||
|
|
||||||
|
ZeroMemory(&si, sizeof(STARTUPINFO));
|
||||||
|
si.cb = sizeof(STARTUPINFO);
|
||||||
|
|
||||||
|
if(CreateProcess(NULL,
|
||||||
|
Shell,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
FALSE,
|
||||||
|
NORMAL_PRIORITY_CLASS,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&si,
|
||||||
|
&pi))
|
||||||
|
{
|
||||||
|
CloseHandle(pi.hProcess);
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
37
reactos/subsys/system/userinit/userinit.rc
Normal file
37
reactos/subsys/system/userinit/userinit.rc
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#include <defines.h>
|
||||||
|
#include <reactos/resource.h>
|
||||||
|
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
|
||||||
|
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
|
||||||
|
FILEFLAGSMASK 0x3fL
|
||||||
|
#ifdef _DEBUG
|
||||||
|
FILEFLAGS 0x1L
|
||||||
|
#else
|
||||||
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
|
FILEOS 0x40004L
|
||||||
|
FILETYPE 0x2L
|
||||||
|
FILESUBTYPE 0x0L
|
||||||
|
BEGIN
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "040904b0"
|
||||||
|
BEGIN
|
||||||
|
VALUE "CompanyName", RES_STR_COMPANY_NAME
|
||||||
|
VALUE "FileDescription", "Userinit Logon Application\0"
|
||||||
|
VALUE "FileVersion", RES_STR_FILE_VERSION
|
||||||
|
VALUE "InternalName", "userinit\0"
|
||||||
|
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
|
||||||
|
VALUE "OriginalFilename", "userinit.exe\0"
|
||||||
|
VALUE "ProductName", RES_STR_PRODUCT_NAME
|
||||||
|
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x409, 1200
|
||||||
|
END
|
||||||
|
END
|
Loading…
Reference in a new issue