From 74fb7ca61d0855c36a6491b10b52182e59191b43 Mon Sep 17 00:00:00 2001 From: Tomas Hajny Date: Sun, 4 Nov 2007 22:17:29 +0000 Subject: [PATCH] + aliases to TPipeSemState field names for improved compatibility and overloaded version of DosQueryNPipeSemState using this type git-svn-id: trunk@9139 - --- rtl/os2/doscalls.pas | 54 ++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/rtl/os2/doscalls.pas b/rtl/os2/doscalls.pas index 61f5020478..0c75ba9870 100644 --- a/rtl/os2/doscalls.pas +++ b/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;