Performed housekeeping to get the subsystem building. Introduced ros makefile 'standa...
authorRobert Dickenson <robd@reactos.org>
Tue, 7 Jan 2003 16:23:12 +0000 (16:23 +0000)
committerRobert Dickenson <robd@reactos.org>
Tue, 7 Jan 2003 16:23:12 +0000 (16:23 +0000)
Is anybody doing any work on the OS/2 support?

svn path=/trunk/; revision=3946

20 files changed:
os2/apps/bepslep/.cvsignore [new file with mode: 0644]
os2/apps/bepslep/Makefile
os2/apps/bepslep/bepslep.c
os2/include/os2.h
os2/include/ros2.h
os2/lib/doscalls/.cvsignore [new file with mode: 0644]
os2/lib/doscalls/devices/.cvsignore [new file with mode: 0644]
os2/lib/doscalls/devices/devices.cpp
os2/lib/doscalls/doscalls.def
os2/lib/doscalls/doscalls.edf
os2/lib/doscalls/file/.cvsignore [new file with mode: 0644]
os2/lib/doscalls/file/openclose.cpp
os2/lib/doscalls/makefile
os2/lib/doscalls/misc/.cvsignore [new file with mode: 0644]
os2/lib/doscalls/misc/error.cpp
os2/lib/doscalls/run/.cvsignore [new file with mode: 0644]
os2/lib/doscalls/run/process.cpp
os2/server/.cvsignore [new file with mode: 0644]
os2/server/makefile
os2/server/os2ss.cpp

diff --git a/os2/apps/bepslep/.cvsignore b/os2/apps/bepslep/.cvsignore
new file mode 100644 (file)
index 0000000..0ec02ac
--- /dev/null
@@ -0,0 +1,3 @@
+*.exe
+*.o
+*.sym
index 61e676c..270d974 100644 (file)
@@ -1,32 +1,37 @@
-# $Id: Makefile,v 1.1 2002/03/23 19:23:27 robertk Exp $
+# $Id: Makefile,v 1.2 2003/01/07 16:23:10 robd Exp $
 #
-# To run it in Win32 console mode, undefine __SUBSYSTEM_WINDOWS__
-# and pass "console" in the ld's --subsystem option.
-# 
 #
-PATH_TO_TOP=../../../..
 
-PATH_TO_OS2_TOP=../..
+PATH_TO_TOP = ../../../reactos
 
-TARGET_NAME=bepslep
+PATH_TO_OS2_TOP = ../..
 
-CFLAGS=-D__SUBSYSTEM_WINDOWS__
+TARGET_TYPE = program
 
-OBJECTS=$(TARGET_NAME).o
+TARGET_NORC = yes
 
-LIBRARIES=\
-       $(PATH_TO_OS2_TOP)/dll/doscalls.dll 
+#TARGET_APPTYPE = console
+TARGET_APPTYPE = windows
 
-$(TARGET_NAME): $(OBJECTS) $(LIBRARIES)
-       $(CC) \
-               $(CFLAGS) \
-               $(OBJECTS) \
-               $(LIBRARIES)\
-               -o $@ \
-               -Wl,--subsystem,windows\
-               -nostartfiles \
-               -nostdlib
+TARGET_NAME = bepslep
+
+TARGET_CFLAGS = -D__SUBSYSTEM_WINDOWS__
+
+TARGET_LFLAGS = -nostartfiles
+
+TARGET_SDKLIBS = doscalls.a
+
+TARGET_GCCLIBS = stdc++
+
+#TARGET_LIBS = $(PATH_TO_OS2_TOP)/lib/crt0w32.o \
+#            $(PATH_TO_TOP)/dk/psx/lib/psxdll.a
+
+#      $(PATH_TO_OS2_TOP)/dll/doscalls.dll 
+
+TARGET_OBJECTS = $(TARGET_NAME).o
 
 include $(PATH_TO_TOP)/rules.mak
 
+include $(TOOLS_PATH)/helper.mk
+
 # EOF
index 4ada5d7..cacb59f 100644 (file)
@@ -1,6 +1,7 @@
 
 #define INCL_DOSPROCESS
 #include "../../include/os2.h"
+//#include "../../include/ros2.h"
 
 void Eingang()
 {
@@ -16,4 +17,4 @@ void WinMainCRTStartup()
        a= b+3;
        b=a+3;
        Eingang();
-}
\ No newline at end of file
+}
index 81f567e..e888381 100644 (file)
@@ -3,6 +3,10 @@
 #ifndef _OS2EMX_H
 #define _OS2EMX_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 #pragma pack(1)
 
 /* ------------------------ INCL_ SYMBOLS --------------------------------- */
