diff --git a/reactos/subsys/csrss/win32mu/Makefile b/reactos/subsys/csrss/win32mu/Makefile new file mode 100644 index 00000000000..d82212c4357 --- /dev/null +++ b/reactos/subsys/csrss/win32mu/Makefile @@ -0,0 +1,28 @@ +# $Id: $ + +PATH_TO_TOP = ../../.. + +TARGET_TYPE = dynlink + +TARGET_NAME = win32mu + +TARGET_BASE = 0x5ffb0000 + +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D__USE_W32API -D_DISABLE_TIDENTS -Wall -Werror -I../include + +TARGET_LFLAGS = -nostartfiles -nostdlib + +TARGET_SDKLIBS = ntdll.a kernel32.a user32.a gdi32.a + +TARGET_OBJECTS = dllmain.o init.o + +TARGET_ENTRY = _DllMain@12 + +DEP_OBJECTS = $(TARGET_OBJECTS) + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +include $(TOOLS_PATH)/depend.mk diff --git a/reactos/subsys/csrss/win32mu/dllmain.c b/reactos/subsys/csrss/win32mu/dllmain.c new file mode 100644 index 00000000000..6a458a16c5b --- /dev/null +++ b/reactos/subsys/csrss/win32mu/dllmain.c @@ -0,0 +1,37 @@ +/* $Id: $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: subsys/csrss/win32csr/dllmain.c + * PURPOSE: Initialization + */ + +/* INCLUDES ******************************************************************/ + +#include +#include "csrplugin.h" + +#define NDEBUG +#include + + +/* GLOBALS *******************************************************************/ + +HINSTANCE DllHandle = (HINSTANCE) 0; + +/* FUNCTIONS *****************************************************************/ + +BOOL STDCALL +DllMain(HANDLE hDll, + DWORD dwReason, + LPVOID lpReserved) +{ + if (DLL_PROCESS_ATTACH == dwReason) + { + DllHandle = hDll; + } + + return TRUE; +} + +/* EOF */ diff --git a/reactos/subsys/csrss/win32mu/init.c b/reactos/subsys/csrss/win32mu/init.c new file mode 100644 index 00000000000..3c94fafd38c --- /dev/null +++ b/reactos/subsys/csrss/win32mu/init.c @@ -0,0 +1,85 @@ +/* $Id: $ + * + * WIN32MU.DLL - init.c - Initialize the server DLL + * + * ReactOS Operating System + * + * -------------------------------------------------------------------- + * + * This software 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 software 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 software; see the file COPYING.LIB. If not, write + * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + * MA 02139, USA. + * + * -------------------------------------------------------------------- + */ +#define NTOS_MODE_USER +#include + +#define NDEBUG +#include + +#include "w32mu.h" + +static NTSTATUS STDCALL +W32muLoadRemoteTerminalProxy (VOID) +{ + SYSTEM_LOAD_AND_CALL_IMAGE ImageInfo; + NTSTATUS Status = STATUS_SUCCESS; + + DPRINT("W32MU: loading remote terminal device\n"); + + /* Load kernel mode module */ + RtlInitUnicodeString (& ImageInfo.ModuleName, + L"\\SystemRoot\\system32\\w32mut.sys"); + + Status = NtSetSystemInformation (SystemLoadAndCallImage, + & ImageInfo, + sizeof (SYSTEM_LOAD_AND_CALL_IMAGE)); + + DPRINT("W32MU: w32mut.sys loaded\n", Status); + if (!NT_SUCCESS(Status)) + { + DPRINT("W32MU: loading w32mut.sys failed (Status=0x%08lx)\n", Status); + return Status; + } + return Status; +} + +/* Public entry point for CSRSS.EXE to load us */ + +NTSTATUS STDCALL +ServerDllInitialization (int a0, int a1, int a2, int a3, int a4) +{ + NTSTATUS Status = STATUS_SUCCESS; + + /* TODO: + * 1) load a kernel mode module to make Kmode happy + * (it will provide keyoard, display and pointer + * devices for window stations not attached to + * the console); + */ + Status = W32muLoadRemoteTerminalProxy (); + /* + * 2) pick up from the registry the list of session + * access providers (SAP: Local, RFB, RDP, ICA, ...); + * 3) initialize each SAP; + * 4) on SAP events, provide: + * 4.1) create session (SESSION->new); + * 4.2) suspend session (SESSION->state_change); + * 4.3) destroy session (SESSION->delete). + */ + return Status; +} + +/* EOF */ diff --git a/reactos/subsys/csrss/win32mu/w32mu.h b/reactos/subsys/csrss/win32mu/w32mu.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/reactos/subsys/csrss/win32mu/win32mu.def b/reactos/subsys/csrss/win32mu/win32mu.def new file mode 100644 index 00000000000..1aeb14568bd --- /dev/null +++ b/reactos/subsys/csrss/win32mu/win32mu.def @@ -0,0 +1,4 @@ +; $Id: $ +LIBRARY win32mu.dll +EXPORTS +ServerDllInitialization@20 diff --git a/reactos/subsys/csrss/win32mu/win32mu.rc b/reactos/subsys/csrss/win32mu/win32mu.rc new file mode 100644 index 00000000000..fb01196b497 --- /dev/null +++ b/reactos/subsys/csrss/win32mu/win32mu.rc @@ -0,0 +1,5 @@ +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS/Win32 Multiuser Server\0" +#define REACTOS_STR_INTERNAL_NAME "win32mu\0" +#define REACTOS_STR_ORIGINAL_FILENAME "win32mu.dll\0" +#include