Move VMS subtree in the proper place.
authorEmanuele Aliberti <ea@iol.it>
Mon, 2 May 2005 14:15:56 +0000 (14:15 +0000)
committerEmanuele Aliberti <ea@iol.it>
Mon, 2 May 2005 14:15:56 +0000 (14:15 +0000)
svn path=/trunk/; revision=14948

17 files changed:
vms/include/vms/lpcproto.h [new file with mode: 0644]
vms/lib/vmsdll/dllmain.c [new file with mode: 0644]
vms/lib/vmsdll/lib/stubs.c [new file with mode: 0644]
vms/lib/vmsdll/makefile [new file with mode: 0644]
vms/lib/vmsdll/readme.txt [new file with mode: 0644]
vms/lib/vmsdll/rms/stubs.c [new file with mode: 0644]
vms/lib/vmsdll/sys/stubs.c [new file with mode: 0644]
vms/lib/vmsdll/vmsdll.def [new file with mode: 0644]
vms/lib/vmsdll/vmsdll.rc [new file with mode: 0644]
vms/makefile [new file with mode: 0644]
vms/server/init.c [new file with mode: 0644]
vms/server/makefile [new file with mode: 0644]
vms/server/server.c [new file with mode: 0644]
vms/server/vmsss.c [new file with mode: 0644]
vms/server/vmsss.h [new file with mode: 0644]
vms/server/vmsss.rc [new file with mode: 0644]
vms/tools/mksystab/makefile [new file with mode: 0644]