@@ -2656,7 +2660,18 @@ ULONG DosKillProcess (ULONG ulAction, PID pid);
 ULONG DosKillThread (TID tid);
 ULONG DosResumeThread (TID tid);
 ULONG DosSetPriority (ULONG ulScope, ULONG ulClass, LONG lDelta, ULONG ulID);
+
+#define STDCALL     __attribute__ ((stdcall))
+//#define CDECL       __attribute__ ((cdecl))
+//#define CALLBACK    WINAPI
+//#define PASCAL      WINAPI
+
+#define WINAPI      STDCALL
+//#define APIENTRY    STDCALL
+
+//ULONG WINAPI DosSleep (ULONG ulInterval);
 ULONG DosSleep (ULONG ulInterval);
+
 ULONG DosSuspendThread (TID tid);
 ULONG DosVerifyPidTid (PID pid, TID tid);
 ULONG DosWaitChild (ULONG ulAction, ULONG ulWait, PRESULTCODES pReturnCodes,
@@ -12566,6 +12581,10 @@ USHORT MouSynch (USHORT fWait);
 
 #pragma pack(4)
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* not _OS2EMX_H */
 
 /* Note 1:
@@ -12581,3 +12600,4 @@ USHORT MouSynch (USHORT fWait);
  * indent-tabs-mode: t
  * end:
  */
+
index a72be6f..8c08b14 100644 (file)
        put into the namespace NT. The still conflicting #defines are handled
        like this:  If ntddk.h defintes a symbol FOO and os2.h does the same,
        this file here undefines the ntddk.h-one and renames it to NT_FOO.
-       This is only done for conflicting symbols. Of course, this ist a 
+       This is only done for conflicting symbols. Of course, this list is a 
        source for errors. But is there a better solution than renaming 
        all of the symbols?
 */
 
+#ifndef __ROS2_H__
+#define __ROS2_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
 namespace NT
 {
 #include <ddk/ntddk.h>
+#include <napi/types.h>
 }
 
 
@@ -49,4 +58,34 @@ namespace OS2
 #include "os2.h"
 }
 
-using namespace OS2;
\ No newline at end of file
+using namespace OS2;
+
+APIRET STDCALL  Dos32Open(PSZ    pszFileName,  PHFILE pHf,
+                            PULONG pulAction,  ULONG  cbFile,
+                            ULONG  ulAttribute,  ULONG  fsOpenFlags,
+                            ULONG  fsOpenMode,  PVOID reserved );  //ULONGPEAOP2 peaop2)
+APIRET STDCALL  Dos32Close(HFILE hFile);
+APIRET STDCALL  Dos32Read(HFILE hFile, PVOID pBuffer,
+                            ULONG cbRead, PULONG pcbActual);
+APIRET STDCALL  Dos32Write(HFILE hFile, PVOID pBuffer,
+                             ULONG cbWrite, PULONG pcbActual);
+ULONG STDCALL DosSleep (ULONG ulInterval);
+ULONG STDCALL DosBeep (ULONG ulFrequency, ULONG ulDuration);
+VOID STDCALL DosExit (ULONG ulAction, ULONG ulResult);
+
+//ULONG STDCALL DosDevIOCtl (HFILE hDevice, ULONG ulCategory, ULONG ulFunction,
+//    PVOID pParams, ULONG ulParamsLengthMax, PULONG pulParamsLength,
+//    PVOID pData, ULONG ulDataLengthMax, PULONG pulDataLength);
+
+typedef ULONG foo_TID;
+typedef foo_TID* foo_PTID;
+typedef void (*foo_PFNTHREAD)(ULONG ulThreadArg);
+
+ULONG STDCALL DosCreateThread (foo_PTID ptidThreadID, foo_PFNTHREAD pfnThreadAddr,
+    ULONG ulThreadArg, ULONG ulFlags, ULONG ulStackSize);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __ROS2_H__ */
diff --git a/os2/lib/doscalls/.cvsignore b/os2/lib/doscalls/.cvsignore
new file mode 100644 (file)
index 0000000..5aa4971
--- /dev/null
@@ -0,0 +1,5 @@
+*.exe
+*.o
+*.sym
+*.dll
+*.coff
diff --git a/os2/lib/doscalls/devices/.cvsignore b/os2/lib/doscalls/devices/.cvsignore
new file mode 100644 (file)
index 0000000..5761abc
--- /dev/null
@@ -0,0 +1 @@
+*.o
index 6ea1555..7353601 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: devices.cpp,v 1.3 2002/09/04 22:19:47 robertk Exp $
+/* $Id: devices.cpp,v 1.4 2003/01/07 16:23:11 robd Exp $
 */
 /*
  *
@@ -62,6 +62,4 @@ APIRET STDCALL Dos32DevIOCtl(HFILE hDevice, ULONG category, ULONG function,
        return ERROR_CALL_NOT_IMPLEMENTED;
 }
 
-
-
-/* EOF */
\ No newline at end of file
+/* EOF */
index ff99b24..0715fe2 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: doscalls.def,v 1.4 2002/09/04 22:19:47 robertk Exp $
+; $Id: doscalls.def,v 1.5 2003/01/07 16:23:11 robd Exp $
 ;
 ; Def for doscalls.dll - part of the OS/2-sub system
 ; for ReactOS. Provides Access to OS/2 kernel services.
