diff --git a/os2/lib/doscalls/devices/devices.cpp b/os2/lib/doscalls/devices/devices.cpp index 22153306552..6ea1555e4e3 100644 --- a/os2/lib/doscalls/devices/devices.cpp +++ b/os2/lib/doscalls/devices/devices.cpp @@ -1,15 +1,18 @@ -/* $Id: devices.cpp,v 1.2 2002/07/26 00:23:12 robertk Exp $ +/* $Id: devices.cpp,v 1.3 2002/09/04 22:19:47 robertk Exp $ */ /* * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS OS/2 sub system - * FILE: devices.c + * PART: doscalls.dll + * FILE: devices.cpp + * CONTAINS: device io ctl main function. * PURPOSE: Kernelservices for OS/2 apps * PROGRAMMER: Robert K. nonvolatil@yahoo.de * REVISION HISTORY: - * 13-03-2002 Created + * 13-03-2002 Created * 25-07-2002 Work to make it compile + * 10-11-2002 Done som little things */ #define INCL_DOSDEVICES @@ -58,3 +61,7 @@ APIRET STDCALL Dos32DevIOCtl(HFILE hDevice, ULONG category, ULONG function, { return ERROR_CALL_NOT_IMPLEMENTED; } + + + +/* EOF */ \ No newline at end of file diff --git a/os2/lib/doscalls/devices/ioctl_async.cpp b/os2/lib/doscalls/devices/ioctl_async.cpp new file mode 100644 index 00000000000..7e8e4bc51be --- /dev/null +++ b/os2/lib/doscalls/devices/ioctl_async.cpp @@ -0,0 +1,100 @@ +/* $Id: ioctl_async.cpp,v 1.1 2002/09/04 22:19:47 robertk Exp $ +*/ +/* + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS OS/2 sub system + * PART: doscalls.dll + * FILE: ipctl_async.cpp + * PURPOSE: This file is to be directly included into devices.cpp + * CONTAINS: implementation of the category 1 (async I/O) + * ioctl functioncodes. + * PROGRAMMER: Robert K. nonvolatil@yahoo.de + * REVISION HISTORY: + * 10-11-2002 Created + */ + + +/* This function implements the async ioctls. It + is called from the real DosIOCtl function. This + function implies that it is only called, if the + cathegory was 0x01. + All other parameters are the same as DosIoCtl. +*/ +void EvaluateAsyncIoCtl( HFILE hDevice, ULONG function, + PVOID pParams, ULONG cbParmLenMax, PULONG pcbParmLen, + PVOID pData, ULONG cbDataLenMax, PULONG pcbDataLen) +{ + switch( function ) + { + case 0x41: //ASYNC_SETBAUDRATE + //+------------------------------------+ + //|Field Length C Datatype | + //|------------------------------------| + //|Bit Rate WORD USHORT | + //+------------------------------------+ + break; + + case 0x42: // Set Line Characteristics (stop, parity, data bits) + break; +/** +pppp +|----------+--------------------------------------------------| +| 43h |Extended Set Bit Rate | +|----------+--------------------------------------------------| +| 44h |Transmit Byte Immediate | +|----------+--------------------------------------------------| +| 45h |Set Break OFF | +|----------+--------------------------------------------------| +| 46h |Set Modem Control Signals | +|----------+--------------------------------------------------| +| 47h |Behave as if XOFF Received (stop transmit) | +|----------+--------------------------------------------------| +| 48h |Behave as if XON Received (start transmit) | +|----------+--------------------------------------------------| +| 49h |Reserved | +|----------+--------------------------------------------------| +| 4Bh |Set Break ON | +|----------+--------------------------------------------------| +| 53h |Set Device Control Block (DCB) Parameters | +|----------+--------------------------------------------------| +| 54h |Set Enhanced Mode Parameters | +|----------+--------------------------------------------------| +| 61h |Query Current Bit Rate | +|----------+--------------------------------------------------| +| 62h |Query Line Characteristics | +|----------+--------------------------------------------------| +| 63h |Extended Query Bit Rate | +|----------+--------------------------------------------------| +| 64h |Query COM Status | +|----------+--------------------------------------------------| +| 65h |Query Transmit Data Status | +|----------+--------------------------------------------------| +| 66h |Query Modem Control Output Signals | +|----------+--------------------------------------------------| +| 67h |Query Current Modem Input Signals | +|----------+--------------------------------------------------| +| 68h |Query Number of Characters in Receive Queue | +|----------+--------------------------------------------------| +| 69h |Query Number of Characters in Transmit Queue | +|----------+--------------------------------------------------| +| 6Dh |Query COM Error | +|----------+--------------------------------------------------| +| 72h |Query COM Event Information | +|----------+--------------------------------------------------| +| 73h |Query Device Control Block (DCB) Parameters | +|----------+--------------------------------------------------| +| 74h |Query Enhanced Mode Parameters | ++-------------------------------------------------------------+ +pppp */ + + + } +} + + + + + + +/* EOF */ \ No newline at end of file diff --git a/os2/lib/doscalls/doscalls.def b/os2/lib/doscalls/doscalls.def index 5992ad95408..ff99b249225 100644 --- a/os2/lib/doscalls/doscalls.def +++ b/os2/lib/doscalls/doscalls.def @@ -1,4 +1,4 @@ -; $Id: doscalls.def,v 1.3 2002/03/24 18:55:38 ea Exp $ +; $Id: doscalls.def,v 1.4 2002/09/04 22:19:47 robertk 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@4 @229 -Dos32Close@4 @257 -Dos32Open@32 @273 -Dos32Read@16 @281 -Dos32Write@16 @282 -Dos32DevIOCtl@36 @284 -Dos32Beep@8 @286 -Dos32Exit@8 @234 -Dos32CreateThread@20 @311 +DosSleep@4 +DosClose@4 +DosOpen@32 +DosRead@16 +DosWrite@16 +DosDevIOCtl@36 +DosBeep@8 +DosExit@8 +DosCreateThread@20 ; EOF diff --git a/os2/lib/doscalls/doscalls.def.bak b/os2/lib/doscalls/doscalls.def.bak new file mode 100644 index 00000000000..879c26b1def --- /dev/null +++ b/os2/lib/doscalls/doscalls.def.bak @@ -0,0 +1,23 @@ +; $Id: doscalls.def.bak,v 1.1 2002/09/04 22:19:47 robertk Exp $ +; +; Def for doscalls.dll - part of the OS/2-sub system +; for ReactOS. Provides Access to OS/2 kernel services. + +LIBRARY doscalls.dll + +DESCRIPTION "Part of the ReactOS OS/2 sub system, provides base kernel services to OS/2-apps" + +EXPORTS +; FIXME: fill in all exports + +Dos32Sleep@4 @229 +Dos32Close@4 @257 +Dos32Open@32 @273 +Dos32Read@16 @281 +Dos32Write@16 @282 +Dos32DevIOCtl@36 @284 +Dos32Beep@8 @286 +Dos32Exit@8 @234 +Dos32CreateThread@20 @311 + +; EOF diff --git a/os2/lib/doscalls/file/directory.cpp b/os2/lib/doscalls/file/directory.cpp new file mode 100644 index 00000000000..b6b5d38a917 --- /dev/null +++ b/os2/lib/doscalls/file/directory.cpp @@ -0,0 +1,179 @@ +/* $Id: directory.cpp,v 1.1 2002/09/04 22:19:47 robertk Exp $ +*/ +/* + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS OS/2 sub system + * PART: doscalls.dll + * FILE: directory.cpp + * PURPOSE: Kernelservices for OS/2 apps + * CONTAINS: Directory related CP-functions. + * PROGRAMMER: Robert K. nonvolatil@yahoo.de + * REVISION HISTORY: + * 10-11-2002 Created + */ + + +#define INCL_DOSFILEMGR +#define INCL_DOSERRORS +#include "ros2.h" + + + + +/****************************************** + DosDelete removes a file name from a + directory. The deleted file may be + recoverable. + + pszFile (PSZ) - input + Address of the name of the file to be deleted. + + ulrc (APIRET) - returns + Return Code. + + DosDelete returns one of the following values: + 0 NO_ERROR + 2 ERROR_FILE_NOT_FOUND + 3 ERROR_PATH_NOT_FOUND + 5 ERROR_ACCESS_DENIED + 26 ERROR_NOT_DOS_DISK + 32 ERROR_SHARING_VIOLATION + 36 ERROR_SHARING_BUFFER_EXCEEDED + 87 ERROR_INVALID_PARAMETER + 206 ERROR_FILENAME_EXCED_RANGE +*******************************************/ +APIRET DosDelete(PSZ pszFile) +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/****************************************** + DosDeleteDir removes a subdirectory + from the specified disk. + + pszDir (PSZ) - input + Address of the fully qualified path name of the subdirectory to be removed. + + ulrc (APIRET) - returns + Return Code. + + DosDeleteDir returns one of the following values: + + 0 NO_ERROR + 2 ERROR_FILE_NOT_FOUND + 3 ERROR_PATH_NOT_FOUND + 5 ERROR_ACCESS_DENIED + 16 ERROR_CURRENT_DIRECTORY + 26 ERROR_NOT_DOS_DISK + 87 ERROR_INVALID_PARAMETER + 108 ERROR_DRIVE_LOCKED + 206 ERROR_FILENAME_EXCED_RANGE +******************************************/ +APIRET DosDeleteDir(PSZ pszDir) +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + + + + +/******************************************* + DosCopy copies the source file or + subdirectory to the destination file or + subdirectory. + + pszOld (PSZ) - input + Address of the ASCIIZ path name of the source file, + subdirectory, or character device. + + Global file-name characters are not allowed. + + pszNew (PSZ) - input + Address of the ASCIIZ path name of the target file, + subdirectory, or character device. + + Global file-name characters are not allowed. + + option (ULONG) - input + ULONG bit flags that define how the DosCopy + function is done. + + + Bit Description + + 31-3 Reserved. These bits must be set to + zero. + + 2 DCPY_FAILEAS (0x00000004) + Discard the EAs if the source file + contains EAs and the destination file + system does not support EAs. + + 0 Discard the EAs (extended attributes) if + the destination file system does not + support EAs. + + 1 Fail the copy if the destination file + system does not support EAs. + + 1 DCPY_APPEND (x00000002) + Append the source file to the target + file's end of data. + + 0 Replace the target file with the source + file. + 1 Append the source file to the target file's + end of data. + + This is ignored when copying a + directory, or if the target file does not + exist. + + 0 DCPY_EXISTING (0x00000001) + Existing Target File Disposition. + + 0 Do not copy the source file to the target + if the file name already exists within the + target directory. If a single file is being + copied and the target already exists, an + error is returned. + + 1 Copy the source file to the target even if + the file name already exists within the + target directory. + + Bit flag DCPY_FAILEAS can be used in + combination with bit flag DCPY_APPEND or + DCPY_EXISTING. + + ulrc (APIRET) - returns + Return Code. + + DosCopy returns one of the following values: + + 0 NO_ERROR + 2 ERROR_FILE_NOT_FOUND + 3 ERROR_PATH_NOT_FOUND + 5 ERROR_ACCESS_DENIED + 26 ERROR_NOT_DOS_DISK + 32 ERROR_SHARING_VIOLATION + 36 ERROR_SHARING_BUFFER_EXCEEDED + 87 ERROR_INVALID_PARAMETER + 108 ERROR_DRIVE_LOCKED + 112 ERROR_DISK_FULL + 206 ERROR_FILENAME_EXCED_RANGE + 267 ERROR_DIRECTORY + 282 ERROR_EAS_NOT_SUPPORTED + 283 ERROR_NEED_EAS_FOUND +*******************************************/ +APIRET DosCopy(PSZ pszOld,PSZ pszNew, ULONG option) +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + + + + +/* EOF */ diff --git a/os2/lib/doscalls/file/openclose.cpp b/os2/lib/doscalls/file/openclose.cpp index 7b0434d864f..a01eaa4ecdc 100644 --- a/os2/lib/doscalls/file/openclose.cpp +++ b/os2/lib/doscalls/file/openclose.cpp @@ -1,11 +1,13 @@ -/* $Id: openclose.cpp,v 1.2 2002/07/26 00:23:12 robertk Exp $ +/* $Id: openclose.cpp,v 1.3 2002/09/04 22:19:47 robertk Exp $ */ /* * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS OS/2 sub system - * FILE: dll/doscalls.c + * PART: doscalls.dll + * FILE: openclose.cpp * PURPOSE: Kernelservices for OS/2 apps + * CONTAINS: Open close write and handle related stuff. * PROGRAMMER: Robert K. nonvolatil@yahoo.de * REVISION HISTORY: * 13-03-2002 Created diff --git a/os2/lib/doscalls/makefile b/os2/lib/doscalls/makefile index 57314541896..9eea31ff240 100644 --- a/os2/lib/doscalls/makefile +++ b/os2/lib/doscalls/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.4 2002/07/26 00:23:12 robertk Exp $ +# $Id: makefile,v 1.5 2002/09/04 22:19:47 robertk Exp $ PATH_TO_TOP = ../../../reactos @@ -6,7 +6,7 @@ PATH_TO_OS2_TOP = ../.. TARGET_TYPE = dynlink -# TARGET_DEFONLY = yes +#TARGET_DEFONLY = yes TARGET_NAME = doscalls @@ -30,7 +30,8 @@ TARGET_SDKLIBS = ntdll.a TARGET_OBJECTS = $(TARGET_NAME).o TARGET_CLEAN = file/*.o vio/*.o sync/*.o mem/*.o \ - misc/*.o mou/*.o kbd/*.o run/*.o + misc/*.o mou/*.o kbd/*.o run/*.o \ + doscalls.dll temp.exp DOSCALLS_MISC_OBJECTS = misc/doscalls.o misc/error.o diff --git a/os2/lib/doscalls/misc/error.cpp b/os2/lib/doscalls/misc/error.cpp index 7c70246e404..4f9c1a4b808 100644 --- a/os2/lib/doscalls/misc/error.cpp +++ b/os2/lib/doscalls/misc/error.cpp @@ -1,10 +1,12 @@ -/* $Id: error.cpp,v 1.1 2002/07/26 00:23:13 robertk Exp $ +/* $Id: error.cpp,v 1.2 2002/09/04 22:19:47 robertk Exp $ */ /* * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS OS/2 sub system - * FILE: dll/process.cpp + * PART: doscalls.dll + * FILE: error.cpp + * CONTAINS: Error related CP-functions. * PURPOSE: Kernelservices for OS/2 apps * PROGRAMMER: Robert K. nonvolatil@yahoo.de * REVISION HISTORY: @@ -22,7 +24,25 @@ namespace NT { } +/******************************************* + DosBeep generates sound from the + speaker. + freq (ULONG) - input + Cycles per second (Hertz) in the range of 0x25 to + 0x7FFF. + + dur (ULONG) - input + The length of the sound in milliseconds. + + ulrc (APIRET) - returns + Return Code. + + DosBeep returns one of the following values: + + 0 NO_ERROR + 395 ERROR_INVALID_FREQUENCY +*******************************************/ APIRET STDCALL DosBeep(ULONG freq, ULONG dur) { NT::BEEP_SET_PARAMETERS BeepSetParameters; @@ -33,7 +53,7 @@ APIRET STDCALL DosBeep(ULONG freq, ULONG dur) NT::OBJECT_ATTRIBUTES oa = {sizeof oa, 0, &unistr, NT::OBJ_CASE_INSENSITIVE, 0, 0}; // init String still bevore use. - NT::RtlInitUnicodeString( &unistr, L"\\\\.\\Beep" ); + NT::RtlInitUnicodeString( &unistr, (NT::PWSTR)L"\\\\.\\Beep" ); if( freq<0x25 || freq>0x7FFF ) return ERROR_INVALID_FREQUENCY; //395; // @@ -50,7 +70,7 @@ APIRET STDCALL DosBeep(ULONG freq, ULONG dur) 0, // no sharing FILE_OPEN ); - if (!NT_SUCCESS(stat)) + if ( stat<0 ) { return ERROR_NOT_READY; } @@ -70,4 +90,83 @@ APIRET STDCALL DosBeep(ULONG freq, ULONG dur) } +/****************************************** + DosError disables or enables error + notification to end users. + + error (ULONG) - input + Error and Exception pop-up flags. + + The unused high-order bits are reserved, and must be zero. The following values can be specified + for this parameter. They can be combined using the "logical or" ( | ) operator. + + FERR_DISABLEHARDERR (0x00000000) + Disable hard error pop-ups. + + FERR_ENABLEHARDERR (0x00000001) + Enable hard error pop-ups. + + FERR_ENABLEEXCEPTION (0x00000000) + Enable program exception and untrapped numeric-processor exception pop-ups. + + FERR_DISABLEEXCEPTION (0x00000002) + Disable program exception and untrapped numeric-processor exception pop-ups. + + ulrc (APIRET) - returns + Return Code. + + DosError returns one of the following values: + + 0 NO_ERROR + 87 ERROR_INVALID_PARAMETER +/*******************************************/ +APIRET DosError( ULONG error) +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/******************************************* + DosMove moves a file object to another + location, and changes its name. + + pszOld (PSZ) - input + Address of the old path name of the file or + subdirectory to be moved. + + pszNew (PSZ) - input + Address of the new path name of the file or + subdirectory. + + ulrc (APIRET) - returns + Return Code. + + DosMove returns the one of following values: + + 0 NO_ERROR + 2 ERROR_FILE_NOT_FOUND + 3 ERROR_PATH_NOT_FOUND + 5 ERROR_ACCESS_DENIED + 17 ERROR_NOT_SAME_DEVICE + 26 ERROR_NOT_DOS_DISK + 32 ERROR_SHARING_VIOLATION + 36 ERROR_SHARING_BUFFER_EXCEEDED + 87 ERROR_INVALID_PARAMETER + 108 ERROR_DRIVE_LOCKED + 206 ERROR_FILENAME_EXCED_RANGE + 250 ERROR_CIRCULARITY_REQUESTED + 251 ERROR_DIRECTORY_IN_CDS +*******************************************/ +APIRET DosMove(PSZ pszOld, PSZ pszNew) +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + + + + + + + + /* EOF */ diff --git a/os2/lib/doscalls/run/process.cpp b/os2/lib/doscalls/run/process.cpp index 576443c4151..4805c108c64 100644 --- a/os2/lib/doscalls/run/process.cpp +++ b/os2/lib/doscalls/run/process.cpp @@ -1,10 +1,12 @@ -/* $Id: process.cpp,v 1.4 2002/07/26 00:23:13 robertk Exp $ +/* $Id: process.cpp,v 1.5 2002/09/04 22:19:47 robertk Exp $ */ /* * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS OS/2 sub system - * FILE: dll/process.cpp + * PART: doscalls.dll + * FILE: process.cpp + * CONTAINS: process and thread related CP-functions. * PURPOSE: Kernelservices for OS/2 apps * PROGRAMMER: Robert K. nonvolatil@yahoo.de * REVISION HISTORY: @@ -28,7 +30,7 @@ APIRET STDCALL DosSleep(ULONG msec) } -/* $Id: process.cpp,v 1.4 2002/07/26 00:23:13 robertk Exp $ */ +/* $Id: process.cpp,v 1.5 2002/09/04 22:19:47 robertk Exp $ */ /* Terminates the current thread or the current Process. Decission is made by action FIXME: move this code to OS2.EXE */