OS/2: more changes to make it conform to rbuild.
authorEmanuele Aliberti <ea@iol.it>
Fri, 12 Aug 2005 20:55:07 +0000 (20:55 +0000)
committerEmanuele Aliberti <ea@iol.it>
Fri, 12 Aug 2005 20:55:07 +0000 (20:55 +0000)
svn path=/trunk/; revision=17353

26 files changed:
os2/apps/bepslep/.cvsignore [deleted file]
os2/apps/bepslep/bepslep.xml [new file with mode: 0644]
os2/apps/directory.xml [new file with mode: 0644]
os2/lib/directory.xml [new file with mode: 0644]
os2/lib/doscalls/.cvsignore [deleted file]
os2/lib/doscalls/devices/.cvsignore [deleted file]
os2/lib/doscalls/devices/devices.cpp
os2/lib/doscalls/doscalls.rc
os2/lib/doscalls/doscalls.xml [new file with mode: 0644]
os2/lib/doscalls/file/.cvsignore [deleted file]
os2/lib/doscalls/file/directory.cpp
os2/lib/doscalls/file/openclose.cpp
os2/lib/doscalls/misc/.cvsignore [deleted file]
os2/lib/doscalls/misc/doscalls.cpp
os2/lib/doscalls/misc/error.cpp
os2/lib/doscalls/run/.cvsignore [deleted file]
os2/lib/doscalls/run/process.cpp
os2/server/.cvsignore [deleted file]
os2/server/dllmain.c [new file with mode: 0644]
os2/server/makefile [deleted file]
os2/server/os2srv.def [new file with mode: 0644]
os2/server/os2srv.h [new file with mode: 0644]
os2/server/os2srv.rc [new file with mode: 0644]
os2/server/os2srv.xml [new file with mode: 0644]
os2/server/os2ss.cpp [deleted file]
os2/server/server.c [new file with mode: 0644]

diff --git a/os2/apps/bepslep/.cvsignore b/os2/apps/bepslep/.cvsignore
deleted file mode 100644 (file)
index 0ec02ac..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-*.exe
-*.o
-*.sym
diff --git a/os2/apps/bepslep/bepslep.xml b/os2/apps/bepslep/bepslep.xml
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/os2/apps/directory.xml b/os2/apps/directory.xml
new file mode 100644 (file)
index 0000000..78a17b7
--- /dev/null
@@ -0,0 +1,5 @@
+<group>
+       <directory name="bepslep">
+               <xi:include href="bepslep/bepslep.xml" />
+       </directory>
+</group>
diff --git a/os2/lib/directory.xml b/os2/lib/directory.xml
new file mode 100644 (file)
index 0000000..98087f3
--- /dev/null
@@ -0,0 +1,5 @@
+<group>
+       <directory name="doscalls">
+               <xi:include href="doscalls/doscalls.xml" />
+       </directory>
+</group>
diff --git a/os2/lib/doscalls/.cvsignore b/os2/lib/doscalls/.cvsignore
deleted file mode 100644 (file)
index 5aa4971..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-*.exe
-*.o
-*.sym
-*.dll
-*.coff
diff --git a/os2/lib/doscalls/devices/.cvsignore b/os2/lib/doscalls/devices/.cvsignore
deleted file mode 100644 (file)
index 5761abc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.o
index 74ea21c..23d9295 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: devices.cpp,v 1.5 2004/01/31 01:29:11 robertk Exp $
+/* $Id$
 */
 /*
  *
index c4ff7f0..ea5631f 100644 (file)
@@ -1,38 +1,4 @@
-#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",   "OS2 subsystem base services\0"
-            VALUE "FileVersion",       RES_STR_FILE_VERSION
-            VALUE "InternalName",      "doscalls\0"
-            VALUE "LegalCopyright",    RES_STR_LEGAL_COPYRIGHT
-            VALUE "OriginalFilename",  "doscalls.dll\0"
-            VALUE "ProductName",       RES_STR_PRODUCT_NAME
-            VALUE "ProductVersion",    RES_STR_PRODUCT_VERSION
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
+#define REACTOS_STR_FILE_DESCRIPTION   "ReactOS-OS/2 subsystem base services\0"
+#define REACTOS_STR_INTERNAL_NAME      "doscalls\0"
+#define REACTOS_STR_ORIGINAL_FILENAME  "doscalls.dll\0"
+#include <reactos/version.rc>
diff --git a/os2/lib/doscalls/doscalls.xml b/os2/lib/doscalls/doscalls.xml
new file mode 100644 (file)
index 0000000..c6da163
--- /dev/null
@@ -0,0 +1,23 @@
+<module name="doscalls" type="nativedll">
+       <importlibrary definition="doscalls.def" />
+       <include base="doscalls">../../include</include>
+       <linkerflag>-lgcc</linkerflag>
+       <directory name="devices">
+               <file>devices.cpp</file>
+               <file>ioctl_async.cpp</file>
+       </directory>
+       <directory name="file">
+               <file>directory.cpp</file>
+               <file>openclose.cpp</file>
+       </directory>
+       <directory name="memory">
+               <file>memory.cpp</file>
+       </directory>
+       <directory name="misc">
+               <file>doscalls.cpp</file>
+               <file>error.cpp</file>
+       </directory>
+       <directory name="run">
+               <file>process.cpp</file>
+       </directory>
+</module>
diff --git a/os2/lib/doscalls/file/.cvsignore b/os2/lib/doscalls/file/.cvsignore
deleted file mode 100644 (file)
index 5761abc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.o
index b6b5d38..d271cc1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: directory.cpp,v 1.1 2002/09/04 22:19:47 robertk Exp $
+/* $Id$
 */
 /*
  *
index 23c744a..2b6e167 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: openclose.cpp,v 1.5 2004/01/31 01:29:11 robertk Exp $
+/* $Id$
 */
 /*
  *
diff --git a/os2/lib/doscalls/misc/.cvsignore b/os2/lib/doscalls/misc/.cvsignore
deleted file mode 100644 (file)
index 5761abc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.o
index f9f419a..cc40f9c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: doscalls.cpp,v 1.1 2002/07/26 00:23:13 robertk Exp $
+/* $Id$
 */
 /*
  *
index 7f77be8..93a4c84 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: error.cpp,v 1.3 2003/01/07 16:23:11 robd Exp $
+/* $Id$
 */
 /*
  *
diff --git a/os2/lib/doscalls/run/.cvsignore b/os2/lib/doscalls/run/.cvsignore
deleted file mode 100644 (file)
index 5761abc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.o
index 4d26e37..68c7bcd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $
+/* $Id$
 */
 /*
  *
@@ -31,7 +31,7 @@ APIRET STDCALL DosSleep(ULONG msec)
 }
 
 
-/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $ */
+/* $Id$ */
 /* Terminates the current thread or the current Process.
        Decission is made by action 
        FIXME:  move this code to OS2.EXE */