@@ -10,14 +10,14 @@ DESCRIPTION "Part of the ReactOS OS/2 sub system, provides base kernel services
 EXPORTS
 ; FIXME: fill in all exports
 
-DosSleep@4                     
-DosClose@4                     
-DosOpen@32                     
-DosRead@16                     
-DosWrite@16                    
-DosDevIOCtl@36         
-DosBeep@8                      
-DosExit@8                      
-DosCreateThread@20     
+DosSleep
+Dos32Close
+Dos32Open
+Dos32Read
+Dos32Write
+;DosDevIOCtl
+DosBeep
+DosExit
+DosCreateThread
 
 ; EOF
index 0159398..1e59fcf 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: doscalls.edf,v 1.2 2002/03/24 18:55:38 ea Exp $
+; $Id: doscalls.edf,v 1.3 2003/01/07 16:23:11 robd Exp $
 ;
 ; Def for doscalls.dll - part of the OS/2-sub system
 ; for ReactOS. Provides Access to OS/2 kernel services.
@@ -10,14 +10,14 @@ DESCRIPTION "Part of the ReactOS OS/2 sub system, provides base kernel services
 EXPORTS
 ; FIXME: fill in all exports
 
-Dos32Sleep=Dos32Sleep@4                        @229
-Dos32Close=Dos32Close@4                                @257
-Dos32Open=Dos32Open@32                         @273
-Dos32Read=Dos32Read@16                         @281
-Dos32Write=Dos32Write@16                       @282
-Dos32DevIOCtl=Dos32DevIOCtl@36                 @284
-Dos32Beep=Dos32Beep@8                          @286
-Dos32Exit=Dos32Exit@8                          @234
-Dos32CreateThread=Dos32CreateThread@20         @311
+DosSleep=DosSleep@4                     @229
+Dos32Close=Dos32Close@4                 @257
+Dos32Open=Dos32Open@32                  @273
+Dos32Read=Dos32Read@16                  @281
+Dos32Write=Dos32Write@16                @282
+;DosDevIOCtl=DosDevIOCtl@36              @284
+DosBeep=DosBeep@8                       @286
+DosExit=DosExit@8                       @234
+DosCreateThread=DosCreateThread@20      @311
 
 ; EOF
diff --git a/os2/lib/doscalls/file/.cvsignore b/os2/lib/doscalls/file/.cvsignore
new file mode 100644 (file)
index 0000000..5761abc
--- /dev/null
@@ -0,0 +1 @@
+*.o
index a01eaa4..d638ef0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: openclose.cpp,v 1.3 2002/09/04 22:19:47 robertk Exp $
+/* $Id: openclose.cpp,v 1.4 2003/01/07 16:23:11 robd Exp $
 */
 /*
  *
@@ -20,7 +20,6 @@
 #include "ros2.h"
 
 
-
 APIRET STDCALL  Dos32Open(PSZ    pszFileName,  PHFILE pHf,
                             PULONG pulAction,  ULONG  cbFile,
                             ULONG  ulAttribute,  ULONG  fsOpenFlags,
@@ -130,12 +129,14 @@ APIRET STDCALL  Dos32Close(HFILE hFile)
        nErrCode = NT::ZwClose( (NT::HANDLE)hFile );
        switch( nErrCode )
        {
+/*
        case STATUS_SUCCESS:
                return NO_ERROR;
        case STATUS_INVALID_HANDLE:
                return ERROR_INVALID_HANDLE;
        case STATUS_HANDLE_NOT_CLOSABLE:
                return ERROR_FILE_NOT_FOUND;
+ */
        }
        return nErrCode;
 }
