initial comit
authorRobert Kopferl <robertk@mok.lvcm.com>
Sat, 23 Mar 2002 19:23:28 +0000 (19:23 +0000)
committerRobert Kopferl <robertk@mok.lvcm.com>
Sat, 23 Mar 2002 19:23:28 +0000 (19:23 +0000)
svn path=/trunk/; revision=2773

16 files changed:
os2/apps/bepslep/Makefile [new file with mode: 0644]
os2/apps/bepslep/bepslep.c [new file with mode: 0644]
os2/lib/doscalls/doscalls.def [new file with mode: 0644]
os2/lib/doscalls/doscalls.rc [new file with mode: 0644]
os2/lib/doscalls/implemented_functions_info.txt [new file with mode: 0644]
os2/lib/doscalls/makefile [new file with mode: 0644]
os2/lib/doscalls/misc/doscalls.c [new file with mode: 0644]
os2/lib/doscalls/misc/doscalls.h [new file with mode: 0644]
os2/lib/doscalls/misc/errorcodes.c [new file with mode: 0644]
os2/lib/doscalls/misc/os2def.h [new file with mode: 0644]
os2/lib/doscalls/run/process.cpp [new file with mode: 0644]
os2/server/makefile [new file with mode: 0644]
os2/server/os2ss.cpp [new file with mode: 0644]
os2/utils/EXE386.H [new file with mode: 0644]
os2/utils/LXDUMP.EXE [new file with mode: 0644]
os2/utils/lxtest.EXE [new file with mode: 0644]