diff --git a/vms/include/vms/lpcproto.h b/vms/include/vms/lpcproto.h
new file mode 100644 (file)
index 0000000..5b947cb
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __VMS_SYS_LPCPROTO_H\r
+#define __VMS_SYS_LPCPROTO_H\r
+\r
+#define VMS_LPCPROTO_VERSION 1\r
+\r
+#define VMS_OBNS_ROOT       L"\\VMS"\r
+#define VMS_API_PORT_NAME   L"\\VMS\\ApiPort"\r
+#define VMS_SBAPI_PORT_NAME L"\\VMS\\SbApiPort"\r
+\r
+#endif\r
diff --git a/vms/lib/vmsdll/dllmain.c b/vms/lib/vmsdll/dllmain.c
new file mode 100644 (file)
index 0000000..3321dec
--- /dev/null
@@ -0,0 +1,39 @@
+/* $Id: dllmain.c,v 1.5 2002/11/24 18:42:15 robd Exp $\r
+ *\r
+ * dllmain.c\r
+ *\r
+ * A stub DllMain function which will be called by DLLs which do not\r
+ * have a user supplied DllMain.\r
+ *\r
+ * Contributors:\r
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>\r
+ *\r
+ *  THIS SOFTWARE IS NOT COPYRIGHTED\r
+ *\r
+ *  This source code is offered for use in the public domain. You may\r
+ *  use, modify or distribute it freely.\r
+ *\r
+ *  This code is distributed in the hope that it will be useful but\r
+ *  WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY\r
+ *  DISCLAMED. This includes but is not limited to warrenties of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
+ *\r
+ * $Revision: 1.5 $\r
+ * $Author: robd $\r
+ * $Date: 2002/11/24 18:42:15 $\r
+ *\r
+ */\r
+\r
+#include <windows.h>\r
+\r
+\r
+/* LIBRARY ENTRY POINT ********************************************************/\r
+\r
+BOOL\r
+WINAPI\r
+DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)\r
+{\r
+       return TRUE;\r
+}\r
+\r
+/* EOF */\r
diff --git a/vms/lib/vmsdll/lib/stubs.c b/vms/lib/vmsdll/lib/stubs.c
new file mode 100644 (file)
index 0000000..4f94b88
--- /dev/null
@@ -0,0 +1 @@
+void lib$find_file () { }\r
diff --git a/vms/lib/vmsdll/makefile b/vms/lib/vmsdll/makefile
new file mode 100644 (file)
index 0000000..37ca5b6
--- /dev/null
@@ -0,0 +1,44 @@
+# $Id$\r
+# \r
+PATH_TO_TOP = ../../../reactos\r
+\r
+TARGET_TYPE = dynlink\r
+\r
+TARGET_NAME = vmsdll\r
+\r
+TARGET_CFLAGS = -Wall -Werror -fno-builtin \\r
+                -D__USE_W32API \\r
+                -D_WIN32_IE=0x0500 \\r
+                -D_WIN32_WINNT=0x501 \\r
+                -DWINVER=0x600 \\r
+\r
+TARGET_LFLAGS = -nostartfiles -nostdlib\r
+\r
+TARGET_SDKLIBS = ntdll.a\r
+\r
+LIB_OBJECTS = \\r
+       lib\stubs.o\r
+\r
+RMS_OBJECTS = \\r
+       rms\stubs.o\r
+\r
+MISC_OBJECTS = \\r
+       dllmain.o\r
+\r
+SYS_OBJECTS = \\r
+       sys\stubs.o\r
+\r
+TARGET_OBJECTS = \\r
+       $(LIB_OBJECTS) \\r
+       $(RMS_OBJECTS) \\r
+       $(SYS_OBJECTS) \\r
+       $(MISC_OBJECTS)\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
+\r
diff --git a/vms/lib/vmsdll/readme.txt b/vms/lib/vmsdll/readme.txt
new file mode 100644 (file)
index 0000000..eb2466f
--- /dev/null
@@ -0,0 +1,7 @@
+VMSDLL - ReactOS VMS+ Environment Subsystem\r
+\r
+lib = Library APIs\r
+\r
+rms = Record Management Services APIs\r
+\r
+sys = System APIs
\ No newline at end of file
diff --git a/vms/lib/vmsdll/rms/stubs.c b/vms/lib/vmsdll/rms/stubs.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/vms/lib/vmsdll/sys/stubs.c b/vms/lib/vmsdll/sys/stubs.c
new file mode 100644 (file)
index 0000000..70a5821
--- /dev/null
@@ -0,0 +1,30 @@
+/* $Id$ */\r
+void sys$ascefc (void) {}\r
+void sys$asctim (void) {}\r
+void sys$assign (void) {}\r
+void sys$bintim (void) {}\r
+void sys$clref (void) {}\r
+void sys$crelnm (void) {}\r
+void sys$crelnt (void) {}\r
+void sys$dclast (void) {}\r
+void sys$enq (void) {}\r
+void sys$forcex (void) {}\r
+void sys$gettim (void) {}\r
+void sys$hiber (void) {}\r
+void sys$numtim (void) {}\r
+void sys$qio (void) {}\r
+void sys$qiow (void) {}\r
+void sys$readef (void) {}\r
+void sys$schdwk (void) {}\r
+void sys$setef (void) {}\r
+void sys$setast (void) {}\r
+void sys$setime (void) {}\r
+void sys$setimr (void) {}\r
+void sys$setpri (void) {}\r
+void sys$setprn (void) {}\r
+void sys$synch (void) {}\r
+void sys$trnlnm (void) {}\r
+void sys$waitfr (void) {}\r
+void sys$wake (void) {}\r
+\r
+/* EOF */\r
diff --git a/vms/lib/vmsdll/vmsdll.def b/vms/lib/vmsdll/vmsdll.def
new file mode 100644 (file)
index 0000000..d585c68
--- /dev/null
@@ -0,0 +1,32 @@
+LIBRARY vmsdll.dll\r
+EXPORTS\r
+; LIB\r
+lib$find_file\r
+; SYS\r
+sys$ascefc \r
+sys$asctim \r
+sys$assign\r
+sys$bintim \r
+sys$clref \r
+sys$crelnm\r
+sys$crelnt \r
+sys$dclast \r
+sys$enq \r
+sys$forcex \r
+sys$gettim \r
+sys$hiber \r
+sys$numtim \r
+sys$qio \r
+sys$qiow\r
+sys$readef \r
+sys$schdwk \r
+sys$setef \r
+sys$setast\r
+sys$setime \r
+sys$setimr \r
+sys$setpri \r
+sys$setprn \r
+sys$synch \r
+sys$trnlnm \r
+sys$waitfr \r
+sys$wake \r
diff --git a/vms/lib/vmsdll/vmsdll.rc b/vms/lib/vmsdll/vmsdll.rc
new file mode 100644 (file)
index 0000000..9d21ec9
--- /dev/null
@@ -0,0 +1,4 @@
+#define REACTOS_STR_FILE_DESCRIPTION   "ReactOS/VMS API Client Library\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "vmsdll\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "vmdsll.dll\0"\r
+#include <reactos/version.rc>\r
diff --git a/vms/makefile b/vms/makefile
new file mode 100644 (file)
index 0000000..88c1f9c
--- /dev/null
@@ -0,0 +1,120 @@
+# $Id$\r
+#\r
+# ReactOS VMS Personality\r
+#\r
+\r
+PATH_TO_TOP = ../reactos\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+VMS_PATH = .\r
+\r
+VMS_OTHER = server\r
+\r
+VMS_TOOLS = mksystab\r
+\r
+VMS_LIBS = vmsdll\r
+\r
+VMS_APPS = # vmsw32\r
+\r
+VMS_MODULES = $(VMS_OTHER) $(VMS_TOOLS) $(VMS_LIBS) $(VMS_APPS)\r
+\r
+all:  implib $(VMS_MODULES)\r
+\r
+implib: $(VMS_MODULES:%=%_implib)\r
+\r
+clean: $(VMS_MODULES:%=%_clean)\r
+\r
+install: $(VMS_MODULES:%=%_install)\r
+\r
+.PHONY: all implib clean\r
+\r
+\r
+#\r
+# Other VMS+ Modules\r
+#\r
+$(VMS_OTHER): %:\r
+       make -f Makefile -C $(VMS_PATH)/$*\r
+\r
+$(VMS_OTHER:%=%_implib): %_implib:\r
+       make -f Makefile -C $(VMS_PATH)/$* implib\r
+\r
+$(VMS_OTHER:%=%_clean): %_clean:\r
+       make -f Makefile -C $(VMS_PATH)/$* clean\r
+\r
+$(VMS_OTHER:%=%_dist): %_dist:\r
+       make -f Makefile -C $(VMS_PATH)/$* dist\r
+\r
+$(VMS_OTHER:%=%_install): %_install:\r
+       make -f Makefile -C $(VMS_PATH)/$* install\r
+\r
+.PHONY: $(VMS_OTHER) $(VMS_OTHER:%=%_implib) $(VMS_OTHER:%=%_clean) $(VMS_OTHER:%=%_install) $(VMS_OTHER:%=%_dist)\r
+\r
+\r
+#\r
+# VMS+ Tools\r
+#\r
+$(VMS_TOOLS): %:\r
+       make -f Makefile -C $(VMS_PATH)/tools/$*\r
+\r
+$(VMS_TOOLS:%=%_implib): %_implib:\r
+       make -f Makefile -C $(VMS_PATH)/tools/$* implib\r
+\r
+$(VMS_TOOLS:%=%_clean): %_clean:\r
+       make -f Makefile -C $(VMS_PATH)/tools/$* clean\r
+\r
+$(VMS_TOOLS:%=%_dist): %_dist:\r
+       make -f Makefile -C $(VMS_PATH)/tools/$* dist\r
+\r
+$(VMS_TOOLS:%=%_install): %_install:\r
+       make -f Makefile -C $(VMS_PATH)/tools/$* install\r
+\r
+.PHONY: $(VMS_LIBS) $(VMS_LIBS:%=%_implib) $(VMS_LIBS:%=%_clean) $(VMS_LIBS:%=%_install) $(VMS_LIBS:%=%_dist)\r
+\r
+\r
+#\r
+# VMS+ DLLs\r
+#\r
+$(VMS_LIBS): %:\r
+       make -f Makefile -C $(VMS_PATH)/lib/$*\r
+\r
+$(VMS_LIBS:%=%_implib): %_implib:\r
+       make -f Makefile -C $(VMS_PATH)/lib/$* implib\r
+\r
+$(VMS_LIBS:%=%_clean): %_clean:\r
+       make -f Makefile -C $(VMS_PATH)/lib/$* clean\r
+\r
+$(VMS_LIBS:%=%_dist): %_dist:\r
+       make -f Makefile -C $(VMS_PATH)/lib/$* dist\r
+\r
+$(VMS_LIBS:%=%_install): %_install:\r
+       make -f Makefile -C $(VMS_PATH)/lib/$* install\r
+\r
+.PHONY: $(VMS_LIBS) $(VMS_LIBS:%=%_implib) $(VMS_LIBS:%=%_clean) $(VMS_LIBS:%=%_install) $(VMS_LIBS:%=%_dist)\r
+\r
+\r
+#\r
+# VMS+ Programs\r
+#\r
+$(VMS_APPS): %:\r
+       make -f Makefile -C $(VMS_PATH)/apps/$*\r
+\r
+$(VMS_APPS:%=%_implib): %_implib:\r
+       make -f Makefile -C $(VMS_PATH)/apps/$* implib\r
+\r
+$(VMS_APPS:%=%_clean): %_clean:\r
+       make -f Makefile -C $(VMS_PATH)/apps/$* clean\r
+\r
+$(VMS_APPS:%=%_dist): %_dist:\r
+       make -f Makefile -C $(VMS_PATH)/apps/$* dist\r
+\r
+$(VMS_APPS:%=%_install): %_install:\r
+       make -f Makefile -C $(VMS_PATH)/apps/$* install\r
+\r
+.PHONY: $(VMS_APPS) $(VMS_APPS:%=%_implib) $(VMS_APPS:%=%_clean) $(VMS_APPS:%=%_install) $(VMS_APPS:%=%_dist)\r
+\r
+\r
+etags:\r
+       find . -name "*.[ch]" -print | etags --language=c -\r
+\r
+# EOF\r
diff --git a/vms/server/init.c b/vms/server/init.c
new file mode 100644 (file)
index 0000000..fb712ee
--- /dev/null
@@ -0,0 +1,275 @@
+/* $Id: $\r
+ *\r
+ * init.c - VMS Enviroment Subsystem Server - Initialization\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
+#include "vmsss.h"\r
+\r
+//#define NDEBUG\r
+#include <debug.h>\r
+\r
+\r
+HANDLE VmsSbApiPort   = (HANDLE) 0; // \VMS\SbApiPort\r
+HANDLE SmCalledBack   = (HANDLE) 0; // signalled when SM connects to \VMS\SbApiPort\r
+HANDLE SmVmsSbApiPort = (HANDLE) 0; // server side (our one) port for SM conn request\r
+HANDLE SmApiPort      = (HANDLE) 0; // client side of \SmApiPort\r
+\r
+HANDLE VmsSessionPort = (HANDLE) 0; // pseudo terminals call here for a new session\r
+HANDLE VmsApiPort     = (HANDLE) 0; // VMS processes call here for system calls\r
+\r
+/**********************************************************************\r
+ *     SB API Port Thread\r
+ *********************************************************************/\r
+static VOID STDCALL\r
+VmsSbApiPortThread (PVOID x)\r
+{\r
+       HANDLE Port = (HANDLE) x;\r
+       NTSTATUS Status = STATUS_SUCCESS;\r
+       LPC_MAX_MESSAGE ConnectionRequest = {{0}};\r
+\r
+       DPRINT("VMS: %s: called\n", __FUNCTION__);\r
+       \r
+       Status = NtListenPort (Port, & ConnectionRequest.Header);\r
+       if(!NT_SUCCESS(Status))\r
+       {\r
+               DPRINT("VMS: %s: NtListenPort failed (Status=0x%08lx)\n",\r
+                       __FUNCTION__, Status);\r
+       }else{\r
+               DPRINT("VMS: %s received a connection request\n", __FUNCTION__);\r
+               Status = NtAcceptConnectPort (& SmVmsSbApiPort,\r
+                                             0,\r
+                                             & ConnectionRequest.Header,\r
+                                             TRUE, /* accept it */\r
+                                             NULL,\r
+                                             NULL);\r
+               if(!NT_SUCCESS(Status))\r
+               {\r
+                       DPRINT("VMS: %s: NtAcceptConnectPort failed (Status=0x%08lx)\n",\r
+                               __FUNCTION__, Status);\r
+               }else{\r
+                       DPRINT("VMS: %s accepted the connection request\n", __FUNCTION__);\r
+                       Status = NtCompleteConnectPort (SmVmsSbApiPort);\r
+                       if(!NT_SUCCESS(Status))\r
+                       {\r
+                               DPRINT("VMS: %s: NtCompleteConnectPort failed (Status=0x%08lx)\n",\r
+                                       __FUNCTION__, Status);\r
+                       }else{\r
+                               DPRINT("VMS: %s completed the connection request\n", __FUNCTION__);\r
+                               Status = NtSetEvent (SmCalledBack, NULL);\r
+                               DPRINT("VMS: %s signalled the main thread to initialize the subsystem\n", __FUNCTION__);\r
+                               DPRINT("VMS: %s enters main loop\n", __FUNCTION__);\r
+                               while (TRUE)\r
+                               {\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+       NtClose (Port);\r
+       NtTerminateThread (NtCurrentThread(), Status);\r
+}\r
+/**********************************************************************\r
+ *     API Port Thread\r
+ *********************************************************************/\r
+static VOID STDCALL\r
+VmsApiPortThread (PVOID x)\r
+{\r
+       HANDLE Port = (HANDLE) x;\r
+       NTSTATUS Status = STATUS_SUCCESS;\r
+       \r
+       DPRINT("VMS: %s: called\n", __FUNCTION__);\r
+       while (TRUE)\r
+       {\r
+       }\r
+       NtClose (Port);\r
+       NtTerminateThread (NtCurrentThread(), Status);\r
+}\r
+\r
+/**********************************************************************\r
+ * NAME                                                        PRIVATE\r
+ *     VmspCreateObDirectory/1\r
+ */\r
+static NTSTATUS FASTCALL\r
+VmspCreateObDirectory (PWSTR DirectoryName)\r
+{\r
+       UNICODE_STRING     usDirectoryName = {0};\r
+       OBJECT_ATTRIBUTES  DirectoryAttributes = {0};\r
+       NTSTATUS           Status = STATUS_SUCCESS;\r
+       HANDLE             hDirectory = (HANDLE) 0;\r
+\r
+       DPRINT("VMS: %s called\n", __FUNCTION__);\r
+\r
+       RtlInitUnicodeString (& usDirectoryName,\r
+                             DirectoryName);\r
+       InitializeObjectAttributes (& DirectoryAttributes,\r
+                                   & usDirectoryName,\r
+                                   0, NULL, NULL);\r
+       Status = NtCreateDirectoryObject (& hDirectory,\r
+                                         DIRECTORY_CREATE_SUBDIRECTORY,\r
+                                         & DirectoryAttributes);\r
+       if(!NT_SUCCESS(Status))\r
+       {\r
+               DPRINT("VMS: %s: NtCreateDirectoryObject failed (Status=0x%08lx)\n",\r
+                               __FUNCTION__, Status);\r
+               return Status;\r
+       }\r
+       NtClose (hDirectory);\r
+       return STATUS_SUCCESS;\r
+}\r
+\r
+/**********************************************************************\r
+ * NAME                                                        PRIVATE\r
+ *     VmspCreatePort/1\r
+ */\r
+static NTSTATUS STDCALL\r
+VmspCreatePort (IN OUT PHANDLE pPortHandle,\r
+               IN     PWSTR PortName,\r
+               IN     ULONG MaxDataSize,\r
+               IN     ULONG MaxMessageSize,\r
+               IN     PTHREAD_START_ROUTINE ListeningThread)\r
+{\r
+       UNICODE_STRING     usPortName = {0};\r
+       OBJECT_ATTRIBUTES  PortAttributes = {0};\r
+       NTSTATUS           Status = STATUS_SUCCESS;\r
+\r
+       DPRINT("VMS: %s called\n", __FUNCTION__);\r
+\r
+       if(NULL == ListeningThread)\r
+       {\r
+               return STATUS_INVALID_PARAMETER;\r
+       }\r
+       \r
+       RtlInitUnicodeString (& usPortName, PortName);\r
+       Status = NtCreatePort (pPortHandle,\r
+                               & PortAttributes,\r
+                               MaxDataSize,\r
+                               MaxMessageSize,\r
+                               0);\r
+       if(!NT_SUCCESS(Status))\r
+       {\r
+               DPRINT("VMS: %s: NtCreatePort failed (Status=0x%08lx)\n", __FUNCTION__, Status);\r
+               return Status;\r
+       }\r
+       Status = RtlCreateUserThread (NtCurrentProcess(),\r
+                                     NULL,\r
+                                     FALSE,\r
+                                     0, 0, 0,\r
+                                     ListeningThread,\r
+                                     pPortHandle,\r
+                                     NULL, NULL);\r
+       if(!NT_SUCCESS(Status))\r
+       {\r
+               DPRINT("VMS: %s: RtlCreateUserThread failed (Status=0x%08lx)\n", __FUNCTION__, Status);\r
+               return Status;\r
+       }\r
+       return Status;\r
+}\r
+\r
+/**********************************************************************\r
+ * VmsInitializeServer/0\r
+ */\r
+NTSTATUS\r
+VmsInitializeServer(VOID)\r
+{\r
+       NTSTATUS Status = STATUS_SUCCESS;\r
+       WCHAR    NameBuffer [32];\r
+\r
+       DPRINT("VMS: %s called\n", __FUNCTION__);\r
+\r
+       /* Create the \VMS directory */\r
+       wcscpy (NameBuffer, L"\\VMS");\r
+       Status = VmspCreateObDirectory (NameBuffer);\r
+       if(!NT_SUCCESS(Status))\r
+       {\r
+               DPRINT("VMS: %s: VmspCreateObDirectory failed!\n", __FUNCTION__);\r
+       }else{\r
+               /* Create the \VMS\SbApiPort port */\r
+               wcscat (NameBuffer, L"\\SbApiPort");\r
+               Status = VmspCreatePort (& VmsSbApiPort,\r
+                                        NameBuffer,\r
+                                        0x104,\r
+                                        0x148,\r
+                                        VmsSbApiPortThread);\r
+               if(!NT_SUCCESS(Status))\r
+               {\r
+                       DPRINT("VMS %s: VmspCreatePort failed (Status=%08lx)\n",\r
+                                       __FUNCTION__, Status);\r
+                       return Status;\r
+               }else{\r
+                       OBJECT_ATTRIBUTES EventAttributes;\r
+                       \r
+                       InitializeObjectAttributes (& EventAttributes,\r
+                                                       NULL,\r
+                                                       0,\r
+                                                       NULL,\r
+                                                       NULL);\r
+                       Status = NtCreateEvent (& SmCalledBack,\r
+                                               EVENT_ALL_ACCESS,\r
+                                               & EventAttributes,\r
+                                               SynchronizationEvent,\r
+                                               FALSE);\r
+                       if(!NT_SUCCESS(Status))\r
+                       {\r
+                               DPRINT("VMS: %s: NtCreateEvent failed (Status=0x%08lx)\n",\r
+                                               __FUNCTION__, Status);\r
+                               return Status;\r
+                       }else{\r
+                               UNICODE_STRING VmsSbApiPortName;\r
+\r
+                               RtlInitUnicodeString (& VmsSbApiPortName, NameBuffer);\r
+                               Status = SmConnectApiPort (& VmsSbApiPortName,\r
+                                                          VmsSbApiPort,\r
+                                                          77, /* VMS CUI */\r
+                                                          & SmApiPort);\r
+                               if(!NT_SUCCESS(Status))\r
+                               {\r
+                                       DPRINT("VMS: %s: SmConnectApiPort failed (Status=0x%08lx)\n",\r
+                                                       __FUNCTION__, Status);\r
+                                       return Status;\r
+                               }else{\r
+                                       Status = NtWaitForSingleObject (SmCalledBack,\r
+                                                                       FALSE,\r
+                                                                       INFINITE);\r
+                                       /* OK initialize the VMS subsystem */\r
+                                       wcscpy (& NameBuffer[4], L"\\ApiPort");\r
+                                       Status = VmspCreatePort (& VmsApiPort,\r
+                                                                NameBuffer,\r
+                                                                0x104,\r
+                                                                0x148,\r
+                                                                VmsApiPortThread);\r
+                                       /* TODO */\r
+       \r
+                                       wcscpy (& NameBuffer[4], L"\\Session");\r
+                                       Status = VmspCreateObDirectory (NameBuffer);\r
+                                       /* TODO */\r
+\r
+                                       Status = SmCompleteSession (SmApiPort,\r
+                                                                   VmsSbApiPort,\r
+                                                                   VmsApiPort);\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+       return STATUS_SUCCESS;  \r
+}\r
+\r
+/* EOF */\r
diff --git a/vms/server/makefile b/vms/server/makefile
new file mode 100644 (file)
index 0000000..66d447d
--- /dev/null
@@ -0,0 +1,24 @@
+# $Id: $\r
+#\r
+# ReactOS VMS+ Environment Subsystem Server\r
+#\r
+\r
+PATH_TO_TOP = ../../reactos\r
+\r
+TARGET_TYPE = program\r
+\r
+TARGET_APPTYPE = native\r
+\r
+TARGET_NAME = vmsss\r
+\r
+TARGET_SDKLIBS = ntdll.a smdll.a\r
+\r
+TARGET_CFLAGS = -Iinclude -I../include\r
+\r
+TARGET_OBJECTS = vmsss.o init.o server.o\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+include $(TOOLS_PATH)/helper.mk\r
+\r
+# EOF\r
diff --git a/vms/server/server.c b/vms/server/server.c
new file mode 100644 (file)
index 0000000..eb49b14
--- /dev/null
@@ -0,0 +1,68 @@
+/* $Id: $\r
+ *\r
+ * init.c - VMS Enviroment Subsystem Server - Initialization\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 __USE_NT_LPC__\r
+#include "vmsss.h"\r
+\r
+//#define NDEBUG\r
+#include <debug.h>\r
+\r
+\r
+/**********************************************************************\r
+ * NAME                                                        PRIVATE\r
+ *     VmspCreatePort/1\r
+ */\r
+NTSTATUS VmsRunServer (VOID)\r
+{\r
+       NTSTATUS Status = STATUS_SUCCESS;\r
+       LPC_MAX_MESSAGE Request;\r
+       PLPC_MESSAGE Reply = NULL;\r
+       ULONG MessageType = 0;\r
+\r
+       while (TRUE)\r
+       {\r
+               Status = NtReplyWaitReceivePort (VmsApiPort,\r
+                                                0,\r
+                                                Reply,\r
+                                                & Request);\r
+               if(NT_SUCCESS(Status))\r
+               {\r
+                       MessageType = PORT_MESSAGE_TYPE(Request);\r
+                       DPRINT("VMS: %s received a message (Type=%d)\n",\r
+                                       __FUNCTION__, MessageType);\r
+                       switch(MessageType)\r
+                       {\r
+                       default:\r
+                               continue;\r
+                       }\r
+               }else{\r
+                       DPRINT("VMS: %s: NtReplyWaitReceivePort failed (Status=%08lx)\n",\r
+                                       __FUNCTION__, Status);\r
+               }\r
+       }\r
+       return Status;\r
+}\r
+\r
+/* EOF */\r
diff --git a/vms/server/vmsss.c b/vms/server/vmsss.c
new file mode 100644 (file)
index 0000000..4f80735
--- /dev/null
@@ -0,0 +1,46 @@
+/* $Id: $\r
+ *\r
+ * vmsss.c - VMS Enviroment Subsystem Server\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
+#include "vmsss.h"\r
+\r
+#define NDEBUG\r
+#include <debug.h>\r
+\r
+/* Native image's entry point */\r
+\r
+VOID STDCALL\r
+NtProcessStartup(PPEB Peb)\r
+{\r
+       NTSTATUS Status = STATUS_SUCCESS;\r
+\r
+       Status = VmsInitializeServer();\r
+       if(STATUS_SUCCESS != Status)\r
+       {\r
+               DPRINT("VMS: VmsInitializeServer failed! Aborting. (Status=%lx)\n", Status);\r
+       }\r
+       Status = VmsRunServer();\r
+       NtTerminateProcess(NtCurrentProcess(),Status);\r
+}\r
+/* EOF */\r
diff --git a/vms/server/vmsss.h b/vms/server/vmsss.h
new file mode 100644 (file)
index 0000000..57c34cd
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef _VMSSS_H_INCLUDED_\r
+#define _VMSSS_H_INCLUDED_\r
+\r
+#define NTOS_MODE_USER\r
+#include <ntos.h>\r
+#include <sm/helper.h>\r
+\r
+/* init.c */\r
+extern HANDLE VmsApiPort;\r
+NTSTATUS VmsInitializeServer(VOID);\r
+\r
+/* server.c */\r
+NTSTATUS VmsRunServer(VOID);\r
+\r
+#endif /* ndef _VMSSS_H_INCLUDED_ */\r
diff --git a/vms/server/vmsss.rc b/vms/server/vmsss.rc
new file mode 100644 (file)
index 0000000..82ae31e
--- /dev/null
@@ -0,0 +1,4 @@
+#define REACTOS_STR_FILE_DESCRIPTION   "ReactOS/VMS Environment Subsystem Server\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "vmsss\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "vmsss.exe\0"\r
+#include <reactos/version.rc>\r
diff --git a/vms/tools/mksystab/makefile b/vms/tools/mksystab/makefile
new file mode 100644 (file)
index 0000000..3295974
--- /dev/null
@@ -0,0 +1,5 @@
+all: implib\r
+\r
+implib:\r
+\r
+clean:\r