2
0
Эх сурвалжийг харах

+ aliases to TPipeSemState field names for improved compatibility and overloaded version of DosQueryNPipeSemState using this type

git-svn-id: trunk@9139 -
Tomas Hajny 17 жил өмнө
parent
commit
74fb7ca61d
1 өөрчлөгдсөн 34 нэмэгдсэн , 20 устгасан
  1. 34 20
      rtl/os2/doscalls.pas

+ 34 - 20
rtl/os2/doscalls.pas

@@ -2912,27 +2912,35 @@ function DosStopSession (Scope, SesID: cardinal): cardinal; cdecl;
 
 ****************************************************************************}
 
-type    TAvailData=record
-            cbPipe,             {Number of bytes in pipe.}
-            cbMessage:word;     {Number of bytes in current message.}
-        end;
+type
+  TAvailData = record
+    cbPipe,              {Number of bytes in pipe.}
+    cbMessage: word;     {Number of bytes in current message.}
+  end;
 
-        TPipeInfo=record
-            cbOut:word;         {Size of outbound data.}
-            cbIn:word;          {Size of inbound data.}
-            MaxInst:byte;       {Maximum number of instances.}
-            CurInst:byte;       {Current number of instances.}
-            Name:string;        {Name of the pipe. You can use @Name[1] if
-                                 you need a PChar to the name; the string is
-                                 always followed by a zero.}
-        end;
+  TPipeInfo = record
+    cbOut: word;         {Size of outbound data.}
+    cbIn: word;          {Size of inbound data.}
+    MaxInst: byte;       {Maximum number of instances.}
+    CurInst: byte;       {Current number of instances.}
+    Name: string;        {Name of the pipe. You can use @Name[1] if
+                          you need a PChar to the name; the string is
+                          always followed by a zero.}
+  end;
 
-        TPipeSemState=record
-            Status:byte;
-            Flag:byte;
-            Key:word;
-            Avail:word;
-        end;
+  TPipeSemState = record
+    case boolean of
+      false: (Status: byte;
+              Flag: byte;
+              Key: word;
+              Avail: word);
+      true:  (fStatus: byte;
+              fFlag: byte;
+              usKey: word;
+              usAvail: word);
+  end;
+  PPipeSemState = ^TPipeSemState;
+  TPipeSemStates = array [0..$FFFF] of TPipeSemState;
 
 {Create an unnamed pipe.
  ReadHandle     = Receives handle for reading from pipe.
@@ -3064,6 +3072,8 @@ function DosQueryNPipeInfo (Handle: THandle; InfoLevel: cardinal; var Buffer;
  BufSize        = Size of SemArray, in bytes.}
 function DosQueryNPipeSemState (SemHandle: THandle; var SemArray;
                                 BufSize: cardinal): cardinal; cdecl;
+function DosQueryNPipeSemState (SemHandle: THandle; SemArray: PPipeSemState;
+                                           BufSize: cardinal): cardinal; cdecl;
 
 {Resets the blocking mode and state of a named pipe.
  Handle         = Handle to named pipe.
@@ -5088,7 +5098,11 @@ function DosQueryNPipeInfo (Handle: THandle; InfoLevel: cardinal; var Buffer;
 external 'DOSCALLS' index 248;
 
 function DosQueryNPipeSemState (SemHandle: THandle; var SemArray;
-                                BufSize: cardinal): cardinal; cdecl;
+                                           BufSize: cardinal): cardinal; cdecl;
+external 'DOSCALLS' index 249;
+
+function DosQueryNPipeSemState (SemHandle: THandle; SemArray: PPipeSemState;
+                                           BufSize: cardinal): cardinal; cdecl;
 external 'DOSCALLS' index 249;
 
 function DosSetNPHState (Handle: THandle; State: cardinal):cardinal; cdecl;