diff --git a/os2/apps/bepslep/Makefile b/os2/apps/bepslep/Makefile
new file mode 100644 (file)
index 0000000..61e676c
--- /dev/null
@@ -0,0 +1,32 @@
+# $Id: Makefile,v 1.1 2002/03/23 19:23:27 robertk 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=../..
+
+TARGET_NAME=bepslep
+
+CFLAGS=-D__SUBSYSTEM_WINDOWS__
+
+OBJECTS=$(TARGET_NAME).o
+
+LIBRARIES=\
+       $(PATH_TO_OS2_TOP)/dll/doscalls.dll 
+
+$(TARGET_NAME): $(OBJECTS) $(LIBRARIES)
+       $(CC) \
+               $(CFLAGS) \
+               $(OBJECTS) \
+               $(LIBRARIES)\
+               -o $@ \
+               -Wl,--subsystem,windows\
+               -nostartfiles \
+               -nostdlib
+
+include $(PATH_TO_TOP)/rules.mak
+
+# EOF
diff --git a/os2/apps/bepslep/bepslep.c b/os2/apps/bepslep/bepslep.c
new file mode 100644 (file)
index 0000000..08e6aad
--- /dev/null
@@ -0,0 +1,19 @@
+
+
+#include "../../dll/doscalls/doscalls.h"
+
+void Eingang()
+{
+       DosBeep(3000,300);
+       DosSleep(1000);
+       DosBeep(4000,200);
+       DosExit(0,0);
+}
+
+void WinMainCRTStartup()
+{
+       int a, b;
+       a= b+3;
+       b=a+3;
+       Eingang();
+}
\ No newline at end of file
diff --git a/os2/lib/doscalls/doscalls.def b/os2/lib/doscalls/doscalls.def
new file mode 100644 (file)
index 0000000..27e45b6
--- /dev/null
@@ -0,0 +1,20 @@
+; 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=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
+
diff --git a/os2/lib/doscalls/doscalls.rc b/os2/lib/doscalls/doscalls.rc
new file mode 100644 (file)
index 0000000..c4ff7f0
--- /dev/null
@@ -0,0 +1,38 @@
+#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
+
diff --git a/os2/lib/doscalls/implemented_functions_info.txt b/os2/lib/doscalls/implemented_functions_info.txt
new file mode 100644 (file)
index 0000000..91d4c06
--- /dev/null
@@ -0,0 +1,1059 @@
+Creator: robert K.             robertk@mok.lvcm.com
+
+This is a list of all functions of the doscalls.dll from OS/2.
+Since ReactOS is an OS with flat model and since we have no
+ambitions to support 16-Bit OS/2 apps, we'll not implement souch
+functions. Above that, we want to port ReacOS and the OS/2 sub 
+system to other platforms (i.e. the PowerPC ;-D ).
+
+Semantics of this file:
+Functions with nothing behind are not yet implemented/considered.
+Functions with a ??? should be considered later.
+Functions with a --- will not be implemented.
+Functions with a -  xxx are implemented in some file
+in the directory xxx:
+file-  file, pipe io
+sync-  thread synchronisation
+mem    -       memory considerations
+misc-  internal and indifferent stuff
+mou    -       mouse sub system
+kbd    -       keyboard sub system
+vio    -       video/console io
+run    -       processes and threads
+...
+
+
+1 DosICreateThread             ???
+2 Dos16Cwait                   ---
+3 Dos16EnterCritSec            ---
+4 DosIExecPgm                  ???
+5 Dos16Exit                            ---
+6 Dos16ExitCritSec 
+7 Dos16ExitList 
+8 Dos16GetInfoSeg 
+9 Dos16GetPrty 
+10 Dos16KillProcess 
+11 Dos16SetPrty 
+12 Dos16Ptrace 
+13 Dos16HoldSignal 
+14 Dos16SetSigHandler 
+15 Dos16FlagProcess 
+16 Dos16MakePipe 
+17 DosISysSemClear 
+18 DosISemRequest 
+19 DosISysSemSet 
+20 Dos16SemSetWait 
+21 DosISemWait 
+22 Dos16MuxSemWait 
+23 Dos16CloseSem 
+24 Dos16CreateSem 
+25 Dos16OpenSem 
+26 Dos16ResumeThread 
+27 Dos16SuspendThread 
+28 Dos16SetDateTime 
+29 Dos16TimerAsync 
+30 Dos16TimerStart 
+31 Dos16TimerStop 
+32 Dos16Sleep 
+33 Dos16GetDateTime 
+34 Dos16AllocSeg 
+35 Dos16AllocShrSeg 
+36 Dos16GetShrSeg 
+37 Dos16GiveSeg 
+38 Dos16ReallocSeg 
+39 Dos16FreeSeg 
+40 Dos16AllocHuge 
+41 Dos16GetHugeShift 
+42 Dos16ReallocHuge 
+43 Dos16CreateCSAlias 
+44 Dos16LoadModule 
+45 Dos16GetProcAddr 
+46 Dos16FreeModule 
+47 Dos16GetModHandle 
+48 Dos16GetModName 
+49 Dos16GetMachineMode 
+50 Dos16Beep 
+51 Dos16CLIAccess 
+52 Dos16DevConfig 
+53 Dos16DevIOCtl 
+54 Dos16SGSwitch 
+55 Dos16SGSwitchMe 
+56 Dos16BufReset 
+57 Dos16ChDir 
+58 Dos16ChgFilePtr 
+59 Dos16Close 
+60 Dos16Delete 
+61 Dos16DupHandle 
+62 Dos16FileLocks 
+63 Dos16FindClose 
+64 Dos16FindFirst 
+65 Dos16FindNext 
+66 Dos16MkDir 
+67 Dos16Move 
+68 Dos16NewSize 
+69 Dos16PortAccess 
+70 Dos16Open 
+71 Dos16QCurDir 
+72 Dos16QCurDisk 
+73 Dos16QFHandState 
+74 Dos16QFileInfo 
+75 Dos16QFileMode 
+76 Dos16QFSInfo 
+77 Dos16QHandType 
+78 Dos16QVerify 
+79 DosIRead 
+80 Dos16RmDir 
+81 Dos16SelectDisk 
+82 Dos16SetFHandState 
+83 Dos16SetFileInfo 
+84 Dos16SetFileMode 
+85 Dos16SetMaxFH 
+86 Dos16SetVerify 
+87 DosIWrite 
+88 Dos16SystemService 
+89 Dos16SetVec 
+90 Dos16SysTrace 
+91 Dos16GetEnv 
+92 Dos16GetVersion 
+93 Dos16QTraceInfo 
+94 Dos16GetPID 
+95 Dos16Open2 
+96 Dos16LibInit 
+97 Dos16SetFSInfo 
+98 Dos16QPathInfo 
+99 Dos16DevIOCtl2 
+100 DosICanonicalize 
+101 Dos16SetFgnd 
+102 Dos16SwapTaskInit 
+103 Dos16ReadPhys 
+104 Dos16SetPathInfo 
+105 Dos16SGSwitchProc2 
+106 STRUCHECK 
+107 STRURESUPDATE 
+108 DosISetRelMaxFH 
+109 DosIDevIOCtl 
+110 Dos32ForceDelete 
+111 Dos32KillThread 
+112 Dos32QueryRASInfo 
+113 Dos32DumpProcess 
+114 Dos32SuppressPopUps 
+115 THK32ALLOCMEM 
+116 THK32FREEMEM 
+117 THK32ALLOCSTACK 
+118 DosOpen2Compt 
+119 Dos16GetSTDA 
+120 Dos16Error 
+121 Dos16GetSeg 
+122 Dos16LockSeg 
+123 Dos16UnlockSeg 
+124 Dos16SGSwitchProc 
+125 DosIRamSemWake 
+126 Dos16SizeSeg 
+127 Dos16MemAvail 
+128 DosIRamSemRequest 
+129 DosPhysicalDisk 
+130 Dos16GetCP 
+131 DosISetCP 
+132 DosGlobalSeg 
+133 Dos16Profile 
+134 Dos16SendSignal 
+135 DosHugeShift 
+136 DosHugeIncr 
+137 Dos16Read 
+138 Dos16Write 
+139 Dos16ErrClass 
+140 Dos16SemRequest 
+141 Dos16SemClear 
+142 Dos16SemWait 
+143 Dos16SemSet 
+144 Dos16ExecPgm 
+145 Dos16CreateThread 
+146 Dos16SubSet 
+147 Dos16SubAlloc 
+148 Dos16SubFree 
+149 Dos16ReadAsync 
+150 Dos16WriteAsync 
+151 Dos16SearchPath 
+152 Dos16ScanEnv 
+153 Dos16SetCP 
+154 Dos16QProcStatus 
+155 Dos16GetResource 
+156 Dos16GetPPID 
+157 Dos16CallBack 
+158 DosICallBack 
+159 DosRetForward 
+160 Dos16R2StackRealloc 
+161 Dos16FSRamSemRequest 
+162 Dos16FSRamSemClear 
+163 Dos16QAppType 
+164 Dos16SetProcCP 
+165 Dos16DynamicTrace 
+166 Dos16QSysInfo 
+167 DosIMakeNmPipe 
+168 DosICallNmPipe 
+169 DosIConnectNmPipe 
+170 DosIDisconnectNmPipe 
+171 DosIPeekNmPipe 
+172 DosIQNmPipeInfo 
+173 DosIQNmPHandState 
+174 DosISetNmPHandState 
+175 DosITransactNmPipe 
+176 DosIWaitNmPipe 
+177 DosISetNmPipeSem 
+178 DosIQNmPipeSemState 
+179 DosIRawReadNmPipe 
+180 DosIRawWriteNmPipe 
+181 Dos16FSAttach 
+182 Dos16QFSAttach 
+183 Dos16FSCtl 
+184 Dos16FindFirst2 
+185 Dos16MkDir2 
+186 Dos16FileIO 
+187 Dos16FindNotifyClose 
+188 Dos16FindNotifyFirst 
+189 Dos16FindNotifyNext 
+190 Dos16SetTraceInfo 
+191 Dos16EditName 
+192 Dos16LogMode 
+193 Dos16LogEntry 
+194 Dos16GetLogBuffer 
+195 Dos16LogRegister 
+196 Dos16LogRead 
+197 Dos16FindFromName 
+198 Dos16OPLockRelease 
+199 Dos16OPLockWait 
+200 DosICopy 
+201 Dos16Copy 
+202 DosIQAppType 
+203 DosForceDelete 
+204 DosEnumAttribute 
+205 Dos16OPLockShutdown 
+206 DosShutdown 
+207 DosGetResource2 
+208 DosFreeResource 
+209 Dos32SetMaxFH 
+210 Dos32SetVerify 
+211 Dos32ErrClass 
+212 Dos32Error 
+213 DosCreateVDM 
+214 DosMaxPathLen 
+215 DosPageSize 
+216 DosLocalInfo 
+217 DosGlobalInfo 
+218 Dos32SetFileInfo 
+219 Dos32SetPathInfo 
+220 Dos32SetDefaultDisk 
+221 Dos32SetFHState 
+222 Dos32SetFSInfo 
+223 Dos32QueryPathInfo 
+224 Dos32QueryHType 
+225 Dos32QueryVerify 
+226 Dos32DeleteDir 
+227 Dos32ScanEnv 
+228 Dos32SearchPath 
+229 Dos32Sleep 
+230 Dos32GetDateTime 
+231 Dos32DevConfig 
+232 Dos32EnterCritSec 
+233 Dos32ExitCritSec 
+234 Dos32Exit                  run
+235 Dos32KillProcess 
+236 Dos32SetPriority 
+237 Dos32ResumeThread 
+238 Dos32SuspendThread 
+239 Dos32CreatePipe 
+240 Dos32CallNPipe 
+241 Dos32ConnectNPipe 
+242 Dos32DisConnectNPipe 
+243 Dos32CreateNPipe 
+244 Dos32PeekNPipe 
+245 Dos32QueryNPHState 
+246 Dos32RawReadNPipe 
+247 Dos32RawWriteNPipe 
+248 Dos32QueryNPipeInfo 
+249 Dos32QueryNPipeSemState 
+250 Dos32SetNPHState 
+251 Dos32SetNPipeSem 
+252 Dos32TransactNPipe 
+253 Dos32WaitNPipe 
+254 Dos32ResetBuffer 
+255 Dos32SetCurrentDir 
+256 Dos32SetFilePtr 
+257 Dos32Close 
+258 Dos32Copy 
+259 Dos32Delete 
+260 Dos32DupHandle 
+261 Dos32EditName 
+262 THK32FREESTACK 
+263 Dos32FindClose 
+264 Dos32FindFirst 
+265 Dos32FindNext 
+266 Dos16OpenVDD 
+267 Dos16RequestVDD 
+268 Dos16CloseVDD 
+269 Dos32FSAttach 
+270 Dos32CreateDir 
+271 Dos32Move 
+272 Dos32SetFileSize 
+273 Dos32Open 
+274 Dos32QueryCurrentDir 
+275 Dos32QueryCurrentDisk 
+276 Dos32QueryFHState 
+277 Dos32QueryFSAttach 
+278 Dos32QueryFSInfo 
+279 Dos32QueryFileInfo 
+280 Dos32WaitChild 
+281 Dos32Read 
+282 Dos32Write 
+283 Dos32ExecPgm 
+284 Dos32DevIOCtl 
+285 Dos32FSCtl 
+286 Dos32Beep 
+287 Dos32PhysicalDisk 
+288 Dos32SetCp 
+289 Dos32SetProcessCp 
+290 Dos32StopTimer 
+291 Dos32QueryCp 
+292 Dos32SetDateTime 
+293 Thk32AllocBlock 
+294 Thk32FreeBlock 
+295 Thk32R3DS 
+296 Dos32ExitList 
+297 Dos32AllocProtectedMem 
+298 Dos32AliasMem 
+299 Dos32AllocMem 
+300 Dos32AllocSharedMem 
+301 Dos32GetNamedSharedMem 
+302 Dos32GetSharedMem 
+303 Dos32GiveSharedMem 
+304 Dos32FreeMem 
+305 Dos32SetMem 
+306 Dos32QueryMem 
+307 Dos32QueryMemState 
+308 Dos32OpenVDD 
+309 Dos32RequestVDD 
+310 Dos32CloseVDD 
+311 Dos32CreateThread 
+312 Dos32GetInfoBlocks 
+313 Dos16AllocProtSeg 
+314 Dos16AllocShrProtSeg 
+315 Dos16AllocProtHuge 
+316 Dos32DynamicTrace 
+317 Dos32Debug 
+318 Dos32LoadModule 
+319 Dos32QueryModuleHandle 
+320 Dos32QueryModuleName 
+321 Dos32QueryProcAddr 
+322 Dos32FreeModule 
+323 Dos32QueryAppType 
+324 Dos32CreateEventSem 
+325 Dos32OpenEventSem 
+326 Dos32CloseEventSem 
+327 Dos32ResetEventSem 
+328 Dos32PostEventSem 
+329 Dos32WaitEventSem 
+330 Dos32QueryEventSem 
+331 Dos32CreateMutexSem 
+332 Dos32OpenMutexSem 
+333 Dos32CloseMutexSem 
+334 Dos32RequestMutexSem 
+335 Dos32ReleaseMutexSem 
+336 Dos32QueryMutexSem 
+337 Dos32CreateMuxWaitSem 
+338 Dos32OpenMuxWaitSem 
+339 Dos32CloseMuxWaitSem 
+340 Dos32WaitMuxWaitSem 
+341 Dos32AddMuxWaitSem 
+342 Dos32DeleteMuxWaitSem 
+343 Dos32QueryMuxWaitSem 
+344 Dos32SubSetMem 
+345 Dos32SubAllocMem 
+346 Dos32SubFreeMem 
+347 Dos32SubUnsetMem 
+348 Dos32QuerySysInfo 
+349 Dos32WaitThread 
+350 Dos32AsyncTimer 
+351 Dos32StartTimer 
+352 Dos32GetResource 
+353 Dos32FreeResource 
+354 Dos32SetExceptionHandler 
+355 Dos32UnsetExceptionHandler 
+356 Dos32RaiseException 
+357 Dos32UnwindException 
+358 Dos32QueryPageUsage 
+359 Dos16QueryModFromCS 
+360 Dos32QueryModFromEIP 
+361 DosFPDataArea 
+362 Dos32TmrQueryFreq 
+363 Dos32TmrQueryTime 
+364 Dos32AliasPerfCtrs 
+365 Dos32ConfigPerf 
+366 Dos32DeconPerf 
+367 Dos32RegisterPerfCtrs 
+368 Dos32QuerySysState 
+369 Dos32FlatCS 
+370 Dos32FlatDS 
+371 Dos32QueryABIOSSupport 
+372 Dos32EnumAttribute 
+373 Dos32QueryDosProperty 
+374 Dos32SetDosProperty 
+375 Dos16QueryDosProperty 
+376 Dos16SetDosProperty 
+377 Dos32Profile 
+378 Dos32SetSignalExceptionFocus 
+379 Dos32SendSignalException 
+380 Dos32EnterMustComplete 
+381 Dos32ExitMustComplete 
+382 Dos32SetRelMaxFH 
+383 Dos16PutMessage 
+384 Dos16TrueGetMessage 
+385 Dos16InsMessage 
+386 Dos32InsertMessage 
+387 Dos32PutMessage 
+388 Dos32TrueGetMessage 
+389 DosIQueryMessageCP 
+390 Dos32IQueryMessageCP 
+391 Dos16CaseMap 
+392 Dos16GetCollate 
+393 Dos16GetCtryInfo 
+394 Dos16GetDBCSEv 
+395 Dos32QueryCtryInfo 
+396 Dos32QueryDBCSEnv 
+397 Dos32MapCase 
+398 Dos32QueryCollate 
+399 Dos16MakeNmPipe 
+400 Dos16QNmPipeInfo 
+401 Dos16ConnectNmPipe 
+402 Dos16DisconnectNmPipe 
+403 Dos16QNmPHandState 
+404 Dos16SetNmPHandState 
+405 Dos16PeekNmPipe 
+406 Dos16WaitNmPipe 
+407 Dos16TransactNmPipe 
+408 Dos16CallNmPipe 
+409 Dos16RawReadNmPipe 
+410 Dos16RawWriteNmPipe 
+411 Dos16SetNmPipeSem 
+412 Dos16QNmPipeSemState 
+413 StartLazyWriter 
+414 _QueInst_Data 
+415 Dos32Shutdown 
+416 Dos32ICacheModule 
+417 Dos32ReplaceModule 
+418 Dos32AcknowledgeSignalException 
+419 Dos32TIB 
+420 Dos16TmrQueryFreq 
+421 Dos16TmrQueryTime 
+422 Dos16RegisterPerfCtrs 
+423 Dos16FlatToSel 
+424 Dos16SelToFlat 
+425 Dos32FlatToSel 
+426 Dos32SelToFlat 
+427 DosIODelayCnt 
+428 Dos32SetFileLocks 
+429 Dos32CancelLockRequest 
+430 Dos32GetLocaleModule 
+430 LogOpen 
+431 LogClose 
+432 LogAddEntries 
+433 LogGetEntries 
+434 LogSetState 
+435 LogSetName 
+436 LogQueryState 
+437 Dos16OpenChangeNotify 
+438 Dos16ResetChangeNotify 
+439 Dos16CloseChangeNotify 
+440 Dos32OpenChangeNotify 
+441 Dos32ResetChangeNotify 
+442 Dos32CloseChangeNotify 
+443 Dos16QueryABIOSSupport 
+444 Dos32ForceSystemDump 
+447 Dos32GetProcessorStatus 
+448 Dos32SetProcessorStatus 
+449 Dos16CreateSpinLock 
+450 Dos16AcquireSpinLock 
+451 Dos16ReleaseSpinLock 
+452 Dos16FreeSpinLock 
+453 Dos32TestPSD 
+454 Dos32AllocThreadLocalMemory 
+455 Dos32FreeThreadLocalMemory 
+460 Dos32VerifyPIDTID 
+464 PTDA_LANMAN_SEC 
+465 PTDA_PID 
+466 SAS_SEL 
+467 TCB_OPCOOKIE 
+468 TCB_OPFLAGS 
+469 TCB_NEWFLAGS 
+470 TCB_USER_ID 
+471 TCB_PROC_ID 
+472 TCB_FSHARING 
+473 TCB_SRVATTRIB 
+474 TCB_ALLOWED 
+475 TCB_PRTCB 
+476 TCB_NUMBER 
+477 TCB_THISSFT 
+478 TCB_THISCDS 
+479 TKOPTDA 
+480 PTDA_CRITSEC 
+481 PTDA_HOLDSIGCNT 
+482 PTDA_PPTDAPARENT 
+483 PTDA_PGDATA 
+484 PTDA_HANDLE 
+485 PTDA_MODULE 
+486 PTDA_LDTHANDLE 
+487 PTDA_CODEPAGE_TAG 
+488 PTDA_JFN_LENGTH 
+489 PTDA_JFN_PTABLE 
+490 PTDA_JFN_FLG_PTR 
+491 PTDA_EXTERR_LOCUS 
+492 PTDA_EXTERR 
+493 PTDA_EXTERR_ACTION 
+494 PTDA_EXTERR_CLASS 
+495 PTDA_PPID 
+496 PTDA_PROCTYPE 
+497 PTDA_CURRTCB 
+498 PTDA_CURRTSD 
+499 PTDA_SIGNATURE 
+500 T32EXITLIST 
+501 T32ALLOCPROTECTEDMEM 
+502 T32ALIASMEM 
+503 T32ALLOCMEM 
+504 T32ALLOCSHAREDMEM 
+505 T32GETNAMEDSHAREDMEM 
+506 T32GETSHAREDMEM 
+507 T32GIVESHAREDMEM 
+508 T32FREEMEM 
+509 T32SETMEM 
+510 T32QUERYMEM 
+511 T32QUERYMEMSTATE 
+512 T32OPENVDD 
+513 T32REQUESTVDD 
+514 T32CLOSEVDD 
+515 T32CREATETHREAD 
+516 T32DYNAMICTRACE 
+517 T32DEBUG 
+518 T32QUERYPROCADDR 
+519 T32CREATEEVENTSEM 
+520 T32OPENEVENTSEM 
+521 T32CLOSEEVENTSEM 
+522 T32RESETEVENTSEM 
+523 T32POSTEVENTSEM 
+524 T32WAITEVENTSEM 
+525 T32QUERYEVENTSEM 
+526 T32CREATEMUTEXSEM 
+527 T32OPENMUTEXSEM 
+528 T32CLOSEMUTEXSEM 
+529 T32REQUESTMUTEXSEM 
+530 T32RELEASEMUTEXSEM 
+531 T32QUERYMUTEXSEM 
+532 T32CREATEMUXWAITSEM 
+533 T32OPENMUXWAITSEM 
+534 T32CLOSEMUXWAITSEM 
+535 T32WAITMUXWAITSEM 
+536 T32ADDMUXWAITSEM 
+537 T32DELETEMUXWAITSEM 
+538 T32QUERYMUXWAITSEM 
+539 T32QUERYSYSINFO 
+540 T32WAITTHREAD 
+541 DosIOpenL 
+541 T32GETRESOURCE 
+542 DosIProtectOpenL 
+542 T32FREERESOURCE 
+543 DosISetFileSizeL 
+543 T32EXCEPTIONCALLBACK 
+544 DosIProtectSetFileSizeL 
+544 T32QUERYPAGEUSAGE 
+545 Dos32ExceptionCallBack 
+546 TI32ASYNCTIMER 
+546 THK32STRLEN 
+547 TI32STARTTIMER 
+547 THK_UNITHUNK 
+548 Dos32R3ExceptionDispatcher 
+549 DosLibiDisp 
+550 DosLibiDisp16 
+551 DosLibiDisp32 
+552 DosR3ExitAddr 
+553 Dos32R3ExitAddr 
+554 Dos32IRead 
+555 T32IREAD 
+556 Dos32IWrite 
+557 Dos32CreateSpinLock 
+557 T32IWRITE 
+558 Dos32AcquireSpinLock 
+558 T32TMRQUERYFREQ 
+559 Dos32ReleaseSpinLock 
+559 T32TMRQUERYTIME 
+560 Dos32FreeSpinLock 
+560 T32ALIASPERFCTRS 
+561 Dos32PMR3WaitEventSem 
+561 T32CONFIGUREPERF 
+562 Dos32PMR3PostEventSem 
+562 T32DECONPERF 
+563 Dos32QueryThreadAffinity 
+563 T32REGISTERPERFCTRS 
+564 Dos32SetThreadAffinity 
+564 T32QUERYSYSSTATE 
+565 DosISetFileInfo 
+566 DosISetPathInfo 
+567 DosOpenL 
+567 T32QUERYDOSPROPERTY 
+568 DosSetFilePtrL 
+568 T32SETDOSPROPERTY 
+569 DosIFindNext 
+570 DosSetFileSizeL 
+570 T32PROFILE 
+571 T32QUERYRESOURCESIZE 
+572 Dos32QueryResourceSize 
+573 DosQueryResourceSize 
+574 T32SETSIGNALEXCEPTIONFOCUS 
+574 DosPMSemWait 
+575 T32SENDSIGNALEXCEPTION 
+575 DosPMMuxSemWait 
+576 T32STARTTIMER 
+576 THK16_UNITHUNK 
+577 T32STOPTIMER 
+577 HT16_STARTUP 
+578 T32ASYNCTIMER 
+578 HT16_CLEANUP 
+579 T32INITIALIZEPORTHOLE 
+579 HT32_STARTUP 
+580 Dos32InitializePorthole 
+581 T32QUERYHEADERINFO 
+581 HT32_CLEANUP 
+582 Dos32QueryHeaderInfo 
+583 DosInitializePorthole 
+584 DosQueryHeaderInfo 
+585 T32QUERYPROCTYPE 
+585 _Dos32IMonRead 
+586 Dos32QueryProcType 
+587 DosQueryProcType 
+588 T32IEXITMUSTCOMPLETE 
+588 _Dos32IMonWrite 
+589 DosISigDispatch 
+590 T32ICACHEMODULE 
+590 Dos32PMPostEventSem 
+591 T32DLLTERM 
+591 Dos32PMWaitEventSem 
+592 Dos32DllTermDisp 
+593 T32IRAISEEXCEPTION 
+593 Dos32PMRequestMutexSem 
+594 Dos32IRaiseException 
+595 T32ACKNOWLEDGESIGNALEXC 
+595 Dos32PMWaitMuxWaitSem 
+596 Dos32PM16SemChk 
+597 Dos32IQueryFHState 
+598 Dos32ISetFHState 
+599 Dos32LDTSel 
+600 Dos32R3Frestor 
+601 DosIFindFirst 
+602 T32SETFILELOCKS 
+603 T32CANCELLOCKREQUEST 
+604 T32IMONREAD 
+605 T32IMONWRITE 
+606 DosMonOpen 
+607 DosMonClose 
+608 DosMonRead 
+609 DosMonWrite 
+610 DosMonReg 
+611 T32KILLTHREAD 
+612 TQUERYRASINFO 
+615 Dos32IProtectWrite 
+617 DosIProtectSetFileInfo 
+618 Dos32IProtectSetFileInfo 
+619 Dos32IProtectSetFHState 
+620 Dos32IProtectQueryFHState 
+621 Dos32ProtectSetFilePtr 
+622 Dos16ProtectClose 
+623 Dos16ProtectFileIO 
+624 Dos16ProtectFileLocks 
+625 DosIProtectRead 
+626 DosIProtectWrite 
+627 Dos16ProtectNewSize 
+628 Dos16ProtectOpen 
+629 Dos16ProtectQFHandState 
+630 Dos16ProtectSetFHandState 
+631 Dos16ProtectQFileInfo 
+632 Dos16ProtectSetFileInfo 
+634 Dos16ProtectChgFilePtr 
+635 Dos16ProtectEnumAttribute 
+636 Dos32ProtectEnumAttribute 
+637 Dos32ProtectOpen 
+638 Dos32ProtectClose 
+639 Dos32ProtectSetFileLocks 
+640 Dos32ProtectSetFileSize 
+641 Dos32ProtectRead 
+642 Dos32ProtectWrite 
+643 Dos32ProtectSetFileInfo 
+644 Dos32ProtectSetFHState 
+645 Dos32ProtectQueryFHState 
+646 Dos32ProtectQueryFileInfo 
+647 Dos32IProtectRead 
+649 DosCloseMessageFile 
+650 DosLDRDirtyWorker 
+651 Dos16LDRDirtyWorker 
+652 Dos32IGetInfoBlocks 
+653 T32IGETINFOBLOCKS 
+656 T32GETPROCESSORSTATUS 
+657 T32SETPROCESSORSTATUS 
+658 T32TESTPSD 
+659 T32QUERYTHREADAFFINITY 
+660 T32SETTHREADAFFINITY 
+661 Dos32ReadQueue 
+662 Dos32PurgeQueue 
+663 Dos32CloseQueue 
+664 Dos32QueryQueue 
+665 Dos32PeekQueue 
+666 Dos32WriteQueue 
+667 Dos32OpenQueue 
+668 Dos32CreateQueue 
+669 Dos32StartSession 
+670 Dos32SelectSession 
+671 Dos32SetSession 
+672 Dos32StopSession 
+673 DosRegisterNotification 
+674 Dos16ReadQueue 
+675 Dos16PurgeQueue 
+676 Dos16CloseQueue 
+677 Dos16QueryQueue 
+678 Dos16PeekQueue 
+679 Dos16WriteQueue 
+680 Dos16OpenQueue 
+681 Dos16CreateQueue 
+682 Dos16SMGetmem 
+683 Dos16SMFreemem 
+684 Dos16SMGetSGCB 
+685 Dos16SMInitSGCB 
+686 Dos16SMSGDoPopup 
+687 Dos16SMSwitch 
+688 Dos16SMServeAppReq 
+689 Dos16GetTimes 
+690 Dos16SMSetTitle 
+691 Dos16ScrUnlock 
+692 Dos16SMDoAppReq 
+693 Dos16StopSession 
+694 Dos16SelectSession 
+695 Dos16ScrLock 
+696 Dos16SavRedrawWait 
+697 Dos16SavRedrawUndo 
+698 Dos16SMSGEndPopup 
+699 Dos16SetSession 
+700 Dos16SetMNLockTime 
+701 Dos16ModeUndo 
+702 Dos16StartSession 
+703 Dos16SMGetStatus 
+704 Dos16ModeWait 
+705 Dos16SMTerminate 
+706 Dos16SMGetAppReq 
+707 Dos16SMInitialize 
+708 Dos16SMStart 
+709 Dos16SMParentSwitch 
+710 Dos16SMPause 
+711 Dos16SMHDeinit 
+712 Dos16SMPMPresent 
+713 Dos16SMRegisterDD 
+714 Dos16SMNotifyDD 
+715 Dos16SMNotifyDD2 
+716 Dos16SMOpenDD 
+717 Dos16SMSetSessionType 
+718 OS2BaseInit 
+719 MouGetPtrShape 
+720 MouSetPtrShape 
+721 MouGetNumMickeys 
+722 MouGetThreshold 
+723 MouShellInit 
+724 MouGetScaleFact 
+725 MouFlushQue 
+726 MouGetNumButtons 
+727 MouClose 
+728 MouSetThreshold 
+729 MouSetScaleFact 
+730 MouGetNumQueEl 
+731 MouDeRegister 
+732 MouGetEventMask 
+733 MouSetEventMask 
+734 MouOpen 
+735 MouRemovePtr 
+736 MouGetPtrPos 
+737 MouReadEventQue 
+738 MouSetPtrPos 
+739 MouGetDevStatus 
+740 MouSynch 
+741 MouRegister 
+742 MouSetDevStatus 
+743 MouDrawPtr 
+744 MouInitReal 
+745 KbdSetCustXt 
+746 KbdInit 
+747 KbdGetCp 
+748 KbdCharIn 
+749 KbdSetCp 
+750 KbdLoadInstance 
+751 KbdSynch 
+752 KbdRegister 
+753 KbdStringIn 
+754 KbdGetStatus 
+755 KbdSetStatus 
+756 KbdGetFocus 
+757 KbdFlushBuffer 
+758 KbdXlate 
+759 KbdSwitchFgnd 
+760 KbdShellInit 
+761 KbdClose 
+762 KbdFreeFocus 
+763 KbdFree 
+764 KbdDeRegister 
+765 KbdSetFgnd 
+766 KbdPeek 
+767 KbdOpen 
+768 KbdGetHWId 
+769 KbdSetHWId 
+770 VioEndPopup 
+771 VioGetPhysBuf 
+772 VioGetAnsi 
+773 VioFree 
+774 VioSetAnsi 
+775 VioDeRegister 
+776 VioScrollUp 
+777 VioPrtSc 
+778 VioGetCurPos 
+779 VioWrtCellStr 
+780 VioPopUp 
+781 VioScrollRt 
+782 VioWrtCharStr 
+783 Avs_Prtsc 
+784 VioSetCurPos 
+785 VioSrfUnblock 
+786 VioSrfBlock 
+787 VioScrUnlock 
+788 VioWrtTty 
+789 VioSave 
+790 VioGetMode 
+791 VioSetMode 
+792 VioScrLock 
+793 VioReadCellStr 
+794 VioSavRedrawWait 
+795 VioWrtNAttr 
+796 VioGetCurType 
+797 VioSavRedrawUndo 
+798 VioGetFont 
+799 VioReadCharStr 
+800 VioGetBuf 
+801 VioSetCurType 
+802 VioSetFont 
+803 VioHetInit 
+804 VioModeUndo 
+805 VioSswSwitch 
+806 VioModeWait 
+807 Avs_PrtscToggle 
+808 VioGetCp 
+809 VioRestore 
+810 VioSetCp 
+811 VioShowBuf 
+812 VioScrollLf 
+813 VioRegister 
+814 VioGetConfig 
+815 VioScrollDn 
+816 VioWrtCharStrAtt 
+817 VioGetState 
+818 VioPrtScToggle 
+819 VioSetState 
+820 VioWrtNCell 
+821 VioWrtNChar 
+822 VioShellInit 
+823 VioAssociate 
+824 VioCreatePS 
+825 VioDeleteSetId 
+826 VioGetDeviceCellSize 
+827 VioGetOrg 
+828 VioCreateLogFont 
+829 VioDestroyPS 
+830 VioQuerySetIds 
+831 VioSetOrg 
+832 VioQueryFonts 
+833 VioSetDeviceCellSize 
+834 VioShowPS 
+835 VioGetPSAddress 
+836 VioQueryConsole 
+837 VioRedrawSize 
+838 VioGlobalReg 
+839 XVioSetCAState 
+840 XVioCheckCharType 
+841 XVioDestroyCA 
+842 XVioCreateCA 
+843 VioCheckCharType 
+844 XVioGetCAState 
+845 BVSMAIN 
+846 BVSREDRAWSIZE 
+847 BVSGETPTRDRAWNAME 
+848 AnsiInject 
+849 AnsiKeydef 
+850 AnsiInterp 
+851 BKSMAIN 
+852 BMSMAIN 
+853 MouGetHotKey 
+854 MouSetHotKey 
+855 Dos16SMSysInit 
+856 QhKeybdHandle 
+857 QhMouseHandle 
+858 SMQueueRamSem 
+859 SMArray 
+860 SMPIDArray 
+861 SMInitialized 
+862 SMArraySize 
+863 BVSGLOBAL 
+864 SMGINSTANCE 
+865 BVHINSTANCE 
+866 THK32ALIASMEM 
+867 THK32FREEALIAS 
+868 THK32ALLOCVARLEN 
+869 THK32HANDLEBOUNDARY 
+870 THK32HANDLESTRING 
+871 THK32DEALLOC 
+872 THK32XHNDLR 
+873 Dos32SetExtLIBPATH 
+874 Dos32QueryExtLIBPATH 
+875 Dos32PM16SemRst 
+876 Dos32SysCtl 
+877 Dos32QueryThreadContext 
+878 DosSGQueryTopmost 
+976 Dos32PerfSysCall 
+981 Dos32OpenL 
+982 Dos32ProtectOpenL 
+983 Dos32ProtectSetFileLocksL 
+984 Dos32ProtectSetFilePtrL 
+985 Dos32ProtectSetFileSizeL 
+986 Dos32SetFileLocksL 
+987 Dos32CancelLockRequestL 
+988 Dos32SetFilePtrL 
+989 Dos32SetFileSizeL 
+990 Dos32ListIOL 
+991 Dos16FSRamSemRequest2 
+992 Dos16FSRamSemClear2 
+995 Dos32SystemService 
+996 Dos32ListIO 
+997 Dos32CreateThread2 
+998 Dos16SetExtLIBPATH 
+999 Dos16QueryExtLIBPATH 
+1000 T32EXITLIST 
+1001 T32ALLOCPROTECTEDMEM 
+1002 T32ALIASMEM 
+1003 T32ALLOCMEM 
+1004 T32ALLOCSHAREDMEM 
+1005 T32GETNAMEDSHAREDMEM 
+1006 T32GETSHAREDMEM 
+1007 T32GIVESHAREDMEM 
+1008 T32FREEMEM 
+1009 T32SETMEM 
+1010 T32QUERYMEM 
+1011 T32QUERYMEMSTATE 
+1012 T32OPENVDD 
+1013 T32REQUESTVDD 
+1014 T32CLOSEVDD 
+1015 T32CREATETHREAD 
+1016 T32DYNAMICTRACE 
+1017 T32DEBUG 
+1018 T32QUERYPROCADDR 
+1019 T32CREATEEVENTSEM 
+1020 T32OPENEVENTSEM 
+1021 T32CLOSEEVENTSEM 
+1022 T32RESETEVENTSEM 
+1023 T32POSTEVENTSEM 
+1024 T32WAITEVENTSEM 
+1025 T32QUERYEVENTSEM 
+1026 T32CREATEMUTEXSEM 
+1027 T32OPENMUTEXSEM 
+1028 T32CLOSEMUTEXSEM 
+1029 T32REQUESTMUTEXSEM 
+1030 T32RELEASEMUTEXSEM 
+1031 T32QUERYMUTEXSEM 
+1032 T32CREATEMUXWAITSEM 
+1033 T32OPENMUXWAITSEM 
+1034 T32CLOSEMUXWAITSEM 
+1035 T32WAITMUXWAITSEM 
+1036 T32ADDMUXWAITSEM 
+1037 T32DELETEMUXWAITSEM 
+1038 T32QUERYMUXWAITSEM 
+1039 T32QUERYSYSINFO 
+1040 T32WAITTHREAD 
+1041 T32GETRESOURCE 
+1042 T32FREERESOURCE 
+1043 T32EXCEPTIONCALLBACK 
+1044 T32QUERYPAGEUSAGE 
+1045 T32FORCESYSTEMDUMP 
+1046 TI32ASYNCTIMER 
+1047 TI32STARTTIMER 
+1048 T32QUERYABIOSSUPPORT 
+1049 T32QUERYMODFROMEIP 
+1050 T32ALIASPERFCTRS 
+1051 T32CONFIGUREPERF 
+1052 T32DECONPERF 
+1053 T32REGISTERPERFCTRS 
+1054 T32QUERYSYSSTATE 
+1055 T32IREAD 
+1056 T32IWRITE 
+1057 T32TMRQUERYFREQ 
+1058 T32TMRQUERYTIME 
+1059 T32IMONREAD 
+1060 T32IMONWRITE 
+1061 T32QUERYRESOURCESIZE 
+1062 T32PROFILE 
+1063 T32SETSIGNALEXCEPTIONFOCUS 
+1064 T32SENDSIGNALEXCEPTION 
+1065 T32STARTTIMER 
+1066 T32STOPTIMER 
+1067 T32ASYNCTIMER 
+1068 T32INITIALIZEPORTHOLE 
+1069 T32QUERYHEADERINFO 
+1070 T32QUERYPROCTYPE 
+1071 T32IEXITMUSTCOMPLETE 
+1072 T32ICACHEMODULE 
+1073 T32DLLTERM 
+1074 T32IRAISEEXCEPTION 
+1075 T32ACKNOWLEDGESIGNALEXCEPTION 
+1076 T32QUERYDOSPROPERTY 
+1077 T32SETDOSPROPERTY 
+1078 T32SETFILELOCKS 
+1079 T32CANCELLOCKREQUEST 
+1080 T32KILLTHREAD 
+1081 TQUERYRASINFO 
+1082 T32DUMPPROCESS 
+1083 T32SUPPRESSPOPUPS 
+1084 T32IPROTECTWRITE 
+1085 T32PROTECTSETFILELOCKS 
+1086 T32IPROTECTREAD 
+1087 T32PMPOSTEVENTSEM 
+1088 T32PMWAITEVENTSEM 
+1089 T32PMREQUESTMUTEXSEM 
+1090 T32PMWAITMUXWAITSEM 
+1091 T32PM16SEMCHK 
+1092 T32ALLOCTHREADLOCALMEMORY 
+1093 T32FREETHREADLOCALMEMORY 
+1094 T32SETEXTLIBPATH 
+1095 T32QUERYEXTLIBPATH 
+1096 T32PM16SEMRST 
+1097 T32VERIFYPIDTID 
+1098 T32SYSCTL 
+1099 T32QUERYTHREADCONTEXT 
+1101 T32PERFSYSCALL 
+1102 T32LISTIO 
+1103 T32PMR3WAITEVENTSEM 
+1104 T32PMR3POSTEVENTSEM 
+1105 T32CREATETHREAD2 
+1106 T32PROTECTSETFILELOCKSL 
+1107 T32IPROTECTSETFILEPTRL 
+1108 T32SETFILELOCKSL 
+1109 T32CANCELLOCKREQUESTL 
+1110 T32ISETFILEPTRL 
+1111 T32LISTIOL 
+1116 T32ISETFILEPTR 
+1117 T32IPROTECTSETFILEPTR 
+9004 Dos32CreateRamSem 
+9005 Dos32CloseRamSem 
+9006 Dos32OpenRamSem 
+9007 Dos32RequestRamSem 
+9008 Dos32ReleaseRamSem 
+9010 Dos32QueryProcessInfo 
+9011 Dos32QueryThreadInfo 
+9018 Dos32FindFromName 
+
+
diff --git a/os2/lib/doscalls/makefile b/os2/lib/doscalls/makefile
new file mode 100644 (file)
index 0000000..d0e2fe1
--- /dev/null
@@ -0,0 +1,39 @@
+# $Id: makefile,v 1.1 2002/03/23 19:23:28 robertk Exp $
+
+PATH_TO_TOP = ../../../..
+
+TARGET_TYPE = dynlink
+
+TARGET_NAME = doscalls
+
+TARGET_BASE = 0x30000000
+
+TARGET_CFLAGS = -DDOSCALLS_BASE=$(TARGET_DLLBASE)
+
+TARGET_LFLAGS = -nostartfiles
+
+TARGET_SDKLIBS = ntdll.a
+
+TARGET_GCCLIBS = gcc
+
+TARGET_OBJECTS = $(TARGET_NAME).o
+
+TARGET_CLEAN = file/*.o vio/*.o sync/*.o mem/*.o \
+                               misc/*.o mou/*.o kbd/*.o run/*.o
+
+TARGET_DEFONLY=yes
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk
+
+
+MISC_OBJECTS = misc/doscalls.o
+#SYNC_OBJECTS =
+
+
+OBJECTS = $(MISC_OBJECTS)
+
+$(TARGET_NAME).o: $(OBJECTS)
+       $(LD) -r $(OBJECTS) -o $(TARGET_NAME).o
+
diff --git a/os2/lib/doscalls/misc/doscalls.c b/os2/lib/doscalls/misc/doscalls.c
new file mode 100644 (file)
index 0000000..a854313
--- /dev/null
@@ -0,0 +1,245 @@
+/* $ ld $
+*/
+/*
+ *
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS OS/2 sub system
+ * FILE:             dll/doscalls.c
+ * PURPOSE:          Kernelservices for OS/2 apps
+ * PROGRAMMER:       Robert K. robertk@mok.lvcm.com
+ * REVISION HISTORY:
+ *    13-03-2002  Created
+ */
+
+#include <ddk/ntddk.h>
+#include "doscalls.h"
+
+
+/*  Process variables. This section conains
+       per process variables that are used for caching or
+       other stuff. */
+DWORD PROC_Pid;                        // contains the current processes pid. (or is it also in PEB)
+
+
+
+/* Implementation of the system calls */
+APIRET APIENTRY Dos32Sleep(ULONG msec)
+{
+       NTSTATUS stat;
+       TIME Interv;
+       Interv.QuadPart= -(10000 * msec);
+       stat = NtDelayExecution( TRUE, &Interv );
+       return 0;
+}
+
+APIRET APIENTRY Dos32CreateThread(PTID ptid, PFNTHREAD pfn,
+                                   ULONG param, ULONG flag, ULONG cbStack)
+{
+       return 0;
+}
+
+
+APIRET APIENTRY  Dos32Open(PSZ    pszFileName,  PHFILE pHf,
+                            PULONG pulAction,  ULONG  cbFile,
+                            ULONG  ulAttribute,  ULONG  fsOpenFlags,
+                            ULONG  fsOpenMode,  PVOID reserved )  //ULONGPEAOP2 peaop2)
+{
+/*     NTAPI
+ZwCreateFile(
+OUT PHANDLE FileHandle,
+IN ACCESS_MASK DesiredAccess,
+IN POBJECT_ATTRIBUTES ObjectAttributes,
+OUT PIO_STATUS_BLOCK IoStatusBlock,
+IN PLARGE_INTEGER AllocationSize OPTIONAL,
+IN ULONG FileAttributes,
+IN ULONG ShareAccess,
+IN ULONG CreateDisposition,
+IN ULONG CreateOptions,
+IN PVOID EaBuffer OPTIONAL,
+IN ULONG EaLength
+);*/
+       return 0;
+}
+
+
+/* close a Handle. seems finished */
+APIRET APIENTRY  Dos32Close(HFILE hFile)
+{
+       NTSTATUS   nErrCode;
+       nErrCode = NtClose( (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;
+}
+
+
+
+
+APIRET APIENTRY  Dos32Read(HFILE hFile, PVOID pBuffer,
+                            ULONG cbRead, PULONG pcbActual)
+{
+       NTSTATUS        nErrCode;
+       IO_STATUS_BLOCK isbStatus;
+       // read data from file 
+       nErrCode = NtReadFile( (HANDLE)hFile,   NULL,   NULL,   NULL,
+                                                       &isbStatus,             pBuffer,        cbRead,
+                                                       NULL,           NULL    );
+       // contains the # bytes actually read.
+       *pcbActual = isbStatus.Information;
+       switch(nErrCode)
+       {
+       case STATUS_INVALID_HANDLE:
+               return ERROR_INVALID_HANDLE;
+               // FIXME: complete this
+       }
+       return NO_ERROR;
+}
+
+/* Generic write to a stream given by hFile */
+APIRET APIENTRY  Dos32Write(HFILE hFile, PVOID pBuffer,
+                             ULONG cbWrite, PULONG pcbActual)
+{ 
+       NTSTATUS        nErrCode;
+       IO_STATUS_BLOCK StatusBlk;
+       nErrCode = NtWriteFile( (HANDLE)hFile, NULL, NULL, NULL,
+                                                       &StatusBlk, pBuffer, cbWrite, 0, NULL );
+       *pcbActual = StatusBlk.Information;
+       // do an errorcode translation   FIXME: correct
+       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;
+}
+   
+
+
+/*******************************************/
+/* DosDevIOCtl performs control functions  */
+/* on a device specified by an opened      */
+/* device handle.                          */
+/*******************************************/
+/*HFILE     hDevice;         Device handle returned by DosOpen, or a standard (open) device handle. */
+/*ULONG     category;        Device category. */
+/*ULONG     function;        Device-specific function code. */
+/*PVOID     pParams;         Address of the command-specific argument list. */
+/*ULONG     cbParmLenMax;    Length, in bytes, of pParams. */
+/*PULONG    pcbParmLen;      Pointer to the length of parameters. */
+/*PVOID     pData;           Address of the data area. */
+/*ULONG     cbDataLenMax;    Length, in bytes, of pData. */
+/*PULONG    pcbDataLen;      Pointer to the length of data. */
+/*APIRET    ulrc;            Return Code. 
+ ulrc (APIRET) - returns 
+    Return Code. 
+
+    DosDevIOCtl returns one of the following values: 
+
+      0         NO_ERROR 
+      1         ERROR_INVALID_FUNCTION 
+      6         ERROR_INVALID_HANDLE 
+      15        ERROR_INVALID_DRIVE 
+      31        ERROR_GEN_FAILURE 
+      87        ERROR_INVALID_PARAMETER 
+      111       ERROR_BUFFER_OVERFLOW 
+      115       ERROR_PROTECTION_VIOLATION 
+      117       ERROR_INVALID_CATEGORY 
+      119       ERROR_BAD_DRIVER_LEVEL 
+      163       ERROR_UNCERTAIN_MEDIA 
+      165       ERROR_MONITORS_NOT_SUPPORTED 
+*/
+APIRET APIENTRY Dos32DevIOCtl(HFILE hDevice, ULONG category, ULONG function,
+        PVOID pParams,ULONG cbParmLenMax,PULONG pcbParmLen,
+        PVOID pData,ULONG cbDataLenMax,PULONG pcbDataLen)
+{
+       return 0;
+}
+
+
+APIRET APIENTRY Dos32Beep(ULONG freq, ULONG dur)
+{
+       if( freq<0x25 || freq>0x7FFF )
+               return 395;     // ERROR_INVALID_FREQUENCY
+
+  /*  HANDLE hBeep;
+    BEEP_SET_PARAMETERS BeepSetParameters;
+    DWORD dwReturned;
+
+    hBeep = Dos32Open("\\\\.\\Beep",
+                       FILE_GENERIC_READ | FILE_GENERIC_WRITE,
+                       0,
+                       NULL,
+                       OPEN_EXISTING,
+                       0,
+                       NULL);
+    if (hBeep == INVALID_HANDLE_VALUE)
+        return FALSE;
+*/
+    // Set beep data 
+  /*  BeepSetParameters.Frequency = dwFreq;
+    BeepSetParameters.Duration  = dwDuration;
+
+    DeviceIoControl(hBeep,
+                    IOCTL_BEEP_SET,
+                    &BeepSetParameters,
+                    sizeof(BEEP_SET_PARAMETERS),
+                    NULL,
+                    0,
+                    &dwReturned,
+                    NULL);
+
+    CloseHandle (hBeep);
+
+    return TRUE;
+*/
+
+
+
+       return 0;
+}
+
+/* Terminates the current thread or the current Process.
+       Decission is made by action 
+       FIXME:  move this code to OS2.EXE */
+VOID APIENTRY Dos32Exit(ULONG action, ULONG result)
+{
+       // decide what to do
+       if( action == EXIT_THREAD)
+       {
+               NtTerminateThread( NULL, result );
+       }
+       else    // EXIT_PROCESS
+       {
+               NtTerminateProcess( NULL, result );
+       }
+}
+
+
+
+BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
+{
+       switch (ul_reason_for_call)
+       {
+       case 1://DLL_PROCESS_ATTACH:
+       case 2://DLL_THREAD_ATTACH:
+       case 3://DLL_THREAD_DETACH:
+       case 0://DLL_PROCESS_DETACH:
+               break;
+       }
+    return TRUE;
+}
+
diff --git a/os2/lib/doscalls/misc/doscalls.h b/os2/lib/doscalls/misc/doscalls.h
new file mode 100644 (file)
index 0000000..3873c14
--- /dev/null
@@ -0,0 +1,84 @@
+/* $ $
+ *
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS OS/2 sub system
+ * FILE:             dll/doscalls.h
+ * PURPOSE:          Kernelservices for OS/2 apps
+ * PROGRAMMER:       Robert K. robertk@mok.lvcm.com
+ * REVISION HISTORY:
+ *    13-03-2002  Created
+ */
+
+
+
+#include "os2def.h"
+
+
+// FIXME: use ib headers
+#define EXIT_THREAD                                    0
+#define EXIT_PROCESS                           1
+#define NO_ERROR 0
+#define ERROR_INVALID_HANDLE 5
+#define ERROR_FILE_NOT_FOUND           6
+// for this 
+
+// Give the user nicer names that the internal ones
+#define DosSleep                               Dos32Sleep
+#define DosCreateThread                        Dos32CreateThread
+#define DosOpen                                        Dos32Open
+#define DosClose                               Dos32Close
+#define DosRead                                        Dos32Read
+#define DosWrite                               Dos32Write
+#define DosBeep                                        Dos32Beep
+#define DosExit                                        Dos32Exit
+   
+
+APIRET APIENTRY Dos32Sleep(ULONG msec);
+
+APIRET APIENTRY Dos32CreateThread(PTID ptid,
+                               PFNTHREAD pfn,
+                               ULONG param,
+                               ULONG flag,
+                               ULONG cbStack);
+
+APIRET APIENTRY  Dos32Open(PSZ    pszFileName,
+                        PHFILE pHf,
+                        PULONG pulAction,
+                        ULONG  cbFile,
+                        ULONG  ulAttribute,
+                        ULONG  fsOpenFlags,
+                        ULONG  fsOpenMode,
+                        PVOID reserved );  //ULONGPEAOP2 peaop2)
+
+APIRET APIENTRY  Dos32Close(HFILE hFile);
+
+APIRET APIENTRY  Dos32Read(HFILE hFile,
+                        PVOID pBuffer,
+                        ULONG cbRead,
+                        PULONG pcbActual);
+
+APIRET APIENTRY  Dos32Write(HFILE hFile,
+                         PVOID pBuffer,
+                         ULONG cbWrite,
+                         PULONG pcbActual);
+
+APIRET APIENTRY Dos32DevIOCtl(HFILE hDevice, ULONG category, ULONG function,
+                                                       PVOID pParams,ULONG cbParmLenMax,PULONG pcbParmLen,
+                                                       PVOID pData,ULONG cbDataLenMax,PULONG pcbDataLen);
+
+
+APIRET APIENTRY Dos32Beep(ULONG freq,
+                       ULONG dur);
+
+VOID APIENTRY Dos32Exit(ULONG action,
+                     ULONG result);
+
+
+
+
+
+
+
+
+
+
diff --git a/os2/lib/doscalls/misc/errorcodes.c b/os2/lib/doscalls/misc/errorcodes.c
new file mode 100644 (file)
index 0000000..fdad2c5
--- /dev/null
@@ -0,0 +1,287 @@
+/* $ld$
+*/
+
+/* some header*/
+
+#include <os2errores>
+#include <nt's status.h>
+
+/*  This file defines a big array of #defines that are
+       used to translate OS/2 errorcodes to ntdll error codes. */
+
+/* OS/2 to NTDLL error mapping */
+#define NO_ERROR                                                       STATUS_SUCCESS
+#define ERROR_INVALID_FUNCTION                         STATUS_ILLEGAL_FUNCTION
+#define ERROR_FILE_NOT_FOUND    2       /* MSG%FILE_NOT_FOUND */
+#define ERROR_PATH_NOT_FOUND    3       /* MSG%PATH_NOT_FOUND */
+#define ERROR_TOO_MANY_OPEN_FILES       4       /* MSG%OUT_OF_HANDLES */
+#define ERROR_ACCESS_DENIED     5       /* MSG%ACCESS_DENIED */
+#define ERROR_INVALID_HANDLE    6       /* MSG%INVALID_HANDLE */
+#define ERROR_ARENA_TRASHED     7       /* MSG%MEMORY_BLOCKS_BAD */
+#define ERROR_NOT_ENOUGH_MEMORY 8       /* MSG%NO_MEMORY */
+#define ERROR_INVALID_BLOCK     9       /* MSG%INVALID_MEM_ADDR */
+#define ERROR_BAD_ENVIRONMENT   10      /* MSG%INVALID_ENVIRON */
+#define ERROR_BAD_FORMAT        11      /* MSG%INVALID_FORMAT */
+#define ERROR_INVALID_ACCESS    12      /* MSG%INVALID_ACC_CODE */
+#define ERROR_INVALID_DATA      13      /* MSG%INVALID_DATA */
+#define ERROR_INVALID_DRIVE     15      /* MSG%INVALID_DRIVE */
+#define ERROR_CURRENT_DIRECTORY 16      /* MSG%ATT_RD_CURDIR */
+#define ERROR_NOT_SAME_DEVICE   17      /* MSG%NOT_SAME_DEVICE */
+#define ERROR_NO_MORE_FILES     18      /* MSG%NO_MORE_FILES */
+#define ERROR_WRITE_PROTECT     19      /* MSG%ATT_WRITE_PROT */
+#define ERROR_BAD_UNIT  20      /* MSG%UNKNOWN_UNIT */
+#define ERROR_NOT_READY 21      /* MSG%DRIVE_NOT_READY */
+#define ERROR_BAD_COMMAND       22      /* MSG%UNKNOWN_COMMAND */
+#define ERROR_CRC       23      /* MSG%DATA_ERROR */
+#define ERROR_BAD_LENGTH        24      /* MSG%BAD_REQ_STRUCTURE */
+#define ERROR_SEEK      25      /* MSG%SEEK_ERROR */
+#define ERROR_NOT_DOS_DISK      26      /* MSG%UNKNOWN_MEDIA */
+#define ERROR_SECTOR_NOT_FOUND  27      /* MSG%SECTOR_NOT_FOUND */
+#define ERROR_OUT_OF_PAPER      28      /* MSG%OUT_OF_PAPER */
+#define ERROR_WRITE_FAULT       29      /* MSG%WRITE_FAULT */
+#define ERROR_READ_FAULT        30      /* MSG%READ_FAULT */
+#define ERROR_GEN_FAILURE       31      /* MSG%GENERAL_FAILURE */
+#define ERROR_SHARING_VIOLATION 32      /* MSG%SHARING_VIOLATION */
+/*                                      32%msg%SHAR_VIOLAT_FIND */
+#define ERROR_LOCK_VIOLATION    33      /* MSG%LOCK_VIOLATION */
+#define ERROR_WRONG_DISK        34      /* MSG%INVALID_DISK_CHANGE */
+#define ERROR_FCB_UNAVAILABLE   35      /* MSG%35 */
+#define ERROR_SHARING_BUFFER_EXCEEDED   36      /* MSG%SHARING_BUFF_OFLOW */
+#define ERROR_CODE_PAGE_MISMATCHED      37      /* MSG%ERROR_WRITE_PROTECT */
+#define ERROR_HANDLE_EOF        38      /* MSG%ERROR_BAD_UNIT */
+#define ERROR_HANDLE_DISK_FULL  39      /* MSG%ERROR_NOT_READY */
+/*                                      40%msg%ERROR_BAD_COMMAND */
+/*                                      41%msg%ERROR_CRC */
+/*                                      42%msg%ERROR_BAD_LENGTH */
+/*                                      43%msg%ERROR_SEEK */
+/*                                      44%msg%ERROR_NOT_DOS_DISK */
+/*                                      45%msg%ERROR_SECTOR_NOT_FOUND */
+/*                                      46%msg%ERROR_OUT_OF_PAPER */
+/*                                      47%msg%ERROR_WRITE_FAULT */
+/*                                      48%msg%ERROR_READ_FAULT */
+/*                                      49%msg%ERROR_GEN_FAILURE */
+#define ERROR_NOT_SUPPORTED     50      /* MSG%NET_REQ_NOT_SUPPORT */
+#define ERROR_REM_NOT_LIST      51      /* MSG%NET_REMOTE_NOT_ONLINE */
+#define ERROR_DUP_NAME  52      /* MSG%NET_DUP_FILENAME */
+#define ERROR_BAD_NETPATH       53      /* MSG%NET_PATH_NOT_FOUND */
+#define ERROR_NETWORK_BUSY      54      /* MSG%NET_BUSY */
+#define ERROR_DEV_NOT_EXIST     55      /* MSG%NET_DEV_NOT_INSTALLED */
+#define ERROR_TOO_MANY_CMDS     56      /* MSG%NET_BIOS_LIMIT_REACHED */
+#define ERROR_ADAP_HDW_ERR      57      /* MSG%NET_ADAPT_HRDW_ERROR */
+#define ERROR_BAD_NET_RESP      58      /* MSG%NET_INCORRECT_RESPONSE */
+#define ERROR_UNEXP_NET_ERR     59      /* MSG%NET_UNEXPECT_ERROR */
+#define ERROR_BAD_REM_ADAP      60      /* MSG%NET_REMOT_ADPT_INCOMP */
+#define ERROR_PRINTQ_FULL       61      /* MSG%NET_PRINT_Q_FULL */
+#define ERROR_NO_SPOOL_SPACE    62      /* MSG%NET_NO_SPACE_TO_PRINT_FL */
+#define ERROR_PRINT_CANCELLED   63      /* MSG%NET_PRINT_FILE_DELETED */
+#define ERROR_NETNAME_DELETED   64      /* MSG%NET_NAME_DELETED */
+#define ERROR_NETWORK_ACCESS_DENIED     65      /* MSG%NET_ACCESS_DENIED */
+#define ERROR_BAD_DEV_TYPE      66      /* MSG%NET_DEV_TYPE_INVALID */
+#define ERROR_BAD_NET_NAME      67      /* MSG%NET_NAME_NOT_FOUND */
+#define ERROR_TOO_MANY_NAMES    68      /* MSG%NET_NAME_LIMIT_EXCEED */
+#define ERROR_TOO_MANY_SESS     69      /* MSG%NET_BIOS_LIMIT_EXCEED */
+#define ERROR_SHARING_PAUSED    70      /* MSG%NET_TEMP_PAUSED */
+#define ERROR_REQ_NOT_ACCEP     71      /* MSG%NET_REQUEST_DENIED */
+#define ERROR_REDIR_PAUSED      72      /* MSG%NET_PRT_DSK_REDIR_PAUSE */
+#define ERROR_SBCS_ATT_WRITE_PROT  73   /* Attempted write on protected disk */
+#define ERROR_SBCS_GENERAL_FAILURE 74   /* General failure */
+#define ERROR_XGA_OUT_MEMORY    75      /* MSG%XGA_OUT_MEMORY */
+#define ERROR_FILE_EXISTS       80      /* MSG%FILE_EXISTS */
+#define ERROR_DUP_FCB   81      /* MSG%none */
+#define ERROR_CANNOT_MAKE       82      /* MSG%CANNOT_MAKE */
+#define ERROR_FAIL_I24  83      /* MSG%NET_FAIL_INT_TWO_FOUR */
+#define ERROR_OUT_OF_STRUCTURES 84      /* MSG%NET_TOO_MANY_REDIRECT */
+#define ERROR_ALREADY_ASSIGNED  85      /* MSG%NET_DUP_REDIRECTION */
+#define ERROR_INVALID_PASSWORD  86      /* MSG%NET_INVALID_PASSWORD */
+#define ERROR_INVALID_PARAMETER 87      /* MSG%NET_INCORR_PARAMETER */
+#define ERROR_NET_WRITE_FAULT   88      /* MSG%NET_DATA_FAULT */
+#define ERROR_NO_PROC_SLOTS     89      /* MSG%NO_PROC_SLOTS */
+#define ERROR_NOT_FROZEN        90      /* MSG%none */
+#define ERROR_SYS_COMP_NOT_LOADED       ERROR_NOT_FROZEN
+#define ERR_TSTOVFL     91      /* MSG%none */
+#define ERR_TSTDUP      92      /* MSG%none */
+#define ERROR_NO_ITEMS  93      /* MSG%none */
+#define ERROR_INTERRUPT 95      /* MSG%none */
+#define ERROR_DEVICE_IN_USE     99      /* MSG%DEVICE_IN_USE */
+#define ERROR_TOO_MANY_SEMAPHORES       100     /* MSG%TOO_MANY_SEMAPHORES */
+#define ERROR_EXCL_SEM_ALREADY_OWNED    101     /* MSG%EXCL_SEM_ALREADY_OWNED */
+#define ERROR_SEM_IS_SET        102     /* MSG%SEM_IS_SET */
+#define ERROR_TOO_MANY_SEM_REQUESTS     103     /* MSG%TOO_MANY_SEM_REQUESTS */
+#define ERROR_INVALID_AT_INTERRUPT_TIME 104     /* MSG%INVALID_AT_INTERRUPT_TIME */
+#define ERROR_SEM_OWNER_DIED    105     /* MSG%SEM_OWNER_DIED */
+#define ERROR_SEM_USER_LIMIT    106     /* MSG%ERROR_DISK_CHANGE */
+#define ERROR_DISK_CHANGE       107     /* MSG%DISK_CHANGE */
+#define ERROR_DRIVE_LOCKED      108     /* MSG%DRIVE_LOCKED */
+#define ERROR_BROKEN_PIPE       109     /* MSG%BROKEN_PIPE */
+#define ERROR_OPEN_FAILED       110     /* MSG%ERROR_OPEN_FAILED */
+#define ERROR_BUFFER_OVERFLOW   111     /* MSG%ERROR_FILENAME_LONG */
+#define ERROR_DISK_FULL 112     /* MSG%DISK_FULL */
+#define ERROR_NO_MORE_SEARCH_HANDLES    113     /* MSG%NO_SEARCH_HANDLES */
+#define ERROR_INVALID_TARGET_HANDLE     114     /* MSG%ERR_INV_TAR_HANDLE */
+#define ERROR_PROTECTION_VIOLATION      115     /* MSG%none */
+#define ERROR_VIOKBD_REQUEST    116     /* MSG%none */
+#define ERROR_INVALID_CATEGORY  117     /* MSG%INVALID_CATEGORY */
+#define ERROR_INVALID_VERIFY_SWITCH     118     /* MSG%INVALID_VERIFY_SWITCH */
+#define ERROR_BAD_DRIVER_LEVEL  119     /* MSG%BAD_DRIVER_LEVEL */
+#define ERROR_CALL_NOT_IMPLEMENTED      120     /* MSG%BAD_DYNALINK */
+#define ERROR_SEM_TIMEOUT       121     /* MSG%SEM_TIMEOUT */
+#define ERROR_INSUFFICIENT_BUFFER       122     /* MSG%INSUFFICIENT_BUFFER */
+#define ERROR_INVALID_NAME      123     /* MSG%INVALID_NAME */
+/*                                      123%msg%HPFS_INVALID_VOLUME_CHAR */
+#define ERROR_INVALID_LEVEL     124     /* MSG%INVALID_LEVEL */
+#define ERROR_NO_VOLUME_LABEL   125     /* MSG%NO_VOLUME_LABEL */
+#define ERROR_MOD_NOT_FOUND     126     /* MSG%MOD_NOT_FOUND */
+#define ERROR_PROC_NOT_FOUND    127     /* MSG%PROC_NOT_FOUND */
+#define ERROR_WAIT_NO_CHILDREN  128     /* MSG%none */
+#define ERROR_CHILD_NOT_COMPLETE        129     /* MSG%PROT_MODE_ONLY */
+#define ERROR_DIRECT_ACCESS_HANDLE      130     /* MSG%APPL_SINGLEFRAMECHAR */
+#define ERROR_NEGATIVE_SEEK     131     /* MSG%APPL_DOUBLEFRAMECHAR */
+#define ERROR_SEEK_ON_DEVICE    132     /* MSG%APPL_ARROWCHAR */
+#define ERROR_IS_JOIN_TARGET    133     /* MSG%JOIN_ON_DRIV_IS_TAR */
+#define ERROR_IS_JOINED 134     /* MSG%JOIN_DRIVE_IS */
+#define ERROR_IS_SUBSTED        135     /* MSG%SUB_DRIVE_IS */
+#define ERROR_NOT_JOINED        136     /* MSG%DRIVE_IS_NOT_JOINED */
+#define ERROR_NOT_SUBSTED       137     /* MSG%DRIVE_NOT_SUBSTED */
+#define ERROR_JOIN_TO_JOIN      138     /* MSG%JOIN_CANNOT_JOIN_DRIVE */
+#define ERROR_SUBST_TO_SUBST    139     /* MSG%SUB_CANNOT_SUBST_DRIVE */
+#define ERROR_JOIN_TO_SUBST     140     /* MSG%JOIN_CANNOT_SUB_DRIVE */
+#define ERROR_SUBST_TO_JOIN     141     /* MSG%SUB_CANNOT_JOIN_DRIVE */
+#define ERROR_BUSY_DRIVE        142     /* MSG%DRIVE_IS_BUSY */
+#define ERROR_SAME_DRIVE        143     /* MSG%JOIN_SUB_SAME_DRIVE */
+#define ERROR_DIR_NOT_ROOT      144     /* MSG%DIRECT_IS_NOT_SUBDIR */
+#define ERROR_DIR_NOT_EMPTY     145     /* MSG%DIRECT_IS_NOT_EMPTY */
+#define ERROR_IS_SUBST_PATH     146     /* MSG%PATH_USED_SUBST_JOIN */
+#define ERROR_IS_JOIN_PATH      147     /* MSG%NO_NEEDED_RESOURCES */
+#define ERROR_PATH_BUSY 148     /* MSG%PATH_BUSY */
+#define ERROR_IS_SUBST_TARGET   149     /* MSG%SUB_ON_DRIVE_IS_JOIN */
+#define ERROR_SYSTEM_TRACE      150     /* MSG%SYSTEM_TRACE */
+#define ERROR_INVALID_EVENT_COUNT       151     /* MSG%INVALID_EVENT_COUNT */
+#define ERROR_TOO_MANY_MUXWAITERS       152     /* MSG%TOO_MANY_MUXWAITERS */
+#define ERROR_INVALID_LIST_FORMAT       153     /* MSG%INVALID_LIST_FORMAT */
+#define ERROR_LABEL_TOO_LONG    154     /* MSG%VOLUME_TOO_LONG */
+/*                                      154%msg%HPFS_VOL_LABEL_LONG */
+#define ERROR_TOO_MANY_TCBS     155     /* MSG%TOO_MANY_TCBS */
+#define ERROR_SIGNAL_REFUSED    156     /* MSG%SIGNAL_REFUSED */
+#define ERROR_DISCARDED 157     /* MSG%DISCARDED */
+#define ERROR_NOT_LOCKED        158     /* MSG%NOT_LOCKED */
+#define ERROR_BAD_THREADID_ADDR 159     /* MSG%BAD_THREADID_ADDR */
+#define ERROR_BAD_ARGUMENTS     160     /* MSG%BAD_ARGUMENTS */
+#define ERROR_BAD_PATHNAME      161     /* MSG%none */
+#define ERROR_SIGNAL_PENDING    162     /* MSG%SIGNAL_PENDING */
+#define ERROR_UNCERTAIN_MEDIA   163     /* MSG%none */
+#define ERROR_MAX_THRDS_REACHED 164     /* MSG%MAX_THRDS_REACHED */
+#define ERROR_MONITORS_NOT_SUPPORTED    165     /* MSG%none */
+#define ERROR_UNC_DRIVER_NOT_INSTALLED  166     /* MSG%UNC_DRIVER_NOT_INSTALLED */
+#define ERROR_LOCK_FAILED       167     /* MSG%LOCK_FAILED */
+#define ERROR_SWAPIO_FAILED     168     /* MSG%SWAPIO_FAILED */
+#define ERROR_SWAPIN_FAILED     169     /* MSG%SWAPIN_ATTEMPT_FAILED */
+#define ERROR_BUSY              170     /* MSG%SEGMENT_BUSY */
+/*                                      171%msg%INT_TOO_LONG */
+#define ERROR_CANCEL_VIOLATION     173     /* MSG%UNLOCK_VIOLATION */
+#define ERROR_ATOMIC_LOCK_NOT_SUPPORTED 174 /* MSG%none */
+#define ERROR_READ_LOCKS_NOT_SUPPORTED  175 /* MSG%none */
+#define ERROR_INVALID_SEGMENT_NUMBER    180     /* MSG%INVALID_SEGMENT_NUM */
+#define ERROR_INVALID_CALLGATE  181     /* MSG%none */
+#define ERROR_INVALID_ORDINAL   182     /* MSG%INVALID_ORDINAL */
+#define ERROR_ALREADY_EXISTS    183     /* MSG%none */
+#define ERROR_NO_CHILD_PROCESS  184     /* MSG%none */
+#define ERROR_CHILD_ALIVE_NOWAIT        185     /* MSG%none */
+#define ERROR_INVALID_FLAG_NUMBER       186     /* MSG%INVALID_FLAG_NUMBER */
+#define ERROR_SEM_NOT_FOUND     187     /* MSG%SEM_NOT_FOUND */
+#define ERROR_INVALID_STARTING_CODESEG  188     /* MSG%INVALID_STARTING_CODESEG */
+#define ERROR_INVALID_STACKSEG  189     /* MSG%INVALID_STACKSEG */
+#define ERROR_INVALID_MODULETYPE        190     /* MSG%INVALID_MODULETYPE */
+#define ERROR_INVALID_EXE_SIGNATURE     191     /* MSG%INVALID_EXE_SIGNATURE */
+#define ERROR_EXE_MARKED_INVALID        192     /* MSG%EXE_MARKED_INVALID */
+#define ERROR_BAD_EXE_FORMAT    193     /* MSG%BAD_EXE_FORMAT */
+#define ERROR_ITERATED_DATA_EXCEEDS_64k 194     /* MSG%ITERATED_DATA_EXCEEDS_64K */
+#define ERROR_INVALID_MINALLOCSIZE      195     /* MSG%INVALID_MINALLOCSIZE */
+#define ERROR_DYNLINK_FROM_INVALID_RING 196     /* MSG%DYNLINK_FROM_INVALID_RING */
+#define ERROR_IOPL_NOT_ENABLED  197     /* MSG%IOPL_NOT_ENABLED */
+#define ERROR_INVALID_SEGDPL    198     /* MSG%INVALID_SEGDPL */
+#define ERROR_AUTODATASEG_EXCEEDS_64k   199     /* MSG%AUTODATASEG_EXCEEDS_64K */
+#define ERROR_RING2SEG_MUST_BE_MOVABLE  200     /* MSG%CODESEG_CANNOT_BE_64K */
+#define ERROR_RELOC_CHAIN_XEEDS_SEGLIM  201     /* MSG%RELOC_CHAIN_XEEDS_SEGMENT */
+#define ERROR_INFLOOP_IN_RELOC_CHAIN    202     /* MSG%INFLOOP_IN_RELOC_CHAIN */
+#define ERROR_ENVVAR_NOT_FOUND  203     /* MSG%ENVVAR_NOT_FOUND */
+#define ERROR_NOT_CURRENT_CTRY  204     /* MSG%none */
+#define ERROR_NO_SIGNAL_SENT    205     /* MSG%SIGNAL_NOT_SENT */
+#define ERROR_FILENAME_EXCED_RANGE      206     /* MSG%NAME_TOO_LONG */
+#define ERROR_RING2_STACK_IN_USE        207     /* MSG%RING2_STACK_IN_USE */
+#define ERROR_META_EXPANSION_TOO_LONG   208     /* MSG%WILD_CARD_NAME */
+#define ERROR_INVALID_SIGNAL_NUMBER     209     /* MSG%INVALID_SIGNAL_NUMBER */
+#define ERROR_THREAD_1_INACTIVE 210     /* MSG%THREAD_1_INACTIVE */
+#define ERROR_INFO_NOT_AVAIL    211     /* MSG%none */
+#define ERROR_LOCKED    212     /* MSG%LOCKED */
+#define ERROR_BAD_DYNALINK      213     /* MSG%none */
+#define ERROR_TOO_MANY_MODULES  214     /* MSG%TOO_MANY_MODULES */
+#define ERROR_NESTING_NOT_ALLOWED       215     /* MSG%none */
+#define ERROR_CANNOT_SHRINK     216     /* MSG%CANNOT_SHRINK */
+#define ERROR_ZOMBIE_PROCESS    217     /* MSG%none */
+#define ERROR_STACK_IN_HIGH_MEMORY      218     /* MSG%none */
+#define ERROR_INVALID_EXITROUTINE_RING  219     /* MSG%INVALID_EXITROUTINE_RING */
+#define ERROR_GETBUF_FAILED     220     /* MSG%none */
+#define ERROR_FLUSHBUF_FAILED   221     /* MSG%none */
+#define ERROR_TRANSFER_TOO_LONG 222     /* MSG%none */
+#define ERROR_FORCENOSWAP_FAILED        223     /* MSG%none */
+#define ERROR_SMG_NO_TARGET_WINDOW      224     /* PM ID can't be selected */
+#define ERROR_NO_CHILDREN       228     /* MSG%NO_CHILDREN */
+#define ERROR_INVALID_SCREEN_GROUP      229     /* MSG%none */
+#define ERROR_BAD_PIPE  230     /* MSG%ERROR_BAD_PIPE */
+#define ERROR_PIPE_BUSY 231     /* MSG%ERROR_PIPE_BUSY */
+#define ERROR_NO_DATA   232     /* MSG%ERROR_NO_DATA */
+#define ERROR_PIPE_NOT_CONNECTED        233     /* MSG%ERROR_PIPE_NOT_CONNECTED */
+#define ERROR_MORE_DATA 234     /* MSG%ERROR_MORE_DATA */
+#define ERROR_VC_DISCONNECTED   240     /* MSG%ERROR_VC_DISCONNECTED */
+#define ERROR_CIRCULARITY_REQUESTED     250     /* MSG%CIRCULARITY_REQUESTED */
+#define ERROR_DIRECTORY_IN_CDS  251     /* MSG%DIRECTORY_IN_CDS */
+#define ERROR_INVALID_FSD_NAME  252     /* MSG%INVALID_FSD_NAME */
+#define ERROR_INVALID_PATH      253     /* MSG%INVALID_PATH */
+#define ERROR_INVALID_EA_NAME   254     /* MSG%INVALID_EA_NAME */
+#define ERROR_EA_LIST_INCONSISTENT      255     /* MSG%EA_LIST_INCONSISTENT */
+#define ERROR_EA_LIST_TOO_LONG  256     /* MSG%EA_LIST_TOO_LONG */
+#define ERROR_NO_META_MATCH     257     /* MSG%NO_META_MATCH */
+#define ERROR_FINDNOTIFY_TIMEOUT        258     /* MSG%FINDNOTIFY_TIMEOUT */
+#define ERROR_NO_MORE_ITEMS     259     /* MSG%NO_MORE_ITEMS */
+#define ERROR_SEARCH_STRUC_REUSED       260     /* MSG%SEARCH_STRUC_REUSED */
+#define ERROR_CHAR_NOT_FOUND    261     /* MSG%CHAR_NOT_FOUND */
+#define ERROR_TOO_MUCH_STACK    262     /* MSG%TOO_MUCH_STACK */
+#define ERROR_INVALID_ATTR      263     /* MSG%INVALID_ATTR */
+#define ERROR_INVALID_STARTING_RING     264     /* MSG%INVALID_STARTING_RING */
+#define ERROR_INVALID_DLL_INIT_RING     265     /* MSG%INVALID_DLL_INIT_RING */
+#define ERROR_CANNOT_COPY       266     /* MSG%CANNOT_COPY */
+#define ERROR_DIRECTORY 267     /* MSG%DIRECTORY */
+#define ERROR_OPLOCKED_FILE     268     /* MSG%OPLOCKED_FILE */
+#define ERROR_OPLOCK_THREAD_EXISTS      269     /* MSG%OPLOCK_THREAD_EXISTS */
+#define ERROR_VOLUME_CHANGED    270     /* MSG%none */
+#define ERROR_FINDNOTIFY_HANDLE_IN_USE  271     /* MSG%none */
+#define ERROR_FINDNOTIFY_HANDLE_CLOSED  272     /* MSG%none */
+#define ERROR_NOTIFY_OBJECT_REMOVED     273     /* MSG%none */
+#define ERROR_ALREADY_SHUTDOWN  274     /* MSG%none */
+#define ERROR_EAS_DIDNT_FIT     275     /* MSG%none */
+#define ERROR_EA_FILE_CORRUPT   276     /* MSG%ERROR_EAS_CORRUPT */
+#define ERROR_EA_TABLE_FULL     277     /* MSG%EA_TABLE_FULL */
+#define ERROR_INVALID_EA_HANDLE 278     /* MSG%INVALID_EA_HANDLE */
+#define ERROR_NO_CLUSTER        279     /* MSG%NO_CLUSTER */
+#define ERROR_CREATE_EA_FILE    280     /* MSG%ERROR_CREATE_EA_FILE */
+#define ERROR_CANNOT_OPEN_EA_FILE       281     /* MSG%CANNOT_OPEN_FILE */
+#define ERROR_EAS_NOT_SUPPORTED 282     /* MSG%EAS_NOT_SUPPORTED */
+#define ERROR_NEED_EAS_FOUND    283     /* MSG%NEED_EAS_FOUND */
+#define ERROR_DUPLICATE_HANDLE  284     /* MSG%EAS_DISCARDED */
+#define ERROR_DUPLICATE_NAME    285     /* MSG%DUPLICATE_SEM_NAME */
+#define ERROR_EMPTY_MUXWAIT     286     /* MSG%EMPTY_MUXWAIT_SEM */
+#define ERROR_MUTEX_OWNED       287     /* MSG%MUTEX_SEM_OWNED */
+#define ERROR_NOT_OWNER         288     /* MSG%NOT_MUTEX_SEM_OWNER */
+#define ERROR_PARAM_TOO_SMALL   289     /* MSG%QUERY_MUX_PARAM_TOO_SMALL */
+#define ERROR_TOO_MANY_HANDLES  290     /* MSG%TOO_MANY_SEM_HANDLES */
+#define ERROR_TOO_MANY_OPENS    291     /* MSG%TOO_MANY_SEM_OPENS */
+#define ERROR_WRONG_TYPE        292     /* MSG%SEM_WRONG_TYPE */
+#define ERROR_UNUSED_CODE               293     /* MSG%none */
+#define ERROR_THREAD_NOT_TERMINATED     294     /* MSG%none */
+#define ERROR_INIT_ROUTINE_FAILED       295     /* MSG%none */
+#define ERROR_MODULE_IN_USE             296     /* MSG%none */
+#define ERROR_NOT_ENOUGH_WATCHPOINTS    297     /* MSG%none */
+#define ERROR_TOO_MANY_POSTS    298     /* MSG%TOO_MANY_EVENT_SEM_POSTS */
+#define ERROR_ALREADY_POSTED    299     /* MSG%EVENT_SEM_ALREADY_POSTED */
+#define ERROR_ALREADY_RESET     300     /* MSG%EVENT_SEM_ALREADY_RESET */
+#define ERROR_SEM_BUSY          301     /* MSG%SEM_BUSY */
\ No newline at end of file
diff --git a/os2/lib/doscalls/misc/os2def.h b/os2/lib/doscalls/misc/os2def.h
new file mode 100644 (file)
index 0000000..c29fc22
--- /dev/null
@@ -0,0 +1,53 @@
+/* This file conains common OS/2 types that are needed to build this dll */ 
+/* this file should have temporal character until a better idea is born */
+
+#ifndef __OS2DEF__
+#define __OS2DEF__
+
+typedef unsigned long  APIRET;
+#define APIENTRY
+typedef char *PSZ;
+typedef char *NPSZ;
+typedef char *NPCH;
+#define VOID        void
+//
+
+/* define these types only when ntdll is not included */
+#if( !defined( __INCLUDE_NTDEF_H ))
+       #define CHAR    char           
+       #define SHORT   short          
+       #define LONG    long           
+       typedef char BYTE;    
+       typedef unsigned char  UCHAR;  
+       typedef unsigned short USHORT; 
+       typedef unsigned long  ULONG;  
+
+       typedef CHAR *PCHAR;
+       typedef SHORT *PSHORT;
+       typedef LONG *PLONG;
+       typedef UCHAR *PUCHAR;
+       typedef USHORT *PUSHORT;
+       typedef ULONG *PULONG;
+       typedef VOID   *PVOID;
+#endif
+
+
+//typedef char *PCH;
+//typedef const char *PCSZ;
+
+
+typedef unsigned long LHANDLE;
+typedef LHANDLE HMODULE;        /* hmod */
+typedef LHANDLE PID;            /* pid  */
+typedef LHANDLE TID;            /* tid  */
+typedef LHANDLE HFILE;
+typedef HFILE  *PHFILE;
+typedef HMODULE *PHMODULE;
+typedef PID *PPID;
+typedef TID *PTID;
+
+typedef  VOID APIENTRY FNTHREAD(ULONG);
+typedef FNTHREAD *PFNTHREAD;
+
+
+#endif //__OS2DEF__
\ No newline at end of file
diff --git a/os2/lib/doscalls/run/process.cpp b/os2/lib/doscalls/run/process.cpp
new file mode 100644 (file)
index 0000000..744fe8d
--- /dev/null
@@ -0,0 +1,17 @@
+
+/* Terminates the current thread or the current Process.
+       Decission is made by action 
+       FIXME:  move this code to OS2.EXE */
+VOID APIENTRY Dos32Exit(ULONG action, ULONG result)
+{
+       // decide what to do
+       if( action == EXIT_THREAD)
+       {
+               NtTerminateThread( NULL, result );
+       }
+       else    // EXIT_PROCESS
+       {
+               NtTerminateProcess( NULL, result );
+       }
+}
+
diff --git a/os2/server/makefile b/os2/server/makefile
new file mode 100644 (file)
index 0000000..87a600d
--- /dev/null
@@ -0,0 +1,29 @@
+# $Id: makefile,v 1.1 2002/03/23 19:23:28 robertk Exp $
+
+PATH_TO_TOP = ../../..
+
+TARGET_TYPE = program
+
+TARGET_APPTYPE = native
+
+TARGET_NAME = os2ss
+
+TARGET_INSTALLDIR = system32
+
+TARGET_CFLAGS = -D__NTAPP__
+
+#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/os2ss.cpp b/os2/server/os2ss.cpp
new file mode 100644 (file)
index 0000000..2ab2050
--- /dev/null
@@ -0,0 +1,115 @@
+/* $Id: os2ss.cpp,v 1.1 2002/03/23 19:23:28 robertk 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>
+
+
+/* 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 );
+}
\ No newline at end of file
diff --git a/os2/utils/EXE386.H b/os2/utils/EXE386.H
new file mode 100644 (file)
index 0000000..cd78aff
--- /dev/null
@@ -0,0 +1,558 @@
+
+#ifndef __LX_EXE__
+#define __LX_EXE__
+
+
+#pragma pack(1)    /* Force byte alignment */
+
+
+
+    /*_________________________________________________________________*
+     |                                                                 |
+     |                                                                 |
+     |  OS/2 .EXE FILE HEADER DEFINITION - 386 version 0:32            |
+     |                                                                 |
+     |_________________________________________________________________|
+     *                                                                 */
+
+
+#define BITPERWORD      16
+#define BITPERBYTE      8
+#define OBJPAGELEN      4096
+#define E32MAGIC        0x584c     /* New magic number  "LX" */
+#define E32RESBYTES1    0          /* First bytes reserved */
+#define E32RESBYTES2    0          /* Second bytes reserved */
+#define E32RESBYTES3    20         /* Third bytes reserved */
+#define E32LEBO         0x00       /* Little Endian Byte Order */
+#define E32BEBO         0x01       /* Big Endian Byte Order */
+#define E32LEWO         0x00       /* Little Endian Word Order */
+#define E32BEWO         0x01       /* Big Endian Word Order */
+#define E32LEVEL        0L         /* 32-bit EXE format level */
+#define E32CPU286       0x001      /* Intel 80286 or upwardly compatibile */
+#define E32CPU386       0x002      /* Intel 80386 or upwardly compatibile */
+#define E32CPU486       0x003      /* Intel 80486 or upwardly compatibile */
+
+
+
+struct lx_exe                          /* New 32-bit .EXE header for OS/2 EXEs and DLLs*/
+{
+    unsigned short      magic;         /* Magic number E32_MAGIC */
+    unsigned char       border;     /* The byte ordering for the .EXE */
+    unsigned char       worder;     /* The word ordering for the .EXE */
+    unsigned long       level;      /* The EXE format level for now = 0 */
+    unsigned short      cpu;        /* The CPU type */
+    unsigned short      os;         /* The OS type */
+    unsigned long       ver;        /* Module version */
+    unsigned long       mflags;     /* Module flags */
+    unsigned long       mpages;     /* Module # pages */
+    unsigned long       startobj;   /* Object # for instruction pointer */
+    unsigned long       eip;        /* Extended instruction pointer */
+    unsigned long       stackobj;   /* Object # for stack pointer */
+    unsigned long       esp;        /* Extended stack pointer */
+    unsigned long       pagesize;   /* .EXE page size */
+    unsigned long       pageshift;  /* Page alignment shift in .EXE */
+    unsigned long       fixupsize;  /* Fixup section size */
+    unsigned long       fixupsum;   /* Fixup section checksum */
+    unsigned long       ldrsize;    /* Loader section size */
+    unsigned long       ldrsum;     /* Loader section checksum */
+    unsigned long       objtab;     /* Object table offset */
+    unsigned long       objcnt;     /* Number of objects in module */
+    unsigned long       objmap;     /* Object page map offset */
+    unsigned long       itermap;    /* Object iterated data map offset */
+    unsigned long       rsrctab;    /* Offset of Resource Table */
+    unsigned long       rsrccnt;    /* Number of resource entries */
+    unsigned long       restab;     /* Offset of resident name table */
+    unsigned long       enttab;     /* Offset of Entry Table */
+    unsigned long       dirtab;     /* Offset of Module Directive Table */
+    unsigned long       dircnt;     /* Number of module directives */
+    unsigned long       fpagetab;   /* Offset of Fixup Page Table */
+    unsigned long       frectab;    /* Offset of Fixup Record Table */
+    unsigned long       impmod;     /* Offset of Import Module Name Table */
+    unsigned long       impmodcnt;  /* Number of entries in Import Module Name Table */
+    unsigned long       impproc;    /* Offset of Import Procedure Name Table */
+    unsigned long       pagesum;    /* Offset of Per-Page Checksum Table */
+    unsigned long       datapage;   /* Offset of Enumerated Data Pages */
+    unsigned long       preload;    /* Number of preload pages */
+    unsigned long       nrestab;    /* Offset of Non-resident Names Table */
+    unsigned long       cbnrestab;  /* Size of Non-resident Name Table */
+    unsigned long       nressum;    /* Non-resident Name Table Checksum */
+    unsigned long       autodata;   /* Object # for automatic data object */
+    unsigned long       debuginfo;  /* Offset of the debugging information */
+    unsigned long       debuglen;   /* The length of the debugging info. in bytes */
+    unsigned long       instpreload;/* Number of instance pages in preload section of .EXE file */
+    unsigned long       instdemand; /* Number of instance pages in demand load section of .EXE file */
+    unsigned long       heapsize;   /* Size of heap - for 16-bit apps */
+    unsigned long       stacksize;  /* Size of stack */
+    unsigned char       res3[E32RESBYTES3];
+                                        /* Pad structure to 196 bytes */
+  };
+
+
+
+
+/*
+ *  Format of lx_exe.mflags:
+ *
+ *  Low word has the following format:
+ *
+ *  15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0  - bit no
+ *   |     |          | |     | | | |
+ *   |     |          | |     | | | +------- Per-Process Library Initialization
+ *   |     |          | |     | | +--------- SystemDLL (internal fixups discarded)
+ *   |     |          | |     | +----------- No Internal Fixups for Module in .EXE
+ *   |     |          | |     +------------- No External Fixups for Module in .EXE
+ *   |     |          | +------------------- Incompatible with PM Windowing
+ *   |     |          +--------------------- Compatible with PM Windowing
+ *   |     |                                 Uses PM Windowing API
+ *   |     +-------------------------------- Module not Loadable
+ *   +-------------------------------------- Library Module
+ */
+
+
+#define E32NOTP          0x8000L        /* Library Module - used as NENOTP */
+#define E32NOLOAD        0x2000L        /* Module not Loadable */
+#define E32PMAPI         0x0300L        /* Uses PM Windowing API */
+#define E32PMW           0x0200L        /* Compatible with PM Windowing */
+#define E32NOPMW         0x0100L        /* Incompatible with PM Windowing */
+#define E32NOEXTFIX      0x0020L        /* NO External Fixups in .EXE */
+#define E32NOINTFIX      0x0010L        /* NO Internal Fixups in .EXE */
+#define E32SYSDLL        0x0008L        /* System DLL, Internal Fixups discarded*/
+#define E32LIBINIT       0x0004L        /* Per-Process Library Initialization */
+#define E32LIBTERM       0x40000000L    /* Per-Process Library Termination */
+#define E32APPMASK       0x0300L        /* Application Type Mask */
+
+
+/*
+ *  Format of E32_MFLAGS(x):
+ *
+ *  High word has the following format:
+ *
+ *  15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0  - bit no
+ *                                    | |
+ *                                    | +--- Protected memory library module
+ *                                    +----- Device driver
+ */
+
+#define E32PROTDLL       0x10000L       /* Protected memory library module */
+#define E32DEVICE        0x20000L       /* Device driver                   */
+#define E32MODEXE        0x00000L       /* .EXE module                     */
+#define E32MODDLL        0x08000L       /* .DLL module                     */
+#define E32MODPROTDLL    0x18000L       /* Protected memory library module */
+#define E32MODPDEV       0x20000L       /* Physical device driver          */
+#define E32MODVDEV       0x28000L       /* Virtual device driver           */
+#define E32MODMASK       0x38000L       /* Module type mask                */
+
+/*
+ *  RELOCATION DEFINITIONS - RUN-TIME FIXUPS
+ */
+
+
+
+
+typedef union _offset
+{
+    unsigned short offset16;
+    unsigned long  offset32;
+}
+    offset;                             /* 16-bit or 32-bit offset */
+
+
+/***ET+ r32_rlc - Relocation item */
+
+struct r32_rlc                          /* Relocation item */
+{
+    unsigned char       nr_stype;       /* Source type - field shared with new_rlc */
+    unsigned char       nr_flags;       /* Flag byte - field shared with new_rlc */
+    short               r32_soff;       /* Source offset */
+    unsigned short      r32_objmod;     /* Target object number or Module ordinal */
+
+    union targetid
+    {
+        offset             intref;      /* Internal fixup */
+
+        union extfixup
+        {
+            offset         proc;        /* Procedure name offset */
+            unsigned long  ord;         /* Procedure odrinal */
+        }
+                           extref;      /* External fixup */
+
+        struct addfixup
+        {
+            unsigned short entry;       /* Entry ordinal */
+            offset         addval;      /* Value added to the address */
+        }
+                           addfix;      /* Additive fixup */
+    }
+                        r32_target;     /* Target data */
+    unsigned short      r32_srccount;   /* Number of chained fixup records */
+    unsigned short      r32_chain;      /* Chain head */
+};
+
+
+
+/*
+ *  In 32-bit .EXE file run-time relocations are written as varying size
+ *  records, so we need many size definitions.
+ */
+
+#define RINTSIZE16      8
+#define RINTSIZE32      10
+#define RORDSIZE        8
+#define RNAMSIZE16      8
+#define RNAMSIZE32      10
+#define RADDSIZE16      10
+#define RADDSIZE32      12
+
+
+
+#if FALSE
+/*
+ *  Access macros defined in NEWEXE.H !!!
+ */
+#define NR_STYPE(x)      (x).nr_stype
+#define NR_FLAGS(x)      (x).nr_flags
+#endif
+
+#define R32_SOFF(x)      (x).r32_soff
+#define R32_OBJNO(x)     (x).r32_objmod
+#define R32_MODORD(x)    (x).r32_objmod
+#define R32_OFFSET16(x)  (x).r32_target.intref.offset16
+#define R32_OFFSET32(x)  (x).r32_target.intref.offset32
+#define R32_PROCOFF16(x) (x).r32_target.extref.proc.offset16
+#define R32_PROCOFF32(x) (x).r32_target.extref.proc.offset32
+#define R32_PROCORD(x)   (x).r32_target.extref.ord
+#define R32_ENTRY(x)     (x).r32_target.addfix.entry
+#define R32_ADDVAL16(x)  (x).r32_target.addfix.addval.offset16
+#define R32_ADDVAL32(x)  (x).r32_target.addfix.addval.offset32
+#define R32_SRCCNT(x)    (x).r32_srccount
+#define R32_CHAIN(x)     (x).r32_chain
+
+
+
+/*
+ *  Format of NR_STYPE(x)
+ *
+ *       7 6 5 4 3 2 1 0  - bit no
+ *           | | | | | |
+ *           | | +-+-+-+--- Source type
+ *           | +----------- Fixup to 16:16 alias
+ *           +------------- List of source offset follows fixup record
+ */
+
+#if FALSE
+
+            /* DEFINED in newexe.h !!! */
+
+#define NRSTYP          0x0f            /* Source type mask */
+#define NRSBYT          0x00            /* lo byte (8-bits)*/
+#define NRSSEG          0x02            /* 16-bit segment (16-bits) */
+#define NRSPTR          0x03            /* 16:16 pointer (32-bits) */
+#define NRSOFF          0x05            /* 16-bit offset (16-bits) */
+#define NRPTR48         0x06            /* 16:32 pointer (48-bits) */
+#define NROFF32         0x07            /* 32-bit offset (32-bits) */
+#define NRSOFF32        0x08            /* 32-bit self-relative offset (32-bits) */
+#endif
+
+
+#define NRSRCMASK       0x0f            /* Source type mask */
+#define NRALIAS         0x10            /* Fixup to alias */
+#define NRCHAIN         0x20            /* List of source offset follows */
+                                        /* fixup record, source offset field */
+                                        /* in fixup record contains number */
+                                        /* of elements in list */
+
+/*
+ *  Format of NR_FLAGS(x) and R32_FLAGS(x):
+ *
+ *       7 6 5 4 3 2 1 0  - bit no
+ *       | | | |   | | |
+ *       | | | |   | +-+--- Reference type
+ *       | | | |   +------- Additive fixup
+ *       | | | +----------- 32-bit Target Offset Flag (1 - 32-bit; 0 - 16-bit)
+ *       | | +------------- 32-bit Additive Flag (1 - 32-bit; 0 - 16-bit)
+ *       | +--------------- 16-bit Object/Module ordinal (1 - 16-bit; 0 - 8-bit)
+ *       +----------------- 8-bit import ordinal (1 - 8-bit;
+ *                                                0 - NR32BITOFF toggles
+ *                                                    between 16 and 32 bit
+ *                                                    ordinal)
+ */
+
+#if FALSE
+
+            /* DEFINED in newexe.h !!! */
+
+#define NRRTYP          0x03            /* Reference type mask */
+#define NRRINT          0x00            /* Internal reference */
+#define NRRORD          0x01            /* Import by ordinal */
+#define NRRNAM          0x02            /* Import by name */
+#define NRADD           0x04            /* Additive fixup */
+#endif
+
+#define NRRENT          0x03            /* Internal entry table fixup */
+
+#define NR32BITOFF      0x10            /* 32-bit Target Offset */
+#define NR32BITADD      0x20            /* 32-bit Additive fixup */
+#define NR16OBJMOD      0x40            /* 16-bit Object/Module ordinal */
+#define NR8BITORD       0x80            /* 8-bit import ordinal */
+/*end*/
+
+/*
+ *  Data structures for storing run-time fixups in linker virtual memory.
+ *
+ *  Each object has a list of Object Page Directories which specify
+ *  fixups for given page. Each page has its own hash table which is
+ *  used to detect fixups to the same target.
+ */
+
+#define PAGEPERDIR      62
+#define LG2DIR          7
+
+
+typedef struct _OBJPAGEDIR
+{
+    DWORD   next;                       /* Virtual pointer to next dir on list */
+    WORD    ht[PAGEPERDIR];             /* Pointers to individual hash tables */
+}
+    OBJPAGEDIR;
+
+
+
+/*
+ *  OBJECT TABLE
+ */
+
+/***ET+ o32_obj Object Table Entry */
+
+struct o32_obj                          /* Flat .EXE object table entry */
+{
+    unsigned long       o32_size;       /* Object virtual size */
+    unsigned long       o32_base;       /* Object base virtual address */
+    unsigned long       o32_flags;      /* Attribute flags */
+    unsigned long       o32_pagemap;    /* Object page map index */
+    unsigned long       o32_mapsize;    /* Number of entries in object page map */
+    unsigned long       o32_reserved;   /* Reserved */
+};
+
+
+#define O32_SIZE(x)     (x).o32_size
+#define O32_BASE(x)     (x).o32_base
+#define O32_FLAGS(x)    (x).o32_flags
+#define O32_PAGEMAP(x)  (x).o32_pagemap
+#define O32_MAPSIZE(x)  (x).o32_mapsize
+#define O32_RESERVED(x) (x).o32_reserved
+
+
+
+/*
+ *  Format of O32_FLAGS(x)
+ *
+ *  High word of dword flag field is not used for now.
+ *  Low word has the following format:
+ *
+ *  15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0  - bit no
+ *   |  |  |  |     | | | | | | | | | | |
+ *   |  |  |  |     | | | | | | | | | | +--- Readable Object
+ *   |  |  |  |     | | | | | | | | | +----- Writeable Object
+ *   |  |  |  |     | | | | | | | | +------- Executable Object
+ *   |  |  |  |     | | | | | | | +--------- Resource Object
+ *   |  |  |  |     | | | | | | +----------- Object is Discardable
+ *   |  |  |  |     | | | | | +------------- Object is Shared
+ *   |  |  |  |     | | | | +--------------- Object has preload pages
+ *   |  |  |  |     | | | +----------------- Object has invalid pages
+ *   |  |  |  |     | | +------------------- Object is permanent and swappable
+ *   |  |  |  |     | +--------------------- Object is permanent and resident
+ *   |  |  |  |     +----------------------- Object is permanent and long lockable
+ *   |  |  |  +----------------------------- 16:16 alias required (80x86 specific)
+ *   |  |  +-------------------------------- Big/Default bit setting (80x86 specific)
+ *   |  +----------------------------------- Object is conforming for code (80x86 specific)
+ *   +-------------------------------------- Object I/O privilege level (80x86 specific)
+ *
+ */
+
+#define OBJREAD         0x0001L             /* Readable Object   */
+#define OBJWRITE        0x0002L             /* Writeable Object  */
+#define OBJRSRC         0x0008L             /* Resource Object   */
+#define OBJINVALID      0x0080L             /* Object has invalid pages  */
+#define LNKNONPERM      0x0600L             /* Object is nonpermanent - should be */
+#define OBJNONPERM      0x0000L             /* zero in the .EXE but LINK386 uses 6 */
+#define OBJPERM         0x0100L             /* Object is permanent and swappable */
+#define OBJRESIDENT     0x0200L             /* Object is permanent and resident */
+#define OBJCONTIG       0x0300L             /* Object is resident and contiguous */
+#define OBJDYNAMIC      0x0400L             /* Object is permanent and long locable */
+#define OBJTYPEMASK     0x0700L             /* Object type mask */
+#define OBJALIAS16      0x1000L             /* 16:16 alias required (80x86 specific)           */
+#define OBJBIGDEF       0x2000L             /* Big/Default bit setting (80x86 specific)        */
+#define OBJIOPL         0x8000L             /* Object I/O privilege level (80x86 specific)     */
+#if FOR_EXEHDR
+/*
+ *  Name these flags differently for EXEHDR.EXE - avoid conflicts with 286 version
+ */
+#define OBJDISCARD       0x0010L            /* Object is Discardable */
+#define OBJSHARED        0x0020L            /* Object is Shared */
+#define OBJPRELOAD       0x0040L            /* Object has preload pages  */
+#define OBJEXEC          0x0004L            /* Executable Object */
+#define OBJCONFORM       0x4000L            /* Object is conforming for code (80x86 specific)  */
+#else
+/*
+ *  Life will be easier, if we keep the same names for the following flags:
+ */
+#define NSDISCARD       0x0010L             /* Object is Discardable */
+#define NSMOVE          NSDISCARD           /* Moveable object is for sure Discardable */
+#define NSSHARED        0x0020L             /* Object is Shared */
+#define NSPRELOAD       0x0040L             /* Object has preload pages  */
+#define NSEXRD          0x0004L             /* Executable Object */
+#define NSCONFORM       0x4000L             /* Object is conforming for code (80x86 specific)  */
+#endif
+/*end*/
+
+/***ET+ o32_map - Object Page Map entry */
+
+struct o32_map                              /* Object Page Table entry */
+{
+    unsigned long   o32_pagedataoffset;     /* file offset of page */
+    unsigned short  o32_pagesize;           /* # bytes of page data */
+    unsigned short  o32_pageflags;          /* Per-Page attributes */
+};
+
+
+#define GETPAGEIDX(x)    ((x).o32_pagedataoffset)
+
+#define PUTPAGEIDX(x,i)  ((x).o32_pagedataoffset = ((unsigned long)(i)))
+
+#define PUTPAGESIZ(x,i)  ((x).o32_pagesize = ((unsigned int)(i)))
+
+#define GETPAGESIZ(x)    ((x).o32_pagesize)
+
+#define PAGEFLAGS(x)    (x).o32_pageflags
+
+
+#define VALID           0x0000                /* Valid Physical Page in .EXE */
+#define ITERDATA        0x0001                /* Iterated Data Page */
+#define INVALID         0x0002                /* Invalid Page */
+#define ZEROED          0x0003                /* Zero Filled Page */
+#define RANGE           0x0004                /* Range of pages */
+#define ITERDATA2       0x0005                /* Iterated Data Page Type II */
+/*end*/
+
+/*
+ *  RESOURCE TABLE
+ */
+
+/***ET+ rsrc32 - Resource Table Entry */
+
+struct rsrc32                               /* Resource Table Entry */
+{
+    unsigned short      type;               /* Resource type */
+    unsigned short      name;               /* Resource name */
+    unsigned long       cb;                 /* Resource size */
+    unsigned short      obj;                /* Object number */
+    unsigned long       offset;             /* Offset within object */
+};
+/*end*/
+
+
+ /*
+  * Iteration Record format for 'EXEPACK'ed pages.
+  */
+struct LX_Iter
+{
+    unsigned short LX_nIter;            /* number of iterations */
+    unsigned short LX_nBytes;           /* number of bytes */
+    unsigned char  LX_Iterdata;         /* iterated data byte(s) */
+};
+
+
+/*
+ *  ENTRY TABLE DEFINITIONS
+ */
+
+/***ET+ b32_bundle - Entry Table */
+
+struct b32_bundle
+{
+    unsigned char       b32_cnt;        /* Number of entries in this bundle */
+    unsigned char       b32_type;       /* Bundle type */
+    unsigned short      b32_obj;        /* Object number */
+};                                      /* Follows entry types */
+
+struct e32_entry
+{
+    unsigned char       e32_flags;      /* Entry point flags */
+    union entrykind
+    {
+        offset          e32_offset;     /* 16-bit/32-bit offset entry */
+        struct callgate
+        {
+            unsigned short offset;      /* Offset in segment */
+            unsigned short callgate;    /* Callgate selector */
+        }
+                        e32_callgate;   /* 286 (16-bit) call gate */
+        struct fwd
+        {
+            unsigned short  modord;     /* Module ordinal number */
+            unsigned long   value;      /* Proc name offset or ordinal */
+        }
+                        e32_fwd;        /* Forwarder */
+    }
+                        e32_variant;    /* Entry variant */
+};
+
+
+
+#define B32_CNT(x)      (x).b32_cnt
+#define B32_TYPE(x)     (x).b32_type
+#define B32_OBJ(x)      (x).b32_obj
+
+#define E32_EFLAGS(x)   (x).e32_flags
+#define E32_OFFSET16(x) (x).e32_variant.e32_offset.offset16
+#define E32_OFFSET32(x) (x).e32_variant.e32_offset.offset32
+#define E32_GATEOFF(x)  (x).e32_variant.e32_callgate.offset
+#define E32_GATE(x)     (x).e32_variant.e32_callgate.callgate
+#define E32_MODORD(x)   (x).e32_variant.e32_fwd.modord
+#define E32_VALUE(x)    (x).e32_variant.e32_fwd.value
+
+#define FIXENT16        3
+#define FIXENT32        5
+#define GATEENT16       5
+#define FWDENT          7
+
+/*
+ *  BUNDLE TYPES
+ */
+
+#define EMPTY        0x00               /* Empty bundle */
+#define ENTRY16      0x01               /* 16-bit offset entry point */
+#define GATE16       0x02               /* 286 call gate (16-bit IOPL) */
+#define ENTRY32      0x03               /* 32-bit offset entry point */
+#define ENTRYFWD     0x04               /* Forwarder entry point */
+#define TYPEINFO     0x80               /* Typing information present flag */
+
+
+/*
+ *  Format for E32_EFLAGS(x)
+ *
+ *       7 6 5 4 3 2 1 0  - bit no
+ *       | | | | | | | |
+ *       | | | | | | | +--- exported entry
+ *       | | | | | | +----- uses shared data
+ *       +-+-+-+-+-+------- parameter word count
+ */
+
+#define E32EXPORT       0x01            /* Exported entry */
+#define E32SHARED       0x02            /* Uses shared data */
+#define E32PARAMS       0xf8            /* Parameter word count mask */
+
+/*
+ *  Flags for forwarders only:
+ */
+
+#define FWD_ORDINAL     0x01            /* Imported by ordinal */
+
+
+#pragma pack()       /* Restore default alignment */
+
+/*end*/
+
+#endif /* __LX_EXE__ */
+
diff --git a/os2/utils/LXDUMP.EXE b/os2/utils/LXDUMP.EXE
new file mode 100644 (file)
index 0000000..ba1ce70
Binary files /dev/null and b/os2/utils/LXDUMP.EXE differ
diff --git a/os2/utils/lxtest.EXE b/os2/utils/lxtest.EXE
new file mode 100644 (file)
index 0000000..b9911f3
Binary files /dev/null and b/os2/utils/lxtest.EXE differ