diff --git a/os2/server/.cvsignore b/os2/server/.cvsignore
deleted file mode 100644 (file)
index 0ec02ac..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-*.exe
-*.o
-*.sym
diff --git a/os2/server/dllmain.c b/os2/server/dllmain.c
new file mode 100644 (file)
index 0000000..8d84b68
--- /dev/null
@@ -0,0 +1,50 @@
+/* $Id$
+ *
+ * dllmain.c - OS/2 Enviroment Subsystem Server
+ * 
+ * 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.  
+ *
+ * --------------------------------------------------------------------
+ */
+#include "os2srv.h"
+
+#define NDEBUG
+#include <debug.h>
+
+/* DLL entry point */
+
+HANDLE Os2SrvDllHandle = 0;
+
+/* FUNCTIONS *****************************************************************/
+
+BOOL STDCALL
+DllMain(HANDLE hDll,
+       DWORD dwReason,
+       LPVOID lpReserved)
+{
+  if (DLL_PROCESS_ATTACH == dwReason)
+    {
+      Os2SrvDllHandle = hDll;
+    }
+
+  return TRUE;
+}
+
+/* EOF */
diff --git a/os2/server/makefile b/os2/server/makefile
deleted file mode 100644 (file)
index d1ee3a2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# $Id: makefile,v 1.3 2003/01/12 02:03:06 robd Exp $
-
-PATH_TO_TOP = ../../reactos
-
-TARGET_TYPE = program
-
-TARGET_NORC = yes
-
-TARGET_APPTYPE = native
-
-TARGET_NAME = os2ss
-
-TARGET_INSTALLDIR = system32
-
-TARGET_CFLAGS = -D__NTAPP__
-
-TARGET_SDKLIBS = ntdll.a kernel32.a csrss.a
-
-TARGET_GCCLIBS = stdc++
-
-OBJECTS_API = 
-
-OBJECTS_MISC = \
-  $(TARGET_NAME).o 
-
-TARGET_OBJECTS = \
-  $(OBJECTS_API) \
-  $(OBJECTS_MISC)
-
-include $(PATH_TO_TOP)/rules.mak
-
-include $(TOOLS_PATH)/helper.mk
-
-# EOF
diff --git a/os2/server/os2srv.def b/os2/server/os2srv.def
new file mode 100644 (file)
index 0000000..81fe14c
--- /dev/null
@@ -0,0 +1,3 @@
+LIBRARY os2srv.dll
+EXPORTS
+ServerDllInitialization@8
diff --git a/os2/server/os2srv.h b/os2/server/os2srv.h
new file mode 100644 (file)
index 0000000..f80eb73
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _OS2SS_H_INCLUDED_
+#define _OS2SS_H_INCLUDED_
+
+/* PSDK/NDK Headers */
+#include <stdio.h>
+#include <windows.h>
+
+#define NTOS_MODE_USER
+#include <ndk/ntndk.h>
+
+#include <csr/server.h>
+
+#endif /* ndef _OS2SS_H_INCLUDED_ */
diff --git a/os2/server/os2srv.rc b/os2/server/os2srv.rc
new file mode 100644 (file)
index 0000000..f4e3fff
--- /dev/null
@@ -0,0 +1,4 @@
+#define REACTOS_STR_FILE_DESCRIPTION   "ReactOS-OS/2 Environment Subsystem Server\0"
+#define REACTOS_STR_INTERNAL_NAME      "os2srv\0"
+#define REACTOS_STR_ORIGINAL_FILENAME  "os2srv.dll\0"
+#include <reactos/version.rc>
diff --git a/os2/server/os2srv.xml b/os2/server/os2srv.xml
new file mode 100644 (file)
index 0000000..3c5706a
--- /dev/null
@@ -0,0 +1,11 @@
+<module name="os2srv" type="nativedll">
+       <importlibrary definition="os2srv.def" />
+       <include base="os2srv">.</include>
+       <define name="__USE_W32API" />
+       <define name="_DISABLE_TIDENTS" />
+       <library>ntdll</library>
+       <library>csrsrv</library>
+       <file>dllmain.c</file>
+       <file>server.c</file>
+       <file>os2srv.rc</file>
+</module>
diff --git a/os2/server/os2ss.cpp b/os2/server/os2ss.cpp
deleted file mode 100644 (file)
index 8ece4bb..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/* $Id: os2ss.cpp,v 1.2 2003/01/07 16:23:12 robd Exp $
- *
- * reactos/subsys/csrss/api/process.c
- *
- * "\windows\ApiPort" port process management functions
- *
- * ReactOS Operating System
- */
- // TODO: Rewrite the whole file. This is just a copy
-
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
-#include <ntos/synch.h>
-
-extern "C" {
-BOOL CsrServerInitialization(ULONG ArgumentCount, PWSTR *ArgumentArray);
-VOID DisplayString(LPCWSTR lpwString);
-//BOOL STDCALL CsrServerInitialization (ULONG ArgumentCount, PWSTR *ArgumentArray);
-//VOID STDCALL DisplayString(LPCWSTR lpwString);
-//VOID STDCALL PrintString (char* fmt, ...);
-//NTSTATUS STDCALL NtDisplayString(IN PUNICODE_STRING DisplayString);
-
-void
-DisplayString(LPCWSTR lpwString)
-{
-  UNICODE_STRING us;
-
-  RtlInitUnicodeString(&us, lpwString);
-  NtDisplayString(&us);
-}
-
-/*
-void
-PrintString(char* fmt,...)
-{
-  char buffer[512];
-  va_list ap;
-  UNICODE_STRING UnicodeString;
-  ANSI_STRING AnsiString;
-
-  va_start(ap, fmt);
-  vsprintf(buffer, fmt, ap);
-  va_end(ap);
-
-  RtlInitAnsiString(&AnsiString, buffer);
-  RtlAnsiStringToUnicodeString(&UnicodeString,
-                              &AnsiString,
-                              TRUE);
-  NtDisplayString(&UnicodeString);
-  RtlFreeUnicodeString(&UnicodeString);
-}
- */
-
-}
-
-/* server variables */
-
-int NumProcesses;
-
-
-
-/* Native image's entry point */
-
-void NtProcessStartup (PPEB Peb)
-{
-   PRTL_USER_PROCESS_PARAMETERS ProcParams;
-   PWSTR ArgBuffer;
-   PWSTR *argv;
-   ULONG argc = 0;
-   int i = 0;
-   int afterlastspace = 0;
-   OBJECT_ATTRIBUTES ObjectAttributes;
-   HANDLE CsrssInitEvent;
-   UNICODE_STRING UnicodeString;
-   NTSTATUS Status;
-
-   ProcParams = RtlNormalizeProcessParams (Peb->ProcessParameters);
-
-   argv = (PWSTR *)RtlAllocateHeap (Peb->ProcessHeap,
-                                    0, 512 * sizeof(PWSTR));
-   ArgBuffer = (PWSTR)RtlAllocateHeap (Peb->ProcessHeap,
-                                       0,
-                                       ProcParams->CommandLine.Length + sizeof(WCHAR));
-   memcpy (ArgBuffer,
-           ProcParams->CommandLine.Buffer,
-           ProcParams->CommandLine.Length + sizeof(WCHAR));
-
-   while (ArgBuffer[i])
-     {
-        if (ArgBuffer[i] == L' ')
-          {
-             argc++;
-             ArgBuffer[i] = L'\0';
-             argv[argc-1] = &(ArgBuffer[afterlastspace]);
-             i++;
-             while (ArgBuffer[i] == L' ')
-                i++;
-             afterlastspace = i;
-          }
-        else
-          {
-             i++;
-          }
-     }
-
-   if (ArgBuffer[afterlastspace] != L'\0')
-     {
-        argc++;
-        ArgBuffer[i] = L'\0';
-        argv[argc-1] = &(ArgBuffer[afterlastspace]);
-     }
-   
-   RtlInitUnicodeString(&UnicodeString,
-                        L"\\CsrssInitDone");
-   InitializeObjectAttributes(&ObjectAttributes,
-                              &UnicodeString,
-                              EVENT_ALL_ACCESS,
-                              0,
-                              NULL);
-   Status = NtOpenEvent(&CsrssInitEvent,
-                        EVENT_ALL_ACCESS,
-                        &ObjectAttributes);
-   if (!NT_SUCCESS(Status))
-     {
-        DbgPrint("CSR: Failed to open csrss notification event\n");
-     }
-   if (CsrServerInitialization (argc, argv) == TRUE)
-     {
-
-        NtSetEvent(CsrssInitEvent,
-                   NULL);
-        
-        RtlFreeHeap (Peb->ProcessHeap,
-                     0, argv);
-        RtlFreeHeap (Peb->ProcessHeap,
-                     0,
-                     ArgBuffer);
-
-        /* terminate the current thread only */
-        NtTerminateThread( NtCurrentThread(), 0 );
-     }
-   else
-     {
-        DisplayString( L"CSR: Subsystem initialization failed.\n" );
-
-        RtlFreeHeap (Peb->ProcessHeap,
-                     0, argv);
-        RtlFreeHeap (Peb->ProcessHeap,
-                     0,
-                     ArgBuffer);
-
-        /*
-         * Tell SM we failed.
-         */
-        NtTerminateProcess( NtCurrentProcess(), 0 );
-   }
-}
diff --git a/os2/server/server.c b/os2/server/server.c
new file mode 100644 (file)
index 0000000..fa95de2
--- /dev/null
@@ -0,0 +1,84 @@
+/* $Id$
+ *
+ * server.c - OS/2 Enviroment Subsystem Server - Initialization
+ * 
+ * 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.  
+ *
+ * --------------------------------------------------------------------
+ */
+#include "os2srv.h"
+
+//#define NDEBUG
+#include <debug.h>
+
+HANDLE Os2ApiPort = NULL;
+
+/**********************************************************************
+ * NAME                                                        PRIVATE
+ *     Os2StaticServerThread/1
+ */
+VOID STDCALL Os2StaticServerThread (PVOID x)
+{
+       NTSTATUS Status = STATUS_SUCCESS;
+       PPORT_MESSAGE Request = (PPORT_MESSAGE) x;
+       PPORT_MESSAGE Reply = NULL;
+       ULONG MessageType = 0;
+
+       DPRINT("VMSSRV: %s called\n", __FUNCTION__);
+
+       MessageType = Request->u2.s2.Type;
+       DPRINT("VMSSRV: %s received a message (Type=%d)\n",
+               __FUNCTION__, MessageType);
+       switch (MessageType)
+       {
+               default:
+                       Reply = Request;
+                       Status = NtReplyPort (Os2ApiPort, Reply);
+                       break;
+       }
+}
+
+/*=====================================================================
+ *     PUBLIC API
+ *===================================================================*/
+
+NTSTATUS STDCALL ServerDllInitialization (ULONG ArgumentCount,
+                                         LPWSTR *Argument)
+{
+       NTSTATUS Status = STATUS_SUCCESS;
+       
+       DPRINT("VMSSRV: %s called\n", __FUNCTION__);
+
+       // Get the listening port from csrsrv.dll
+       Os2ApiPort = CsrQueryApiPort ();
+       if (NULL == Os2ApiPort)
+       {
+               return STATUS_UNSUCCESSFUL;
+       }
+       // Register our message dispatcher
+       Status = CsrAddStaticServerThread (Os2StaticServerThread);
+       if (NT_SUCCESS(Status))
+       {
+               //TODO: perform the real OS/2 server internal initialization here
+       }
+       return Status;
+}
+
+/* EOF */