1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- S Y S T E M . W I N 3 2 . E X T --
9 -- Copyright (C) 2008, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- This package provides the part of the low level Win32 interface which is
35 -- not supported by RTX (but supported by regular Windows platforms).
37 package System.Win32.Ext is
44 function QueryPerformanceFrequency
45 (lpFrequency : access LARGE_INTEGER) return Win32.BOOL;
47 (Stdcall, QueryPerformanceFrequency, "QueryPerformanceFrequency");
53 function SetThreadIdealProcessor
55 dwIdealProcessor : ProcessorId) return DWORD;
56 pragma Import (Stdcall, SetThreadIdealProcessor, "SetThreadIdealProcessor");
62 DTR_CONTROL_DISABLE : constant := 16#0#;
63 RTS_CONTROL_DISABLE : constant := 16#0#;
64 NOPARITY : constant := 0;
65 ODDPARITY : constant := 1;
66 EVENPARITY : constant := 2;
67 ONESTOPBIT : constant := 0;
68 TWOSTOPBITS : constant := 2;
78 fDsrSensitivity : Bits1;
79 fTXContinueOnXoff : Bits1;
85 fAbortOnError : Bits1;
100 pragma Convention (C, DCB);
103 DCBLENGTH at 0 range 0 .. 31;
104 BaudRate at 4 range 0 .. 31;
105 fBinary at 8 range 0 .. 0;
106 fParity at 8 range 1 .. 1;
107 fOutxCtsFlow at 8 range 2 .. 2;
108 fOutxDsrFlow at 8 range 3 .. 3;
109 fDtrControl at 8 range 4 .. 5;
110 fDsrSensitivity at 8 range 6 .. 6;
111 fTXContinueOnXoff at 8 range 7 .. 7;
112 fOutX at 9 range 0 .. 0;
113 fInX at 9 range 1 .. 1;
114 fErrorChar at 9 range 2 .. 2;
115 fNull at 9 range 3 .. 3;
116 fRtsControl at 9 range 4 .. 5;
117 fAbortOnError at 9 range 6 .. 6;
118 fDummy2 at 9 range 7 .. 23;
119 wReserved at 12 range 0 .. 15;
120 XonLim at 14 range 0 .. 15;
121 XoffLim at 16 range 0 .. 15;
122 ByteSize at 18 range 0 .. 7;
123 Parity at 19 range 0 .. 7;
124 StopBits at 20 range 0 .. 7;
125 XonChar at 21 range 0 .. 7;
126 XoffChar at 22 range 0 .. 7;
127 ErrorChar at 23 range 0 .. 7;
128 EofChar at 24 range 0 .. 7;
129 EvtChar at 25 range 0 .. 7;
130 wReserved1 at 26 range 0 .. 15;
133 type COMMTIMEOUTS is record
134 ReadIntervalTimeout : DWORD;
135 ReadTotalTimeoutMultiplier : DWORD;
136 ReadTotalTimeoutConstant : DWORD;
137 WriteTotalTimeoutMultiplier : DWORD;
138 WriteTotalTimeoutConstant : DWORD;
140 pragma Convention (C, COMMTIMEOUTS);
142 function GetCommState
144 lpDCB : access DCB) return BOOL;
145 pragma Import (Stdcall, GetCommState, "GetCommState");
147 function SetCommState
149 lpDCB : access DCB) return BOOL;
150 pragma Import (Stdcall, SetCommState, "SetCommState");
152 function SetCommTimeouts
154 lpCommTimeouts : access COMMTIMEOUTS) return BOOL;
155 pragma Import (Stdcall, SetCommTimeouts, "SetCommTimeouts");
157 end System.Win32.Ext;