@@ -155,9 +156,11 @@ APIRET STDCALL  Dos32Read(HFILE hFile, PVOID pBuffer,
        *pcbActual = isbStatus.Information;
        switch(nErrCode)
        {
+/*
        case STATUS_INVALID_HANDLE:
                return ERROR_INVALID_HANDLE;
                // FIXME: complete this
+ */
        }
        return NO_ERROR;
 }
@@ -175,12 +178,14 @@ APIRET STDCALL  Dos32Write(HFILE hFile, PVOID pBuffer,
        return ERROR_CALL_NOT_IMPLEMENTED;
        switch(nErrCode)
        {
+/*
        case STATUS_SUCCESS:
        case STATUS_PENDING:
        case STATUS_ACCESS_DENIED:
        case STATUS_INVALID_HANDLE:
        case STATUS_FILE_LOCK_CONFLICT:
                return 0;
+ */
        }
        return 0;
 }
index 9eea31f..ab94d06 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.5 2002/09/04 22:19:47 robertk Exp $
+# $Id: makefile,v 1.6 2003/01/07 16:23:11 robd Exp $
 
 PATH_TO_TOP = ../../../reactos
 
@@ -15,7 +15,7 @@ TARGET_BASE = 0x60000000
 TARGET_CPPFLAGS =\
        -Wall \
        -I$(PATH_TO_OS2_TOP)/include \
-       -D__DOSCALLSDLL__ 
+       -D__DOSCALLSDLL__
 # removed CFLAGX
 #      -fno-builtin \
 #      -nostdinc \
@@ -23,24 +23,33 @@ TARGET_CPPFLAGS =\
 
 TARGET_LFLAGS = -nostartfiles
 
+TARGET_LIBS = doscalls.a
+
 TARGET_SDKLIBS = ntdll.a
 
-#TARGET_GCCLIBS = gcc
+TARGET_GCCLIBS = stdc++
 
 TARGET_OBJECTS = $(TARGET_NAME).o
 
-TARGET_CLEAN = file/*.o vio/*.o sync/*.o mem/*.o \
-                               misc/*.o mou/*.o kbd/*.o run/*.o \
-                               doscalls.dll temp.exp
 
-DOSCALLS_MISC_OBJECTS = misc/doscalls.o misc/error.o 
+MISC_OBJECTS = misc/doscalls.o misc/error.o 
+
+FILE_OBJECTS = file/openclose.o
+
+RUN_OBJECTS = run/process.o
+
+DEVICES_OBJECTS = devices/devices.o
 
-DOSCALLS_OTHER_O = file/openclose.o run/process.o devices/devices.o
+OTHER_OBJECTS =
 
-#SYNC_OBJECTS =
+SYNC_OBJECTS =
 
-TARGET_OBJECTS = $(DOSCALLS_OTHER_O) $(DOSCALLS_MISC_OBJECTS)
+TARGET_OBJECTS = $(FILE_OBJECTS) $(RUN_OBJECTS) $(DEVICES_OBJECTS) \
+                $(MISC_OBJECTS) $(OTHER_OBJECTS) $(SYNC_OBJECTS)
 
+#TARGET_CLEAN = file/*.o vio/*.o sync/*.o mem/*.o \
+#              misc/*.o mou/*.o kbd/*.o run/*.o \
+#              doscalls.dll temp.exp
 
 include $(PATH_TO_TOP)/rules.mak
 
diff --git a/os2/lib/doscalls/misc/.cvsignore b/os2/lib/doscalls/misc/.cvsignore
new file mode 100644 (file)
index 0000000..5761abc
--- /dev/null
@@ -0,0 +1 @@
+*.o
index 4f9c1a4..7f77be8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: error.cpp,v 1.2 2002/09/04 22:19:47 robertk Exp $
+/* $Id: error.cpp,v 1.3 2003/01/07 16:23:11 robd Exp $
 */
 /*
  *
@@ -119,7 +119,7 @@ APIRET STDCALL DosBeep(ULONG freq, ULONG dur)
 
       0         NO_ERROR 
       87        ERROR_INVALID_PARAMETER 
-/*******************************************/
+*******************************************/
 APIRET DosError( ULONG error)
 {
        return ERROR_CALL_NOT_IMPLEMENTED;
@@ -162,11 +162,4 @@ APIRET DosMove(PSZ pszOld, PSZ pszNew)
        return ERROR_CALL_NOT_IMPLEMENTED;
 }
 
