--- /dev/null
+*.exe
+*.o
+*.sym
-# $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
#define INCL_DOSPROCESS
#include "../../include/os2.h"
+//#include "../../include/ros2.h"
void Eingang()
{
a= b+3;
b=a+3;
Eingang();
-}
\ No newline at end of file
+}
#ifndef _OS2EMX_H
#define _OS2EMX_H
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#pragma pack(1)
/* ------------------------ INCL_ SYMBOLS --------------------------------- */
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,
#pragma pack(4)
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* not _OS2EMX_H */
/* Note 1:
* indent-tabs-mode: t
* end:
*/
+
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>
}
#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__ */
--- /dev/null
+*.exe
+*.o
+*.sym
+*.dll
+*.coff
-/* $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 $
*/
/*
*
return ERROR_CALL_NOT_IMPLEMENTED;
}
-
-
-/* EOF */
\ No newline at end of file
+/* EOF */
-; $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.
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
-; $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.
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
-/* $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 $
*/
/*
*
#include "ros2.h"
-
APIRET STDCALL Dos32Open(PSZ pszFileName, PHFILE pHf,
PULONG pulAction, ULONG cbFile,
ULONG ulAttribute, ULONG fsOpenFlags,
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;
}
*pcbActual = isbStatus.Information;
switch(nErrCode)
{
+/*
case STATUS_INVALID_HANDLE:
return ERROR_INVALID_HANDLE;
// FIXME: complete this
+ */
}
return NO_ERROR;
}
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;
}
-# $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
TARGET_CPPFLAGS =\
-Wall \
-I$(PATH_TO_OS2_TOP)/include \
- -D__DOSCALLSDLL__
+ -D__DOSCALLSDLL__
# removed CFLAGX
# -fno-builtin \
# -nostdinc \
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
-/* $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 $
*/
/*
*
0 NO_ERROR
87 ERROR_INVALID_PARAMETER
-/*******************************************/
+*******************************************/
APIRET DosError( ULONG error)
{
return ERROR_CALL_NOT_IMPLEMENTED;
return ERROR_CALL_NOT_IMPLEMENTED;
}
-
-
-
-
-
-
-
/* EOF */
-/* $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 $
*/
/*
*
*/
+//#if defined (INCL_DOS)
#define INCL_DOSPROCESS
#define INCL_DOSERRORS
#include "ros2.h"
}
-/* $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 */
--- /dev/null
+*.exe
+*.o
+*.sym
-# $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
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
-/* $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 */
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 );
+ }
+}