Pārlūkot izejas kodu

* added some missing constants and TResultCodes fields alias names

git-svn-id: trunk@19397 -
Tomas Hajny 14 gadi atpakaļ
vecāks
revīzija
9edae25cae
1 mainītis faili ar 21 papildinājumiem un 12 dzēšanām
  1. 21 12
      rtl/os2/doscalls.pas

+ 21 - 12
rtl/os2/doscalls.pas

@@ -383,11 +383,15 @@ const   deSync          = 0;    {Wait until program terminates.}
         EXEC_ASYNCRESULTDB =deAsyncResultDb;
         EXEC_ASYNCRESULTDB =deAsyncResultDb;
 
 
 type    TResultCodes=record
 type    TResultCodes=record
-            TerminateReason,        {0 = Normal termionation.
+         case byte of
+          0: (
+            TerminateReason,        {0 = Normal termination.
                                      1 = Critical error.
                                      1 = Critical error.
                                      2 = Trapped. (GPE, etc.)
                                      2 = Trapped. (GPE, etc.)
                                      3 = Killed by DosKillProcess.}
                                      3 = Killed by DosKillProcess.}
-            ExitCode:cardinal;      {Exit code of child.}
+            ExitCode:cardinal);     {Exit code of child.}
+          1: (CodeTerminate: cardinal); {For compatibility only}
+          2: (PID: cardinal);  {Process ID returned for asynchronous execution}
         end;
         end;
 
 
 {Execute a program.
 {Execute a program.
@@ -411,10 +415,15 @@ function DosExecPgm(var ObjName:string;ExecFlag:cardinal;
                     Args,Env:PByteArray;var Res:TResultCodes;
                     Args,Env:PByteArray;var Res:TResultCodes;
                     const FileName:string):cardinal;
                     const FileName:string):cardinal;
 
 
+const
+  DCWA_PROCESS     = 0;
+  DCWA_PROCESSTREE = 1;
+
 {Wait until a child process terminated. Sometimes called DosCWait.
 {Wait until a child process terminated. Sometimes called DosCWait.
 
 
-Action              = 0 = Wait until child terminates.
-                      1 = Wait until child and all its childs terminate.
+Action              = 0 = Wait until child terminates (DCWA_PROCESS).
+                      1 = Wait until child and all its childs terminate
+                      (DCWA_PROCESSTREE).
 Option              = Flags. Either dtWait or dtNoWait.
 Option              = Flags. Either dtWait or dtNoWait.
 Res                 = See TResultCodes.
 Res                 = See TResultCodes.
 TermPID             = Process ID that has been terminated. Usefull when
 TermPID             = Process ID that has been terminated. Usefull when
@@ -863,17 +872,17 @@ function DosProtectRead (Handle: THandle; var Buffer; Count: cardinal;
     Buffer      = The data to be written.
     Buffer      = The data to be written.
     Count       = Number of bytes to write.
     Count       = Number of bytes to write.
     ActCount    = Number of bytes actually written.}
     ActCount    = Number of bytes actually written.}
-function DosWrite (Handle: longint; var Buffer; Count: longint;
+function DosWrite (Handle: longint; const Buffer; Count: longint;
                   var ActCount:longint):cardinal; cdecl;
                   var ActCount:longint):cardinal; cdecl;
 
 
-function DosWrite (Handle: THandle; var Buffer; Count: cardinal;
+function DosWrite (Handle: THandle; const Buffer; Count: cardinal;
                   var ActCount:cardinal):cardinal; cdecl;
                   var ActCount:cardinal):cardinal; cdecl;
 
 
-function DosProtectWrite (Handle: longint; var Buffer; Count: longint;
+function DosProtectWrite (Handle: longint; const Buffer; Count: longint;
                           var ActCount: longint;
                           var ActCount: longint;
                           FileHandleLockID: cardinal): cardinal; cdecl;
                           FileHandleLockID: cardinal): cardinal; cdecl;
 
 
-function DosProtectWrite (Handle: THandle; var Buffer; Count: cardinal;
+function DosProtectWrite (Handle: THandle; const Buffer; Count: cardinal;
                           var ActCount: cardinal;
                           var ActCount: cardinal;
                           FileHandleLockID: cardinal): cardinal; cdecl;
                           FileHandleLockID: cardinal): cardinal; cdecl;
 
 
@@ -3651,20 +3660,20 @@ function DosProtectRead (Handle: THandle; var Buffer; Count: cardinal;
           var ActCount: cardinal; FileHandleLockID: cardinal): cardinal; cdecl;
           var ActCount: cardinal; FileHandleLockID: cardinal): cardinal; cdecl;
 external 'DOSCALLS' index 641;
 external 'DOSCALLS' index 641;
 
 
-function DosWrite(Handle:longint;var Buffer;Count:longint;
+function DosWrite(Handle:longint;const Buffer;Count:longint;
                   var ActCount:longint):cardinal; cdecl;
                   var ActCount:longint):cardinal; cdecl;
 external 'DOSCALLS' index 282;
 external 'DOSCALLS' index 282;
 
 
-function DosWrite (Handle: THandle; var Buffer; Count: cardinal;
+function DosWrite (Handle: THandle; const Buffer; Count: cardinal;
                    var ActCount: cardinal): cardinal; cdecl;
                    var ActCount: cardinal): cardinal; cdecl;
 external 'DOSCALLS' index 282;
 external 'DOSCALLS' index 282;
 
 
-function DosProtectWrite (Handle: longint; var Buffer; Count: longint;
+function DosProtectWrite (Handle: longint; const Buffer; Count: longint;
                           var ActCount: longint;
                           var ActCount: longint;
                           FileHandleLockID: cardinal): cardinal; cdecl;
                           FileHandleLockID: cardinal): cardinal; cdecl;
 external 'DOSCALLS' index 642;
 external 'DOSCALLS' index 642;
 
 
-function DosProtectWrite (Handle: THandle; var Buffer; Count: cardinal;
+function DosProtectWrite (Handle: THandle; const Buffer; Count: cardinal;
                           var ActCount: cardinal;
                           var ActCount: cardinal;
                           FileHandleLockID: cardinal): cardinal; cdecl;
                           FileHandleLockID: cardinal): cardinal; cdecl;
 external 'DOSCALLS' index 642;
 external 'DOSCALLS' index 642;