-
-
-
-
-
 /* EOF */
diff --git a/os2/lib/doscalls/run/.cvsignore b/os2/lib/doscalls/run/.cvsignore
new file mode 100644 (file)
index 0000000..5761abc
--- /dev/null
@@ -0,0 +1 @@
+*.o
index 4805c10..4d26e37 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: process.cpp,v 1.5 2002/09/04 22:19:47 robertk Exp $
+/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $
 */
 /*
  *
@@ -15,6 +15,7 @@
  */
 
 
+//#if defined (INCL_DOS)
 #define INCL_DOSPROCESS
 #define INCL_DOSERRORS
 #include "ros2.h"
@@ -30,7 +31,7 @@ APIRET STDCALL DosSleep(ULONG msec)
 }
 
 
-/* $Id: process.cpp,v 1.5 2002/09/04 22:19:47 robertk Exp $ */
+/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $ */
 /* 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
new file mode 100644 (file)
index 0000000..0ec02ac
--- /dev/null
@@ -0,0 +1,3 @@
+*.exe
+*.o
+*.sym
index 87a600d..678c29b 100644 (file)
@@ -1,9 +1,11 @@
-# $Id: makefile,v 1.1 2002/03/23 19:23:28 robertk Exp $
+# $Id: makefile,v 1.2 2003/01/07 16:23:12 robd Exp $
 
-PATH_TO_TOP = ../../..
+PATH_TO_TOP = ../../../reactos
 
 TARGET_TYPE = program
 
+TARGET_NORC = yes
+
 TARGET_APPTYPE = native
 
 TARGET_NAME = os2ss
@@ -12,15 +14,18 @@ TARGET_INSTALLDIR = system32
 
 TARGET_CFLAGS = -D__NTAPP__
 
-#OBJECTS_API = 
+TARGET_SDKLIBS = ntdll.a kernel32.a csrss.a
+
+TARGET_GCCLIBS = stdc++
+
+OBJECTS_API = 
 
 OBJECTS_MISC = \
   $(TARGET_NAME).o 
 
 TARGET_OBJECTS = \
-  $(OBJECTS_API) 
-#  \
-#  $(OBJECTS_MISC)
+  $(OBJECTS_API) \
+  $(OBJECTS_MISC)
 
 include $(PATH_TO_TOP)/rules.mak
 
index 2ab2050..8ece4bb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: os2ss.cpp,v 1.1 2002/03/23 19:23:28 robertk Exp $
+/* $Id: os2ss.cpp,v 1.2 2003/01/07 16:23:12 robd Exp $
  *
  * reactos/subsys/csrss/api/process.c
  *
 
 #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 */
 
@@ -46,70 +87,71 @@ void NtProcessStartup (PPEB Peb)
 
    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[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]);
+        argc++;
+        ArgBuffer[i] = L'\0';
+        argv[argc-1] = &(ArgBuffer[afterlastspace]);
      }
    
    RtlInitUnicodeString(&UnicodeString,
-                       L"\\CsrssInitDone");
+                        L"\\CsrssInitDone");
    InitializeObjectAttributes(&ObjectAttributes,
-                             &UnicodeString,
-                             EVENT_ALL_ACCESS,
-                             0,
-                             NULL);
+                              &UnicodeString,
+                              EVENT_ALL_ACCESS,
+                              0,
+                              NULL);
    Status = NtOpenEvent(&CsrssInitEvent,
-                       EVENT_ALL_ACCESS,
-                       &ObjectAttributes);
+                        EVENT_ALL_ACCESS,
+                        &ObjectAttributes);
    if (!NT_SUCCESS(Status))
      {
-       DbgPrint("CSR: Failed to open csrss notification event\n");
+        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 );
+        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 );
-}
\ No newline at end of file
+        DisplayString( L"CSR: Subsystem initialization failed.\n" );
+
+        RtlFreeHeap (Peb->ProcessHeap,
+                     0, argv);
+        RtlFreeHeap (Peb->ProcessHeap,
+                     0,
+                     ArgBuffer);
+
+        /*
+         * Tell SM we failed.
+         */
+        NtTerminateProcess( NtCurrentProcess(), 0 );
+   }
+}