Multiuser Win32: empty server dll
authorEmanuele Aliberti <ea@iol.it>
Sat, 26 Feb 2005 15:17:54 +0000 (15:17 +0000)
committerEmanuele Aliberti <ea@iol.it>
Sat, 26 Feb 2005 15:17:54 +0000 (15:17 +0000)
svn path=/trunk/; revision=13751

reactos/subsys/csrss/win32mu/Makefile [new file with mode: 0644]
reactos/subsys/csrss/win32mu/dllmain.c [new file with mode: 0644]
reactos/subsys/csrss/win32mu/init.c [new file with mode: 0644]
reactos/subsys/csrss/win32mu/w32mu.h [new file with mode: 0644]
reactos/subsys/csrss/win32mu/win32mu.def [new file with mode: 0644]
reactos/subsys/csrss/win32mu/win32mu.rc [new file with mode: 0644]

diff --git a/reactos/subsys/csrss/win32mu/Makefile b/reactos/subsys/csrss/win32mu/Makefile
new file mode 100644 (file)
index 0000000..d82212c
--- /dev/null
@@ -0,0 +1,28 @@
+# $Id:  $\r
+\r
+PATH_TO_TOP = ../../..\r
+\r
+TARGET_TYPE = dynlink\r
+\r
+TARGET_NAME = win32mu\r
+\r
+TARGET_BASE = 0x5ffb0000\r
+\r
+# require os code to explicitly request A/W version of structs/functions\r
+TARGET_CFLAGS += -D__USE_W32API -D_DISABLE_TIDENTS -Wall -Werror -I../include\r
+\r
+TARGET_LFLAGS = -nostartfiles -nostdlib\r
+\r
+TARGET_SDKLIBS = ntdll.a kernel32.a user32.a gdi32.a\r
+\r
+TARGET_OBJECTS = dllmain.o init.o\r
+\r
+TARGET_ENTRY = _DllMain@12\r
+\r
+DEP_OBJECTS = $(TARGET_OBJECTS)\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+include $(TOOLS_PATH)/helper.mk\r
+\r
+include $(TOOLS_PATH)/depend.mk\r
diff --git a/reactos/subsys/csrss/win32mu/dllmain.c b/reactos/subsys/csrss/win32mu/dllmain.c
new file mode 100644 (file)
index 0000000..6a458a1
--- /dev/null
@@ -0,0 +1,37 @@
+/* $Id: $\r
+ *\r
+ * COPYRIGHT:       See COPYING in the top level directory\r
+ * PROJECT:         ReactOS system libraries\r
+ * FILE:            subsys/csrss/win32csr/dllmain.c\r
+ * PURPOSE:         Initialization \r
+ */\r
+\r
+/* INCLUDES ******************************************************************/\r
+\r
+#include <windows.h>\r
+#include "csrplugin.h"\r
+\r
+#define NDEBUG\r
+#include <debug.h>\r
+\r
+\r
+/* GLOBALS *******************************************************************/\r
+\r
+HINSTANCE DllHandle = (HINSTANCE) 0;\r
+\r
+/* FUNCTIONS *****************************************************************/\r
+\r
+BOOL STDCALL\r
+DllMain(HANDLE hDll,\r
+       DWORD dwReason,\r
+       LPVOID lpReserved)\r
+{\r
+  if (DLL_PROCESS_ATTACH == dwReason)\r
+    {\r
+      DllHandle = hDll;\r
+    }\r
+\r
+  return TRUE;\r
+}\r
+\r
+/* EOF */\r
diff --git a/reactos/subsys/csrss/win32mu/init.c b/reactos/subsys/csrss/win32mu/init.c
new file mode 100644 (file)
index 0000000..3c94faf
--- /dev/null
@@ -0,0 +1,85 @@
+/* $Id: $\r
+ *\r
+ * WIN32MU.DLL - init.c - Initialize the server DLL\r
+ * \r
+ * ReactOS Operating System\r
+ * \r
+ * --------------------------------------------------------------------\r
+ *\r
+ * This software is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License as\r
+ * published by the Free Software Foundation; either version 2 of the\r
+ * License, or (at your option) any later version.\r
+ *\r
+ * This software is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+ * General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this software; see the file COPYING.LIB. If not, write\r
+ * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,\r
+ * MA 02139, USA.  \r
+ *\r
+ * --------------------------------------------------------------------\r
+ */\r
+#define NTOS_MODE_USER\r
+#include <ntos.h>\r
+\r
+#define NDEBUG\r
+#include <debug.h>\r
+\r
+#include "w32mu.h"\r
+\r
+static NTSTATUS STDCALL\r
+W32muLoadRemoteTerminalProxy (VOID)\r
+{\r
+       SYSTEM_LOAD_AND_CALL_IMAGE ImageInfo;\r
+       NTSTATUS                   Status = STATUS_SUCCESS;\r
+\r
+       DPRINT("W32MU: loading remote terminal device\n");\r
\r
+       /* Load kernel mode module */\r
+       RtlInitUnicodeString (& ImageInfo.ModuleName,\r
+                             L"\\SystemRoot\\system32\\w32mut.sys");\r
+\r
+       Status = NtSetSystemInformation (SystemLoadAndCallImage,\r
+                                        & ImageInfo,\r
+                                        sizeof (SYSTEM_LOAD_AND_CALL_IMAGE));\r
+\r
+       DPRINT("W32MU: w32mut.sys loaded\n", Status);\r
+       if (!NT_SUCCESS(Status))\r
+       {\r
+               DPRINT("W32MU: loading w32mut.sys failed (Status=0x%08lx)\n", Status);\r
+               return Status;\r
+       }\r
+       return Status;\r
+}\r
+\r
+/* Public entry point for CSRSS.EXE to load us */\r
+\r
+NTSTATUS STDCALL\r
+ServerDllInitialization (int a0, int a1, int a2, int a3, int a4)\r
+{\r
+       NTSTATUS Status = STATUS_SUCCESS;\r
+       \r
+       /* TODO:\r
+        * 1) load a kernel mode module to make Kmode happy\r
+        *    (it will provide keyoard, display and pointer\r
+        *    devices for window stations not attached to \r
+        *    the console);\r
+        */\r
+       Status = W32muLoadRemoteTerminalProxy ();               \r
+       /*\r
+        * 2) pick up from the registry the list of session\r
+        *    access providers (SAP: Local, RFB, RDP, ICA, ...);\r
+        * 3) initialize each SAP;\r
+        * 4) on SAP events, provide:\r
+        *    4.1) create session (SESSION->new);\r
+        *    4.2) suspend session (SESSION->state_change);\r
+        *    4.3) destroy session (SESSION->delete).\r
+        */\r
+       return Status;\r
+}\r
+\r
+/* EOF */\r
diff --git a/reactos/subsys/csrss/win32mu/w32mu.h b/reactos/subsys/csrss/win32mu/w32mu.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/reactos/subsys/csrss/win32mu/win32mu.def b/reactos/subsys/csrss/win32mu/win32mu.def
new file mode 100644 (file)
index 0000000..1aeb145
--- /dev/null
@@ -0,0 +1,4 @@
+; $Id:  $\r
+LIBRARY win32mu.dll\r
+EXPORTS\r
+ServerDllInitialization@20\r
diff --git a/reactos/subsys/csrss/win32mu/win32mu.rc b/reactos/subsys/csrss/win32mu/win32mu.rc
new file mode 100644 (file)
index 0000000..fb01196
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL\r
+#define REACTOS_STR_FILE_DESCRIPTION   "ReactOS/Win32 Multiuser Server\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "win32mu\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "win32mu.dll\0"\r
+#include <reactos/version.rc>\r