Initial revision
[AROS-Contrib.git] / development / compilers / freepascal / rtl / os2 / doscalls.pas
blob52d96f26e76a070cc39c5f0f7558edc1e3e47db0
1 {Set tabsize to 4.}
2 {****************************************************************************
4 $Id$
6 DOSCALLS interface unit
7 FPC Pascal Runtime Library for OS/2
8 Copyright (c) 1999-2000 by Florian Klaempfl
9 Copyright (c) 1999-2000 by Daniel Mantione
11 The Free Pascal runtime library is distributed under the Library GNU Public
12 License v2. So is this unit. The Library GNU Public License requires you to
13 distribute the source code of this unit with any product that uses it.
14 Because the EMX library isn't under the LGPL, we grant you an exception to
15 this, and that is, when you compile a program with the Free Pascal Compiler,
16 you do not need to ship source code with that program, AS LONG AS YOU ARE
17 USING UNMODIFIED CODE! If you modify this code, you MUST change the next
18 line:
20 <This an official, unmodified Free Pascal source code file.>
22 Send us your modified files, we can work together if you want!
24 Free Pascal is distributed in the hope that it will be useful,
25 but WITHOUT ANY WARRANTY; without even the implied warranty of
26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 Library GNU General Public License for more details.
29 You should have received a copy of the Library GNU General Public License
30 along with Free Pascal; see the file COPYING.LIB. If not, write to
31 the Free Software Foundation, 59 Temple Place - Suite 330,
32 Boston, MA 02111-1307, USA.
34 ****************************************************************************}
36 unit DosCalls;
38 {This unit was called bsedos in the original OS/2 runtime library.
39 Changed, because it's an interface library to DOSCALLS.DLL.
41 The goal was to make this unit a real Pascal unit instead of a C unit in
42 Pascal clothes. Not that I want to make every translated statement look
43 exactly like other Pascal code, but in this case, it was too crazy.
44 Therefore typenames, constants etc. have names like the ones in IBM's
45 documentation (which is C oriented), but do not match exactly. In general
46 constants do now use the common two letter prefix, followed by the constant
47 description. Type names use a capital T in front of their name, handles do
48 not have separate types, longints are used, and whenever possible pointers
49 were replaced by var parameters. All constructions like 'type LONG=longint'
50 have been removed. Furthermore, most of the procedures also accept strings
51 instead of just a PChar, thanks to that cool feature of procedure
52 overloading.
54 Daniel Mantione,
55 June 1997
57 Please, note, that all calls of the original functions from DOSCALLS.DLL must
58 be declared using cdecl (C calling convention)! This doesn't apply to wrapped
59 around functions, of course (like equivalents of some functions with string
60 instead of PChar).
62 Changelog:
64 People:
65 KOMH - KO Myung-Hun ( komh@chollian.net )
67 Date: Description of change: Changed by:
69 Type of parameter is corrected, KOMH
70 'word' to 'longint'.
71 People:
73 DM - Daniel Mantione
74 TH - Tomas Hajny (XHajT03@mbox.vol.cz on Internet)
76 Date: Description of change: Changed by:
78 - First released version 0.1. DM
79 98/11/21 Mostly cosmetic changes - higher TH
80 level of compatibility with other
81 OS/2 compilers, some Dutch names of
82 parameters changed to English ones,
83 better readability of identifiers,
84 some mistypings corrected etc.
86 Coding style:
88 It may be well possible that coding style feels a bit strange to you.
89 Nevertheless I friendly ask you to try to make your changes not look all
90 too different. To make life easier, set your IDE to use tab characters,
91 turn optimal fill, autoindent and backspace unindents on and set a
92 tabsize of 4.}
94 {****************************************************************************
96 Preprocessor definitions
98 ****************************************************************************}
101 {$IFNDEF FVISION_PSTRING}
102 {$IFNDEF OWN_PSTRING}
103 {$DEFINE FVISION_PSTRING} {Get the PString type from Free Vision.}
104 {$ENDIF}
105 {$ENDIF}
107 {***************************************************************************}
108 interface
109 {***************************************************************************}
111 {$IFDEF OWN_PSTRING}
112 uses Strings;
114 type PString=^string;
115 {$ELSE}
116 {$IFDEF FVISION_PSTRING}
117 uses Strings,Objects;
118 {$ELSE}
119 {$ERROR PString source unknown.}
120 {$ENDIF}
121 {$ENDIF}
123 {$IFDEF FPC}
124 {$PACKRECORDS 1}
125 {$ENDIF FPC}
127 type TByteArray=array[0..$fff0] of byte;
128 PByteArray=^TByteArray;
129 TCharArray=array[0..$fff0] of char;
130 PCharArray=^TCharArray;
131 TWordArray=array[0..$7ff8] of word;
132 PWordArray=^TWordArray;
134 {****************************************************************************
136 Thread related routines.
138 ****************************************************************************}
140 type TThreadEntry = function (Param: pointer): longint; cdecl;
141 ThreadEntry = TThreadEntry;
144 const dtSuspended =1; {Thread is started suspended instead of
145 started at once.}
146 dtStack_Commited =2; {Allocate all stack space at once. The
147 operating system normally allocates more
148 memory to the stack if the stack grows with
149 the given stacksize as limit. This has the
150 restriction that you cannot create a stack
151 frame > 4 kb. at once. If you want to do
152 this, or for other reasons you can allocate
153 the complete stack at once with this flag.}
155 dtWait =0; {Wait until termination.}
156 dtNoWait =1; {Do not wait. Return with error if not yet
157 terminated.}
159 {Create a new thread.
160 TID = Thread ID of new thread is returned here.
161 Address = Thread entry point. The new thread starts executing here.
162 AParam = This one is passed to the thread entry procedure.
163 Flags = Flags. Either dtsuspended or dt_stackcommited.
164 StackSize = Size of the stack of the new thread.}
165 function DosCreateThread(var TID:longint;Address:TThreadEntry;
166 AParam:pointer;Flags,StackSize:longint):longint; cdecl;
168 {Suspend a running thread.}
169 function DosSuspendThread(TID:longint):longint; cdecl;
171 {Resume a suspended thread.}
172 function DosResumeThread(TID:longint):longint; cdecl;
174 {Terminate a specific thread.}
175 function DosKillThread(TID:longint):longint; cdecl;
177 {Wait until a specific thread has ended.
178 TID = Thread to terminate. Can also be zero. In that case we
179 wait until the next thread terminates. Its thread ID is
180 returned back.
181 Option = Flags. Either dtWait or dtNoWait.}
182 function DosWaitThread(var TID:longint;Option:longint):longint; cdecl;
184 {All other threads in the same process are suspended until a
185 DosExitCritSec.}
186 function DosEnterCritSec:longint; cdecl;
188 {Resume the other threads again.}
189 function DosExitCritSec:longint; cdecl;
191 const deThread=0; {Terminate thread only.}
192 deProcess=1; {Terminate the whole process.}
194 {Terminate the thread or the program. Never returns, so it's defined as
195 procedure.}
196 procedure DosExit(Action,Result:longint); cdecl;
198 type PThreadInfoBlock=^TThreadInfoBlock;
199 PPThreadInfoBlock=^PThreadInfoBlock;
200 PSysThreadIB=^TSysThreadIB;
201 PProcessInfoBlock=^TProcessInfoBlock;
202 PPProcessInfoBlock=^PProcessInfoBlock;
204 TThreadInfoBlock=record
205 Exh_Chain, {Head of exeption handler chain.}
206 Stack, {Pointer to the thread's stack.}
207 StackLimit:pointer; {Pointer to the thread's stack-end.}
208 TIB2:PSysThreadIB; {Pointer to system specific thread info.}
209 Version, {Version of this datastructure.}
210 Ordinal:longint; {Thread ordinal number.}
211 end;
212 ThreadInfoBlock=TThreadInfoBlock;
214 TSysThreadIB=record
215 TID, {Thread ID.}
216 Priority, {Low byte of low word: thread priority.
217 High byte of low word: thread class
218 1 = Idle
219 2 = Regular
220 3 = Time critical
221 4 = Server}
222 Version:longint; {Version of this datastructure.}
223 MCCount, {Must complete count. ??? Info wanted!}
224 MCForceFlag:word; {Must complete force flag. Info wanted!}
225 end;
226 SysThreadIB=TSysThreadIB;
228 TProcessInfoBlock=record
229 PID, {Process ID.}
230 ParentPID, {Parent's process ID.}
231 HMTE:longint; {Module handle of executable program.
232 ??? Info wanted!}
233 Cmd, {Command line options.}
234 Env:PByteArray; {Environment strings.}
235 flStatus, {1 means that the process is in exit list
236 processing.}
237 tType:longint; {Type of process:
238 0: Full screen protected mode.
239 1: DOS emulation.
240 2: Windowable full screen protected
241 mode program.
242 3: Presentation manager program.
243 4: Detached mode process.}
244 end;
245 ProcessInfoBlock=TProcessInfoBlock;
247 {OS/2 keeps information about the current process and the current thread
248 is the datastructures Tprocessinfoblock and Tthreadinfoblock. All data
249 can both be read and be changed. Use DosGetInfoBlocks to get their
250 address. The service cannot fail, so it is defined as procedure.
251 The second version of the call might be useful if you only want address
252 of one of those datastructures, since you can supply nil for the other
253 parameter then.}
255 {procedure DosGetInfoBlocks(var ATIB:PThreadInfoBlock;
256 var APIB:PProcessInfoBlock); cdecl;}
257 procedure DosGetInfoBlocks(PATIB:PPThreadInfoBlock;
258 PAPIB:PPProcessInfoBlock); cdecl;
260 {Wait a number of microseconds. Cannot fail, so it is defined as procedure.}
261 procedure DosSleep(MSec:longint); cdecl;
263 {Beep the speaker. You do not need to check for an error if you can
264 guarantee that the frequency is correct.}
265 function DosBeep(Freq,MS:longint):longint; cdecl;
267 {****************************************************************************
269 Process handling routines.
271 ****************************************************************************}
273 {You need a heavy manual if you want to know how this procedure works. Used
274 for writing debuggers.}
275 function DosDebug(DebugBuf:pointer):longint; cdecl;
277 const TC_exit = 0;
278 TC_harderror = 1;
279 TC_trap = 2;
280 TC_killprocess = 3;
281 TC_exception = 4;
283 ExLst_Add = 1;
284 ExLst_Remove = 2;
285 ExLst_Exit = 3;
287 type TExitProc=procedure(Reason:longint); cdecl;
289 {Add/remove an exitprocedure to the exit list. Also used to terminate an
290 exit procedure. An exit procedure will be called on exiting of the program.
292 OrderCode = One of the EXLST_XXXX constants.
293 Proc = Address of the exit procedure.
295 An exit procedure is called with one of the TC_XXXX constants. When it is
296 done it must call DosExitList with ExLst_Exit.
298 Exit procedures are called in random order.}
299 function DosExitList(OrderCode:longint;Proc:TExitProc):longint; cdecl;
301 const deSync = 0; {Wait until program terminates.}
302 deAsync = 1; {Do not wait.}
303 deAsyncResult = 2; {Do not wait. DosWaitChild will follow to
304 check if process has been terminated. If
305 you use this, you must use DosWaitChild,
306 because OS/2 will not free memory that is
307 allocated for the result codes if you don't.}
308 deTrace = 3; {Trace-able. Info Wanted!}
309 deBackground = 4; {Do not run as child. Run in a separate
310 session.}
311 deSuspended = 5; {Child will be loaded, but not executed.}
312 deAsyncResultDb = 6; {?? Info wanted.}
314 type TResultCodes=record
315 TerminateReason, {0 = Normal termionation.
316 1 = Critical error.
317 2 = Trapped. (GPE, etc.)
318 3 = Killed by DosKillProcess.}
319 ExitCode:longint; {Exit code of child.}
320 end;
322 {Execute a program.
324 ObjName = If a DLL cannot be found, its name will be returned here.
325 ObjLen = Size of your ObjName buffer.
326 ExecFlag = One of the deXXXX constants.
327 Res = See TResultcodes.
328 Args = Arguments. ASCIIZ strings. End of Args given by an empty
329 string (#0). First arg must be filename without path and
330 extension. nil is also allowed.
331 Env = Environment. ASCIIZ strings. A variable has the format
332 NAME=CONTENTS. End of Env given by an empty string (#0).
333 nil is also allowed.
334 FileName = Filename with full path and extension. Is not sensitive
335 for the PATH environment variable.}
336 function DosExecPgm(ObjName:PChar;ObjLen,ExecFlag:longint;
337 Args,Env:PByteArray;var Res:TResultCodes;
338 FileName:PChar):longint; cdecl;
339 function DosExecPgm(var ObjName:string;ExecFlag:longint;
340 Args,Env:PByteArray;var Res:TResultCodes;
341 const FileName:string):longint;
343 {Wait until a child process terminated. Sometimes called DosCWait.
345 Action = 0 = Wait until child terminates.
346 1 = Wait until child and all its childs terminate.
347 Option = Flags. Either dtWait or dtNoWait.
348 Res = See TResultCodes.
349 TermPID = Process ID that has been terminated. Usefull when
350 terminating a random process.
351 PID = Process ID of process to terminate. Use a zero to
352 terminate a random process.}
353 function DosWaitChild(Action,Option:longint;var Res:TResultCodes;
354 var TermPID:longint;PID:longint):longint; cdecl;
356 const dpProcess = 0;
357 dpProcessChilds = 1;
358 dpThread = 2;
360 dpSameClass = 0;
361 dpIdleClass = 1;
362 dpRegular = 2;
363 dpTimeCritical = 3;
365 {Set priority of a thread or all threads in another process.
367 Scope = 0 = Set for all threads of a process.
368 1 = Set for all threads of a process and its childs.
369 2 = Set for a thread of the current process.
370 TrClass = 0 = Do not change class.
371 1 = Change to idle time class.
372 2 = Change to regular class.
373 3 = Change to time-critical class.
374 Delta = Value to add to priority. Resulting priority must be in
375 the range 0..31.
376 PortID = Process ID when Scope=0 or 1, thread ID when Scope=2.}
377 function DosSetPriority(Scope,TrClass,Delta,PortID:longint):longint; cdecl;
379 {Terminate a process. If the process isn't a child process, it can refuse
380 to terminate.
382 Action = 0 = Terminate process and all its childs.
383 1 = Terminate process only.
384 PID = Process ID of process to terminate.}
385 function DosKillProcess(Action,PID:longint):longint; cdecl;
387 const AppTyp_NotSpec = $0000; {Apptype is unknown.}
388 AppTyp_NotWindowCompat = $0001; {App cannot run in a window.}
389 AppTyp_WindowCompat = $0002; {App can run in a window.}
390 AppTyp_WindowAPI = $0003; {App uses PM}
391 AppTyp_Bound = $0008; {App uses Family API.}
392 AppTyp_DLL = $0010; {File is a DLL.}
393 AppTyp_DOS = $0020; {App is a PC-DOS program.}
394 AppTyp_PhysDrv = $0040; {App is a physical device driver.}
395 AppTyp_VirtDrv = $0080; {App is virtual device driver.}
396 AppTyp_ProtDLL = $0100; {File is a protected mode DLL.}
397 AppTyp_WindowsReal = $0200; {M$ Winslows app, real mode.}
398 AppTyp_WindowsProt = $0400; {M$ Winslows app, protected mode.}
399 AppTyp_32bit = $4000; {App is 32 bit.}
401 {Get the application type of an executable file on disk.
402 FileName = Name of file to get type from.
403 Flags = Receives a bitfield using the AppTyp constants.}
404 function DosQueryAppType(FileName:PChar;var Flags:longint):longint; cdecl;
406 const diPrinter = 0; {Get number of printer (parallel) ports.}
407 diRS232 = 1; {Get number of serial ports.}
408 diFloppy = 2; {Get number of floppy drives.}
409 diCopro = 3; {Get number of FPU's installed (either 0 or 1).}
410 diSubModel = 4; {??? System submodel type?}
411 diModel = 5; {??? System model type?}
412 diAdapter = 6; {0=Monochrome display, 1=other. ??? Does OS/2
413 support monochrome displays?}
415 {Get information about attached devices.
416 DevInfo = Receives requested information.
417 Item = One of the dixxxx constants.}
418 function DosDevConfig(var DevInfo:byte;Item:longint):longint; cdecl;
420 {****************************************************************************
422 File handling related routines.
424 ****************************************************************************}
426 const MaxPathLength=260;
427 MaxPathComponent=256;
429 type TFileLock=record
430 Offset,Range:longint;
431 end;
432 PFileLock=^TFileLock;
433 FileLock=TFileLock;
435 {Lock or unlock an area of a file. Other processes may not access that part
436 of the file.
438 Unlock = Area to unlock. (0,0) = Do not unlock.
439 Lock = Area to lock. (0,0) = Do not lock.
440 Timeout = Number of miliseconds to wait if another process has locked
441 the file.
442 Flags = Bitfield:
443 Bit 0: 0 = Other processes are denied access.
444 1 = Other processes may still read from the area.
445 Bit 1: 0 = Normal locking mode.
446 1 = Atomic mode. Refer IBM's documentation.}
447 function DosSetFileLocks(Handle:longint;var Unlock,Lock:TFileLock;
448 Timeout,Flags:longint):longint; cdecl;
450 {Cancel a filelock area.
452 Handle = File handle.
453 Lock = Area that is locked now.}
454 function DosCancelLockRequest(Handle:longint;var Lock:TFileLock):longint;
455 cdecl;
457 {Data structures for extended attributes. Reading IBM's documentation is
458 highly recommended before experimenting with EAs.}
460 const fEA_needEA=$80;
462 eaBinary = $fffe;
463 eaASCII = $fffd;
464 eaBitmap = $fffb;
465 eaMetaFile = $fffa;
466 eaIcon = $fff9;
467 eaEA = $ffee;
468 eaMVMT = $ffdf;
469 eaMVST = $ffde;
470 eaASN1 = $ffdd;
472 type TgEA=record
473 NameLen:byte;
474 Name:array[0..9999] of char;
475 end;
476 PgEA=^TgEA;
478 TgEAList=record
479 ListLen:longint;
480 List:array[0..9999] of TgEA;
481 end;
482 PgEAList=^TgEAList;
484 TfEA=record
486 NameLen:byte;
487 Value:word;
488 end;
489 PfEA=^TfEA;
491 TfEAList=record
492 Size:longint;
493 List:array[0..9999] of TfEA;
494 end;
495 PfEAList=^TfEAlist;
497 TEAOp=record
498 gEAList:PgEAList;
499 fEAList:PfEAList;
500 Error:longint;
501 end;
502 PEAOp=^TEAOp;
504 TfEA2=record
505 NextEntry:longint;
506 Flags,
507 NameLen:byte;
508 Value:word;
509 szName:array[0..9999] of char;
510 end;
511 PfEA2=^TfEA2;
513 TfEA2List=record
514 ListLen:longint;
515 List:array[0..9999] of TfEA2;
516 end;
517 PfEA2List=^TfEA2List;
519 TgEA2=record
520 NextEntry:longint;
521 NameLen:byte;
522 Name:array[0..9999] of char;
523 end;
524 PgEA2=^TgEA2;
526 TgEA2list=record
527 ListLen:longint;
528 List:array[0..9999] of TgEA2;
529 end;
530 PgEA2List=^TgEA2List;
532 TEAOp2=record
533 gEA2List:PgEA2List;
534 fEA2List:PfEA2List;
535 Error:longint;
536 end;
537 PEAOp2=^TEAOp2;
539 TEASizeBuf=record
540 MaxEASize:word;
541 MaxEAListSize:longint;
542 end;
543 PEASizeBuf=^TEASizeBuf;
546 {*******************End of extented attribute datastructures.***************}
548 {Usefull constanst for Action parameter.}
549 const doOpened = 1;
550 doCreated = 2;
551 doOverwritten = 3;
553 {Usefull constants for OpenFlags parameter.}
554 const doFail = 0;
555 doOpen = 1;
556 doOverwrite = 2;
558 fixed by KO M.H. on 1999.07.04
559 contents : Creation flags is 10 hex not 10 dec.
561 doCreate = 16;
563 {Usefull constants for openmode parameter.}
565 const doRead = 0;
566 doWrite = 1;
567 doReadWrite = 2;
568 doDenyRW = 16;
569 doDenyWrite = 32;
570 doDenyRead = 48;
571 doDenyNone = 64;
572 doNoInherit = 128;
573 doSequential = 256;
574 doRandom = 512;
575 doNoCache = 4096;
576 doFailOnErr = 8192;
577 doWriteThru = 16384;
578 doDASD = 32768;
580 { Open a file.
582 FileName = Name of file.
583 Handle = Receives filehandle.
584 Action = Receives result of opening.
585 1 = Existing file opened.
586 2 = File did not exist. Created.
587 3 = File existed. Overwritten.
588 InitSize = Initial size of file when creating or overwriting.
589 Ignored when you do not. Must be zero when the file is
590 created or overwritten in read-only mode.
591 Attrib = Attributes when creating or overwriting files.
592 OpenFlags = Bitfield describing what to do when file exists or doesn't
593 exist.
594 OpenMode = Bitfield describing describing how to open a file.
595 EA = Extended attributes to give file when created. Use a nil
596 pointer if you don't want to give it extended attributes.
597 Use it only when creating or overwriting file. Use nil
598 when not. Only the FEA list will be used.
600 The bits in the openflags parameter have the following meanings:
602 Bit 0-3: Action to take when file exists. 0000 = Return with error.
603 0001 = Open it.
604 0010 = Overwrite it.
605 Bit 4-7: Action to take when file does not 0000 = Return with error.
606 exist. 0001 = Create it.
608 The bits in the filemode parameter have the following meanings:
610 Bit 0-2: Access mode: 000 = Read-only
611 001 = Write-only
612 010 = Read/Write
613 Bit 3: Reserved.
614 Bit 4-6: Sharing mode. 001 = Deny all
615 010 = Deny write
616 011 = Deny read
617 100 = Deny none
618 Bit 7: Inheritance. 0 = Handle will be inherited by childs.
619 1 = Handle will not be inherited.
620 Bit 8-11: Reserved.
621 Bit 12: Cache flag. 0 = Use caching.
622 1 = Disable both read and write caching.
623 Bit 13: Error handling. 0 = Use critical error handler.
624 1 = Return just an error code.
625 Bit 14: Write cache flag. 0 = Write operations may be cached.
626 1 = Write operations must be executed
627 before write operation functions return.
628 Bit 15: DASD flag. 0 = Open a file or device.
629 1 = Open a drive as file.
631 When the DASD flag is set, the whole drive is read as a single file. The
632 file starts with 512 bytes of bootsector, then 512 bytes of the second sector etc.
633 The filename must consist of the driveletter followed by a semicolon.}
634 function DosOpen(FileName:PChar;var Handle,Action:longint;
635 InitSize:longint;Attrib,OpenFlags,FileMode:longint;
636 EA:PEAOp2):longint; cdecl;
637 {This variant of DosOpen always creates or overwrites a file.}
638 function DosCreate(FileName:PChar;var Handle:longint;
639 Attrib,OpenMode:longint):longint;
640 {This variant of DosOpen always opens an existing file.}
641 function DosOpen(FileName:PChar;var Handle:longint;
642 Attrib,OpenMode:longint):longint;
643 {There are also string variants.}
644 function DosOpen(const FileName:string;var Handle,Action:longint;
645 InitSize,Attrib,OpenFlags,OpenMode:longint;
646 ea:PEAOp2):longint;
647 function DosCreate(const FileName:string;var Handle:longint;
648 Attrib,OpenMode:longint):longint;
649 function DosOpen(const FileName:string;var Handle:longint;
650 Attrib,OpenMode:longint):longint;
653 {Close a file.
654 Cannot fail if handle does exist.}
655 function DosClose(Handle:longint):longint; cdecl;
657 {Read from a file or other type of handle.
659 Handle = File handle.
660 Buffer = The read data is stored here.
661 Count = Number of bytes to read.
662 ActCount = Number of bytes actually read.}
663 function DosRead(Handle:longint;var Buffer;Count:longint;
664 var ActCount:longint):longint; cdecl;
666 {Write to a file or other type of handle.
668 Handle = File handle.
669 Buffer = The data to be written.
670 Count = Number of bytes to write.
671 ActCount = Number of bytes actually written.}
672 function DosWrite(Handle:longint;var Buffer;Count:longint;
673 var ActCount:longint):longint; cdecl;
675 const dsZeroBased=0; {Set filepointer from begin of file.}
676 dsRelative=1; {Set filepointer relative to the current one.}
677 dsEndBased=2; {Set filepointer from end of file.}
679 {Change the filepointer of a file.}
680 function DosSetFilePtr(Handle:Longint;Pos,Method:longint;
681 var PosActual:longint):Longint; cdecl;
682 {This variant seeks always from begin of file and does not return the
683 actual position.}
684 function DosSetFilePtr(Handle:longint;Pos:longint):longint;
685 {This variant returns the current filepointer.}
686 function DosGetFilePtr(Handle:longint;var PosActual:longint):longint;
688 {Use DosQueryFileInfo or DosQueryPathInfo to get the size of a file.}
690 {Change the size of a file.}
691 function DosSetFileSize(Handle,Size:longint):longint; cdecl;
693 {Flush update the changes to a file to disk.}
694 function DosResetBuffer(Handle:longint):longint; cdecl;
696 {Duplicate or redirect a handle.
697 To duplicate a handle: Fill handle with source handle and duplicate with -1.
698 Copy of handle will be returned in duplicate.
699 To redirect a handle: Fill handle with handle to which the handle to
700 redirect will be redirected. The handle that will be
701 redirected should be placed in duplicate.}
702 function DosDupHandle(Handle:longint;var Duplicate:longint):longint; cdecl;
704 {Return information about a specific handle. See DosOpen for a
705 description of FileMode.}
706 function DosQueryFHState(Handle:longint;var FileMode:longint):longint; cdecl;
708 {Set information about a specific handle. See DosOpen for a description
709 of FileMode.}
710 function DosSetFHState(Handle,FileMode:longint):longint; cdecl;
712 {Usefull constants for the handle type.}
713 const dhFile = 0;
714 dhDevice = 1;
715 dhPipe = 2;
716 dhNetwork = 8192;
718 {Determine if a handle belongs to a file, a device or a pipe.
719 Handle = Handle tp query info about.
720 HandType = Bits 0-1: 00 = File
721 01 = Device
722 02 = Pipe
723 Bit 15: 0 = Local.
724 1 = On network.}
725 function DosQueryHType(Handle:longint;var HandType:longint;
726 var Attr:longint):longint; cdecl;
728 {****************************************************************************
730 File management related routines.
732 ****************************************************************************}
735 {Edit a filename using wildcard.
737 Example editing CONFIG.SYS with *.BAK becomes CONFIG.BAK.
738 Usefull when parsing commands like 'copy config.sys *.bak'.
739 All filename characters are casemapped.'
741 MetaLevel = 0 Use modern semantics
742 MetaLevel = 1 Use OS/2 1.2 semantics
743 Source = string to edit
744 Edit = editstring
745 Target = destination buffer
746 TargetLen = size of the destination buffer}
747 function DosEditName(MetaLevel:longint;Source,Edit:PChar;
748 Target:PChar;TargetLen:longint):longint; cdecl;
749 function DosEditName(MetaLevel:longint;const Source,Edit:string;
750 var Target:string):longint;
752 {Move or rename a file.
753 OldFile = old name of file
754 NewFile = new name of file}
755 function DosMove(OldFile,NewFile:PChar):longint; cdecl;
756 function DosMove(const OldFile,NewFile:string):longint;
759 const dcExisting=1; {Overwrite existing files.}
760 dcAppend=2; {Append to existing file.}
761 dcFailAs=4; {?? Info wanted!}
763 {Copy a file.
764 OldFile = source file
765 NewFile = destination file}
766 function DosCopy(OldFile,NewFile:PChar;Option:longint):longint; cdecl;
767 function DosCopy(const OldFile,NewFile:string;Option:longint):longint;
769 {Delete a file from disk.}
770 function DosDelete(FileName:PChar):longint; cdecl;
771 function DosDelete(const FileName:string):longint;
773 {Destroy a file on disk. DosForceDelete makes sure that the file cannot
774 be unerased anymore.}
775 function DosForceDelete(FileName:PChar):longint; cdecl;
776 function DosForceDelete(const FileName:string):longint;
778 {Create a new directory.
780 Name = Name of directory to create.
781 EA = Extented attributes to give the directory. Use nil if you
782 do not want do give it extented attributes. Only the FEA
783 list is used.}
784 function DosCreateDir(Name:PChar;EA:PEAOp2):longint; cdecl;
785 function DosCreateDir(const Name:string;EA:PEAOp2):longint;
786 {Variants without the EA parameter (nil is used).}
787 function DosCreateDir(Name:PChar):longint;
788 function DosCreateDir(const Name:string):longint;
790 {Remove a directory.}
791 function DosDeleteDir(Name:PChar):longint; cdecl;
792 function DosDeleteDir(const Name:string):longint;
794 {Set the current drive. Cannot fail if the driveletter is correct.}
795 function DosSetDefaultDisk(DiskNum:longint):longint; cdecl;
797 {Get the current drive. Because it cannot fail, it is declared as procedure.}
798 procedure DosQueryCurrentDisk(var DiskNum:longint;var Logical:longint); cdecl;
800 {Set the current directory.}
801 function DosSetCurrentDir(Name:PChar):longint; cdecl;
802 function DosSetCurrentDir(const Name:string):longint;
804 {Get the current directory.}
805 function DosQueryCurrentDir(DiskNum:longint;var Buffer;
806 var BufLen:longint):longint; cdecl;
807 function DosQueryCurrentDir(DiskNum:longint;var Buffer:string):longint;
809 {Send/receive information to a device.
811 Handle = A file handle to a device, instead of a file.
812 Category = The category of functions the function is in.
813 Func = Function to call.
814 Params = Parameters for the function.
815 ParamLen = Size of the params buffer.
816 ParamSize = Size of the parametrs to send to the device
817 Receives size of the returned parameters.
818 Data = Data to send to device.
819 DataLen = Size of your data buffer.
820 DataSize = Size of the data to send to device.
821 Receives size of the data returned by the device.}
822 function DosDevIOCtl(Handle,Category,Func:longint;var Params;
823 ParamLen:longint;var ParamSize:longint;
824 var Data;DataLen:longint;var DataSize:
825 longint):longint; cdecl;
827 {****************************************************************************
829 File searching related routines.
831 ****************************************************************************}
833 const faReadOnly = 1;
834 faHidden = 2;
835 faSystem = 4;
836 faReserve = 8;
837 faDirectory = 16;
838 faArchive = 32;
840 ilStandard = 1;
841 ilQueryEAsize = 2;
842 ilQueryEAs = 3;
843 ilQueryFullName = 5;
845 {Format of date records:
847 Bit 0..4: day
848 Bit 5..8: month
849 Bit 9..15: year minus 1980
851 Format of time records:
853 Bit 0..4: seconds divided by 2
854 Bit 5..10: minutes
855 Bit 11..15: hours}
857 type
859 added by KO Myung-Hun on 1999.07.04
860 for compatible with previous source code
862 TFileStatus = object
863 end;
864 PFileStatus = ^TFileStatus;
867 modified TFileStatus to TFileStatus0 by KO M.H. on 1999.07.04
868 because TFileStatus3 included a new field, NextEntryOffset and
869 new TFileStatus3 needed compatibility with previous source code.
871 TFileStatus0 = object( TFileStatus )
872 DateCreation, {Date of file creation.}
873 TimeCreation, {Time of file creation.}
874 DateLastAccess, {Date of last access to file.}
875 TimeLastAccess, {Time of last access to file.}
876 DateLastWrite, {Date of last modification of file.}
877 TimeLastWrite:word; {Time of last modification of file.}
878 FileSize, {Size of file.}
879 FileAlloc:longint; {Amount of space the file really
880 occupies on disk.}
881 end;
882 PFileStatus0=^TFileStatus0;
884 TFileStatus1=object(TFileStatus0)
885 AttrFile:word; {Attributes of file.}
886 end;
887 PFileStatus1=^TFileStatus1;
889 TFileStatus2=object(TFileStatus0)
890 AttrFile:word;
891 cbList:longint;
892 end;
893 PFileStatus2=^TFileStatus2;
896 fixed by KO Myung-Hun on 1999.07.04
898 contents : NextEntryOffset field is not included
900 TFileStatus3 = object( TFileStatus )
901 NextEntryOffset : Longint; {Offset of next entry}
902 DateCreation, {Date of file creation.}
903 TimeCreation, {Time of file creation.}
904 DateLastAccess, {Date of last access to file.}
905 TimeLastAccess, {Time of last access to file.}
906 DateLastWrite, {Date of last modification of file.}
907 TimeLastWrite:word; {Time of last modification of file.}
908 FileSize, {Size of file.}
909 FileAlloc:longint; {Amount of space the file really
910 occupies on disk.}
911 AttrFile:longint; {Attributes of file.}
912 end;
913 PFileStatus3=^TFileStatus3;
915 TFileStatus4=object(TFileStatus0)
916 AttrFile:longint;
917 cbList:longint;
918 end;
919 PFileStatus4=^TFileStatus4;
921 TFileFindBuf1=object(TFileStatus1)
922 Name:string; {Also possible to use as ASCIIZ.
923 The byte following the last string
924 character is always zero.}
925 end;
926 PFileFindBuf1=^TFileFindBuf1;
929 TFileFindBuf2=object(TFileStatus2)
930 Name:string; {Also possible to use as ASCIIZ.
931 The byte following the last string
932 character is always zero.}
933 end;
934 PFileFindBuf2=^TFileFindBuf2;
936 TFileFindBuf3=object(TFileStatus3)
937 Name:string; {Also possible to use as ASCIIZ.
938 The byte following the last string
939 character is always zero.}
940 end;
941 PFileFindBuf3=^TFileFindBuf3;
943 TFileFindBuf4=object(TFileStatus4)
944 Name:string; {Also possible to use as ASCIIZ.
945 The byte following the last string
946 character is always zero.}
947 end;
948 PFileFindBuf4=^TFileFindBuf4;
950 {Find first file matching a filemask. In contradiction to DOS, a search
951 handle is returned which should be closed with FindClose when done.
952 FileMask = Filemask to search.
953 Handle = Search handle will be returned here, fill with -1 before
954 call.
955 Attrib = File attributes to search for.
956 AFileStatus = Return buffer.
957 FileStatusLen = Size of return buffer.
958 Count = Fill with maximum number of files to search for, the
959 actual number of matching files found is returned here.
960 InfoLevel = One of the ilXXXX constants. Consult IBM documentation
961 for exact meaning. For normal use: Use ilStandard and
962 use PFileFindBuf3 for AFileStatus.}
963 function DosFindFirst(FileMask:PChar;var Handle:longint;Attrib:longint;
964 AFileStatus:PFileStatus;FileStatusLen:longint;
965 var Count:longint;InfoLevel:longint):longint; cdecl;
966 function DosFindFirst(const FileMask:string;var Handle:longint;
967 Attrib:longint;AFileStatus:PFileStatus;
968 FileStatusLen:longint;var Count:longint;
969 InfoLevel:longint):longint;
971 {Find next matching file.}
972 function DosFindNext(Handle:longint;AFileStatus:PFileStatus;
973 FileStatusLen:longint;var Count:longint):longint; cdecl;
975 {Close a search handle. Cannot fail if handle does exist.}
976 function DosFindClose(Handle:longint):longint; cdecl;
978 {Get info about a file.
980 Handle = Handle of file.
981 InfoLevel = One of the ilXXXX constants. Consult IBM documentation
982 for exect meaning. For normal use: Use ilStandard and
983 PFileFindBuf3 for AFileStatus.
984 AFileStatus = An info return buffer.
985 FileStatusLen = Size of info buffer.}
986 function DosQueryFileInfo(Handle,InfoLevel:longint;AFileStatus:PFileStatus;
987 FileStatusLen:longint):longint; cdecl;
989 {Set info about a file. File must be opened with write permissions. See
990 above fo the parameters.}
991 function DosSetFileInfo(Handle,InfoLevel:longint;AFileStatus:PFileStatus;
992 FileStatusLen:longint):longint; cdecl;
994 {Return info about a file. In contradiction to the above functions, the
995 file does not have to be open.}
996 function DosQueryPathInfo(FileName:PChar;InfoLevel:longint;
997 AFileStatus:PFileStatus;FileStatusLen:longint):longint; cdecl;
998 function DosQueryPathInfo(const FileName:string;InfoLevel:longint;
999 AFileStatus:PFileStatus;FileStatusLen:longint):longint;
1001 {Set information about a file.}
1002 function DosSetPathInfo(FileName:PChar;InfoLevel:longint;
1003 AFileStatus:PFileStatus;FileStatusLen,
1004 Options:longint):longint; cdecl;
1006 {Get info about the names and lengths of the EA's for a file or directory.
1008 RefType = 0 = AFile is a pointer to a file-handle.
1009 1 = AFile is a pointer to an ASCIIZ string.
1010 AFile = Pointer file's name or handle.
1011 Entry = Number of EA to query inof about. (1 = first EA).
1012 Buf = Buffer where requested info is returned. For InfoLevel
1013 1, the buffer is a TfEA2 datastructure.
1014 BufLen = Size of buf in bytes.
1015 Count = Number of EA's to return info for. Number of EA's that
1016 actually fitted in buf is returned here.
1017 InfoLevel = Level of information to return. Only level 1 is
1018 currently allowed.}
1020 function DosEnumAttribute(RefType:longint;AFile:pointer;
1021 Entry:longint;var Buf;BufSize:longint;
1022 var Count:longint;InfoLevel:longint):longint; cdecl;
1023 function DosEnumAttribute(Handle,Entry:longint;var Buf;BufSize:longint;
1024 var Count:longint;InfoLevel:longint):longint;
1025 function DosEnumAttribute(const FileName:string;
1026 Entry:longint;var Buf;BufSize:longint;
1027 var Count:longint;InfoLevel:longint):longint;
1029 {Get an environment variable.
1030 Name = Name of environment variable to get.
1031 Value = Receives pointer to environment string.}
1032 function DosScanEnv(Name:PChar;var Value:PChar):longint; cdecl;
1033 {There is, of course a string variant.}
1034 function DosScanEnv(const Name:string;var Value:string):longint;
1036 const dsPathOnly = 0; {Do not search current dir. (Unless it is
1037 in the directory list.)}
1038 dsCurrentDir = 1; {Search in the current direcotry and in the
1039 directory list.}
1040 dsEnvironment = 2; {The dirlist parameter is not a directory
1041 list, but an environment variable
1042 containing one.}
1043 dsIgnoreNetErrs = 4; {Ignore network errors when searching.}
1045 {Search for a file in a given number of directories.
1046 Flags = A combination of the dsXXXX constants.
1047 DirList = Directory list or environment variable containing list
1048 to search in.
1049 FileName = Filename to search for. May contain wildcards.
1050 FullName = Receives filename found, including path.
1051 FullLen = Length of your fullname buffer.}
1052 function DosSearchPath(Flag:longint;DirList,FileName:PChar;
1053 FullName:PChar;FullLen:longint):longint; cdecl;
1054 function DosSearchPath(Flag:longint;const DirList,FileName:string;
1055 var FullName:string):longint;
1057 {****************************************************************************
1059 File system related routines.
1061 ****************************************************************************}
1063 type TFSInfo=record
1064 case word of
1066 (File_Sys_ID,
1067 Sectors_Per_Cluster,
1068 Total_Clusters,
1069 Free_Clusters:longint;
1070 Bytes_Per_Sector:word);
1071 2: {For date/time description,
1072 see file searching realted
1073 routines.}
1074 (Label_Date, {Date when volumelabel created.}
1075 Label_Time:word; {Time when volumelabel created.}
1076 VolumeLabel:string); {Volume label. Can also be used
1077 as ASCIIZ, because the byte
1078 following the last character of
1079 the string is always zero.}
1080 end;
1081 PFSInfo=^TFSInfo;
1083 TAttachData=record
1084 case integer of {Flag in [0,1,2].}
1085 0,1: {Flag = 0.}
1086 (Count:word;
1087 Data:TCharArray);
1088 2: {Flag = 2.}
1089 (PipeHandle:longint;
1090 {Handle of named pipe opened by spooler.}
1091 SpoolName:string);
1092 {Name of spooler object. Can also be used
1093 as ASCIIZ, because the bute following
1094 the last character is always zero.}
1095 end;
1096 PAttachData=^TAttachData;
1098 TFSQBuffer2=record
1099 _Type:word;
1100 NameLen:word;
1101 FSDNameLen:word;
1102 FSADataLen:word;
1103 Name:char;
1104 Nul1:byte;
1105 FSDName:char;
1106 Nul2:byte;
1107 FSAData:char;
1108 Nul3:byte;
1109 end;
1110 PFSQBuffer2=^TFSQBuffer2;
1112 const fsAttach = 0; {Attach a drive.}
1113 fsDetach = 1; {Detach a drive.}
1114 fsSpoolAttach = 2; {Attach a spool device.}
1115 fsSpoolDetach = 3; {Detach a spool device.}
1117 {IBM DOCS: "DosFSAttach attaches or detaches a drive to or from a remote file
1118 system driver (FSD), or a pseudocharacter device name to or from a local or
1119 remote FSD."
1121 DevName = When flag is 0 or 1, the name of a drive or a pseudo-
1122 character device. When using a drivename use the drive-
1123 letter followed by a colon.
1124 When flag is 2 or 3, the name of a spooled device.
1125 FileSystem = Name of the driver that should be attached or detached
1126 to DevName. Use nil when flag is 2 or 3.
1127 Data = Should contain a number of ASCIIZ strings that will
1128 be passed to the filesystem driver when flag is 0 or 1.
1129 Should contain de pipehandle and spoolname when flag is
1130 2. Should be nil when flag is 3.
1131 DataLen = Number of bytes in data parameter.
1132 Flag = One of the dsXXXX constants. See above}
1133 function DosFSAttach(DevName,FileSystem:PChar;var Data:TAttachData;
1134 DataLen,Flag:longint):longint; cdecl;
1135 function DosFSAttach(const DevName,FileSystem:string;var Data:TAttachData;
1136 DataLen,Flag:longint):longint;
1138 {IBMDOCS: "DosQueryFSAttach obtains information about an attached file system
1139 (local or remote), or about a character device or pseudocharacter device
1140 attached to the file system."
1142 DevName = Name info drive or pseudo character device to query
1143 info about. Ignored for InfoLevels 2 and 3.
1144 Ordinal = Index into list of character/pseudo-character
1145 devices. Starts at 1. Ignored for infolevel 1.
1146 InfoLevel = 1 = Return information about a drive or device named
1147 by DevName.
1148 2 = Return information about a (pseudo) charachter
1149 device numbered by Ordinal.
1150 3 = Return information about a drive numbered by
1151 Ordinal.
1152 Buffer = Will be filled with infomation.
1153 BufLen = Size of your buffer in bytes. Number of bytes filled
1154 in your buffer is returned here.}
1155 function DosQueryFSAttach(DevName:PChar;Ordinal,InfoLevel:longint;
1156 var Buffer:TFSQBuffer2;var BufLen:longint):longint; cdecl;
1157 function DosQueryFSAttach(const DevName:string;Ordinal,InfoLevel:longint;
1158 var Buffer:TFSQBuffer2;var BufLen:longint):longint;
1160 const FSCtl_Handle=1;
1161 FSCtl_PathName=2;
1162 FSCtl_FSDName=3;
1163 FSCtl_Error_Info=1;
1164 FSCtl_Max_EASize=2;
1166 {IBMDOCS: "DosFSCtl provides an extended standard interface between an
1167 application and a file-system driver (FSD).
1169 Consult IBM documentation about this function..}
1170 function DosFSCtl(Data:pointer;DataLen:longint;var ResDataLen:longint;
1171 Parms:pointer;ParmsLen:longint;var ResParmsLen:longint;
1172 _Function:longint;Route:PChar;
1173 Handle,Method:longint):longint; cdecl;
1174 function DosFSCtl(Data:pointer;DataLen:longint;var ResDataLen:longint;
1175 Parms:pointer;ParmsLen:longint;var ResParmsLen:longint;
1176 _Function:longint;const Route:string;
1177 Handle,Method:longint):longint;
1179 {Get information about a drive.
1180 InfoLevels:
1181 1 Get total/free space etc.
1182 2 Get volumelabel.}
1183 function DosQueryFSInfo(DiskNum,InfoLevel:longint;var Buffer:TFSInfo;
1184 BufLen:longint):longint; cdecl;
1186 {Set information about a drive.}
1187 function DosSetFSInfo(DiskNum,InfoLevel:longint;var Buffer:TFSinfo;
1188 BufLen:longint):longint; cdecl;
1190 {Check if verify mode is enabled.}
1191 function DosQueryVerify(var Enabled:longint):longint; cdecl;
1193 {Turn the verify mode on or off.}
1194 function DosSetVerify(Enable:longint):longint; cdecl;
1196 {Change the number of filehandles our program can open. (Default=50). It
1197 won't hurt if there are files open when you are calling this.}
1198 function DosSetMaxFH(Count:longint):longint; cdecl;
1200 {Ask for more filehandles (or dump filehandles). It won't hurt if there are
1201 files open when you are calling this.
1202 ReqCount = Number of filehandles to ask for. (Negative to dump them.)
1203 CurMaxFH = Receives the total number of filehandles your program has
1204 access to.}
1205 function DosSetRelMaxFH(var ReqCount,CurMaxFH:longint):longint; cdecl;
1207 const dsFull=0; {IBM DOCS: "Perform full system shutdown and
1208 file-system lock."}
1209 dsQuiescient=1; {IBM DOCS: "Perform buffer and cache flushing to
1210 make system quiescent."}
1212 {Prepare the system for shutdown.}
1213 function DosShutdown(Flags:longint):longint; cdecl;
1216 {Usefull constants fo DosQuerySysInfo.}
1217 const svMaxPathLength = 1; {Maximum length of a pathname.}
1218 svMaxTextSessions = 2; {Maximum number of text sessions.}
1219 svMaxPMSessions = 3; {Maximum number of PM sessions.}
1220 svMaxVDMSessions = 4; {Maximum number of DOS sessions.}
1221 svBootDrive = 5; {Get the boot drive. (A=1, B=2 etc.)}
1222 svDynPriVariation = 6;
1223 svMaxWait = 7;
1224 svMinSlice = 8;
1225 svMaxSlice = 9;
1226 svPageSize = 10; {Size of a page. (Always 4096 bytes.)}
1227 svMajorVersion = 11; {Major version number of kernel:
1228 10 for OS/2 1.0 and 1.1,
1229 20 for OS/2 2.0 .. OS/2 4.0.}
1230 svMinorVersion = 12; {Minor version of kernel:
1231 OS/2 2.0: 00, 2.1: 10, 2.11: 11,
1232 3.0: 30, 4.0: 40.}
1233 svRevision = 13; {Revision of kernel. Until now all
1234 OS/2 versions return 0.}
1235 svMsCount = 14; {Uptime in milliseconds.}
1236 svTimeLow = 15; {System time in seconds since
1237 1 January 1970 0:00:00, low dword.}
1238 svTimeHigh = 16; {System time in seconds since
1239 1 January 1970 0:00:00, high dword.}
1240 svPhysMem = 17; {Amount in bytes of physical memory
1241 in system.}
1242 svResMem = 18; {Amount in bytes of resident memory
1243 in system.}
1244 svAvailMem = 19; {Amount in bytes of available
1245 memory.}
1246 svPrMem = 20; {Maximum amount of memory the current
1247 process can request for its
1248 private use.}
1249 svShMem = 21; {Maximum amount of memory the current
1250 process can request for shared
1251 purposes.}
1252 svTimerInterval = 22; {Timer interval in tenths of a
1253 millisecond.}
1254 svMaxCompLength = 23; {Maxmimum length of a component in a
1255 pathname.}
1256 svForegroundSession = 24; {Returns the session ID of the fore-
1257 ground session. The presentation
1258 manager has ID 1.}
1259 svForegroundProcess = 25; {Returns the process ID of the
1260 current foreground process.}
1262 {Get one or more system parameters.
1263 First = First variable to get.
1264 Last = Last variable to get.
1265 Buf = Receives variables.
1266 BufSize - Size of the buffer/}
1267 function DosQuerySysInfo(First,Last:longint;var Buf;BufSize:longint):longint;
1268 cdecl;
1270 {Return information about a partitionable disk.}
1271 function DosPhysicalDisk(Func:longint;Buf:pointer;BufSize:longint;
1272 Params:pointer;ParamSize:longint):longint; cdecl;
1274 {****************************************************************************
1276 Memory allocation related routines.
1278 ****************************************************************************}
1280 const mfPag_Read = $00001; {Give read access to memory.}
1281 mfPag_Write = $00002; {Give write access to memory.}
1282 mfPag_Execute = $00004; {Allow code execution in memory.}
1283 mfPag_Guard = $00008; {Used for dynamic memory growing. Create
1284 uncommitted memory and make the first
1285 page guarded. Once it is accessed it
1286 will be made committed, and the next
1287 uncommitted page will be made guarded.}
1288 mfPag_Commit = $00010; {Make the memory committed.}
1289 mfPag_Decommit = $00020; {Decommit the page.}
1290 mfObj_Tile = $00040; {Also allocate 16-bit segments of 64k
1291 which map the memory. (Makes 16<>32 bit
1292 pointer conversion possible.}
1293 mfObj_Protected = $00080;
1294 mfObj_Gettable = $00100;
1295 mfObj_Giveable = $00200;
1296 mfPag_Default = $00400;
1297 mfPag_Shared = $02000;
1298 mfPag_Free = $04000;
1299 mfPag_Base = $10000;
1301 mfSub_Init = $00001; {Use base, if not set, choose a base
1302 address yourself.}
1303 mfSub_Grow = $00002; {Grow the specified heap, instead of
1304 allocating it. Ignore mfSub_Init.}
1305 mfSub_Sparse = $00004;
1306 mfSub_Serialize = $00008;
1308 {Get some memory.
1309 P = Pointer to memory will be returned here.
1310 Size = Number of bytes to get. The size is rounded up to a multiple
1311 of 4096. This is probably not the case on non-intel 386
1312 versions of OS/2.
1313 Flags = One or more of the mfXXXX constants.}
1314 function DosAllocMem(var P:pointer;Size,Flag:longint):longint; cdecl;
1316 {Free a memory block.}
1317 function DosFreeMem(P:pointer):longint; cdecl;
1319 {Set settings for a block of memory.
1320 P = Pointer to the memory. Doesn't need to be the start of the
1321 memory block allocated with DosAllocMem, but must be a multiple
1322 of 4096.
1323 Size = Number of bytes to change settings for. Is rounded up to a
1324 multile of 4096.
1325 Flags = New flags for the memory.}
1326 function DosSetMem(P:pointer;Size,Flag:longint):longint; cdecl;
1328 {Give another process access to a shared memory block.
1330 P = Pointer to the shared memory object.
1331 PID = Process of destination process.
1332 Flag = Permissions the the destination process gets.}
1333 function DosGiveSharedMem(P:pointer;PID,Flag:longint):longint; cdecl;
1335 {Get access to a shared memory object.
1337 P = Pointer to shared memory object.
1338 Flag = Permissions to ask.}
1339 function DosGetSharedMem(P:pointer;Flag:longint):longint; cdecl;
1341 {Get access to a shared memory object that has a name.
1343 P = Pointer to shared memory object.
1344 Name = Name of the memory object. (Starting with '\SHAREMEM\'.
1345 Flag = Permissions to ask.}
1346 function DosGetNamedSharedMem(var P:pointer;Name:PChar;Flag:longint):longint;
1347 cdecl;
1348 function DosGetNamedSharedMem(var P:pointer;const Name:string;
1349 Flag:longint):longint;
1351 {Allocate memory so that it can later be shared with another program.
1352 P = Reveives pointer to memory.
1353 Name = Optional: name to give memory. Must start with '\SHAREMEM\'.
1354 Use nil for the PChar or '' for the string variant for no name.
1355 Size = Number of bytes to allocate.}
1356 function DosAllocSharedMem(var P:pointer;Name:PChar;Size,Flag:longint):longint;
1357 cdecl;
1358 function DosAllocSharedMem(var P:pointer;const Name:string;Size,
1359 Flag:longint):longint;
1361 {Get the size and flags of a block of memory.
1363 P = Pointer to the block of memory.
1364 Size = Receives block size.
1365 Flag = Receives the flags.}
1366 function DosQueryMem(P:pointer;var Size,Flag:longint):longint; cdecl;
1368 {Allocate a block of memory in a heap.
1369 Base = Pointer to the start of the heap.
1370 P = Receives pointer to the memory bock.
1371 Size = Number of bytes to allocate.}
1372 function DosSubAllocMem(Base:pointer;var P:pointer;Size:longint):longint;
1373 cdecl;
1375 {Free a block of memory in a heap.
1376 Base = Pointer to the start of the heap.
1377 P = Pointer to memory block to free.
1378 Size = Number of bytes to free.}
1379 function DosSubFreeMem(Base,P:pointer;Size:longint):longint; cdecl;
1381 {Turn a block of memory into a heap.
1383 Base = Pointer to memory block to turn into a heap.
1384 Flag = One or more of the mfSub_XXXX flags.
1385 Size = Size of the requested heap.}
1386 function DosSubSetMem(Base:pointer;Flag,Size:longint):longint; cdecl;
1388 {Destroy a heap. (Memory remains allocated).
1390 Base = Pointer to the heap to destroy.}
1391 function DosSubUnsetMem(Base:pointer):longint; cdecl;
1393 {****************************************************************************
1395 Semaphore related routines
1397 ****************************************************************************}
1399 const smShared = $0001; {Semaphore is shared.}
1400 smMWWaitAny = $0002; {MuxWait only: Wait until a semaphore
1401 is cleared.}
1402 smMWWaitAll = $0004; {MuxWait only: Wait until all semaphores
1403 are cleared.}
1405 type PSemRecord=^TSemRecord;
1406 TSemRecord=record
1407 Semaphore, {Handle of semaphore to link.}
1408 User:longint;
1409 end;
1411 PSemArray=^TSemArray;
1412 TSemArray=array[0..$ffff] of TSemRecord;
1414 {Create an event semaphore.
1415 Name = Optional: Name of semaphore to create. Must start with '\SEM32\.
1416 Use nil for PChar or '' for string variant for noname. A
1417 unnamed semaphore is not shared unless the sm_Shared flag is
1418 set.
1419 Handle = Receives handle of semaphore.
1420 Attr = One or more of the smXXXX constants.
1421 State = Initial state: 0 = Reset (false), 1 = Posted (true).}
1422 function DosCreateEventSem(Name:PChar;var Handle:longint;
1423 Attr,State:longint):longint; cdecl;
1424 function DosCreateEventSem(const Name:string;var Handle:longint;
1425 Attr,State:longint):longint;
1427 {Open a semaphore created by another process or thread.
1429 Name = Name of semaphore.
1430 Handle = Receives handle of semaphore.}
1431 function DosOpenEventSem(Name:PChar;var Handle:longint):longint; cdecl;
1432 function DosOpenEventSem(const Name:string;var Handle:longint):longint;
1434 {Close an event semaphore.
1435 Handle = Handle of a semaphore to close.}
1436 function DosCloseEventSem(Handle:longint):longint; cdecl;
1438 {Reset an event semaphore: *** probeer *** operation.
1439 Handle = Handle of semaphore.
1440 PostCount = Number of times DosPostEventSem has been called since last
1441 reset.
1443 Note: Returns errorcode 300 if semaphore is already reset.}
1444 function DosResetEventSem(Handle:longint;var PostCount:longint):longint; cdecl;
1446 {Post an event semaphore: *** verhoog *** operation.
1447 Handle = Handle of semaphore.
1449 Note: Returns errorcode 299 if semaphore is already posted.}
1450 function DosPostEventSem(Handle:longint):longint; cdecl;
1452 {Wait until an event semaphore is posted (wait until *** verhoog *** operation).
1453 Handle = Handle of semaphore.
1454 Timeout = Return with errorcode if timeout milliseconds have past and the
1455 semaphore is still reset. To return immediately use 0,
1456 to wait forever use -1.}
1457 function DosWaitEventSem(Handle,Timeout:longint):longint; cdecl;
1459 {Check if an event semaphore is posted (if a *** verhoog *** operation has been done).
1460 Handle = Handle of semaphore.
1461 Posted = Receives number of times DosPostEventSem was called since
1462 the last reset.}
1463 function DosQueryEventSem(Handle:longint;var Posted:longint):longint; cdecl;
1465 {Create a Mutual Exclusion semaphore (mutex).
1466 Name = Optional: Name to give to semaphore. Must start with '\SEM32\'.
1467 Use nil for PChar or '' for string variant to use no name.
1468 If a name if used the semaphore is shared.
1469 Handle = Receives handle of semaphore.
1470 Attr = One or more of the smXXXX constants.
1471 State = Initial state: (0=Unowned, 1=Owned.)}
1472 function DosCreateMutExSem(Name:PChar;var Handle:longint;
1473 Attr,State:longint):longint; cdecl;
1474 function DosCreateMutExSem(const Name:string;var Handle:longint;
1475 Attr,State:longint):longint;
1477 {Open a shared mutex semaphore.
1478 Name = Name of semaphore to open, always starts with '\SEM32\'.
1479 Handle = Receives handle to semaphore.}
1480 function DosOpenMutExSem(Name:PChar;var Handle:longint):longint; cdecl;
1481 function DosOpenMutExSem(const Name:string;var Handle:longint):longint;
1483 {Close a mutex semaphore.
1484 handle = Handle of semaphore to close.}
1485 function DosCloseMutExSem(Handle:longint):longint; cdecl;
1487 {Request ownership of a mutex semaphore. If the semaphore is already owned the
1488 process is halted until the semaphore is released.
1489 Handle = Handle of semaphore.
1490 Timeout = Return with errorcode if the semaphore is still owned after
1491 timeout milliseconds.}
1492 function DosRequestMutExSem(Handle,Timeout:longint):longint; cdecl;
1494 {Release the ownership of a mutex semaphore.
1495 Handle = Handle of semaphore to release.}
1496 function DosReleaseMutExSem(Handle:longint):longint; cdecl;
1498 {Query the PID and TIB of the owner of a mutex semaphore.
1499 Handle = Handle of semaphore.
1500 PID = Receives process ID of owner.
1501 TID = Receives thread ID of owner.
1502 Count = Number of threads (within and outside current process) waiting
1503 for ownership of semaphore.}
1504 function DosQueryMutExSem(Handle:longint;var PID,TID,Count:longint):longint;
1505 cdecl;
1507 {Create a Multiple Wait (MuxWait) semaphore.
1508 Name = Optional: Name to give semaphore. Must start with '\SEM32\'.
1509 Use nil for PChar or '' for string variant to use no name.
1510 If a name if used the semaphore is shared.
1511 Handle = Receives handle of semaphore.
1512 CSemRec = Number of semaphores to link muxwait semaphore with.
1513 SemArray = Array of semaphore records to link with muxwait semaphore.
1514 Attr = One or more of the smXXXX constants.}
1515 function DosCreateMuxWaitSem(Name:PChar;var Handle:longint;CSemRec:longint;
1516 var SemArray:TSemArray;Attr:longint):longint; cdecl;
1517 function DosCreateMuxWaitSem(const Name:string;var Handle:longint;
1518 CSemRec:longint;var SemArray:TSemArray;
1519 Attr:longint):longint;
1521 {Open a MuxWait semaphore.
1522 Name = Name of semaphore to open.
1523 Handle = Receives handle of semaphore.}
1524 function DosOpenMuxWaitSem(Name:PChar;var Handle:longint):longint; cdecl;
1525 function DosOpenMuxWaitSem(const Name:string;var Handle:longint):longint;
1527 {Close a MuxWait semaphore.}
1528 function DosCloseMuxWaitSem(Handle:longint):longint; cdecl;
1530 {Wait for the MuxWait semaphore to be cleared.
1531 Handle = Handle of semaphore.
1532 Timeout = Timeout. See above.
1533 User = Receives user value of the semaphore that caused the muxwait
1534 semaphore to be cleared.}
1535 function DosWaitMuxWaitSem(Handle,Timeout:longint;var User:longint):longint;
1536 cdecl;
1538 {Add a semaphore to the MuxWait semaphore.
1540 Handle = Handle of semaphore.
1541 SemRec = The semaphore to add.}
1542 function DosAddMuxWaitSem(Handle:longint;var SemRec:TSemRecord):longint; cdecl;
1544 {Remove a semaphore from the MuxWait semaphore.
1545 Handle = Handle of muxwait semaphore.
1546 Sem = Handle of semaphore to remove.}
1547 function DosDeleteMuxWaitSem(Handle,Sem:longint):longint; cdecl;
1549 {Query the semaphores from a MuxWait semaphore.
1550 Handle = Handle of semaphore.
1551 CSemRec = Input: Size of our array. Output: Number of items in array.
1552 SemRecs = Array where TSemRecords are stored.
1553 Attr = Flags used by creation of semaphore.}
1554 function DosQueryMuxWaitSem(Handle:longint;var CSemRec:longint;
1555 var SemRecs:TSemArray;var Attr:longint):longint; cdecl;
1557 {****************************************************************************
1559 Timing related routines.
1561 ****************************************************************************}
1564 type TDateTime=record
1565 Hour,
1566 Minute,
1567 Second,
1568 Sec100,
1569 Day,
1570 Month:byte;
1571 Year:word;
1572 TimeZone:integer;
1573 WeekDay:byte;
1574 end;
1575 PDateTime=^TDateTime;
1578 {Get the date and time.}
1579 function DosGetDateTime(var Buf:TDateTime):longint; cdecl;
1581 {Set the date and time.}
1582 function DosSetDateTime(var Buf:TDateTime):longint; cdecl;
1584 {Start a one shot timer.
1585 MSec = Number of miliseconds the timer will run.
1586 HSem = Handle of event semaphore that is posted when time has expired.
1587 TimHandle = Receives timer handle.}
1588 function DosAsyncTimer(MSec,HSem:longint;
1589 var TimHandle:longint):longint; cdecl;
1591 {Start a cyclic timer.
1592 MSec = Number of miliseconds the timer will run.
1593 HSem = Handle of event semaphore that is posted when time has expired.
1594 TimHandle = Receives timer handle.}
1595 function DosStartTimer(MSec,HSem:longint;
1596 var TimHandle:longint):longint; cdecl;
1598 {Stop a timer and destroy its handle. There is no need to check for an
1599 error code if you know your timer handle is correct.}
1600 function DosStopTimer(TimHandle:longint):longint; cdecl;
1602 {Get the frequency of the high resolution timer.}
1603 function DosTmrQueryFreq(var Freq:longint):longint; cdecl;
1605 {Get the current value of the high resolution timer.}
1606 function DosTmrQueryTime(var Time:comp):longint; cdecl;
1608 {****************************************************************************
1610 DLL specific routines.
1612 ****************************************************************************}
1614 {Load a DLL in memory if it is not yet loaded.
1615 ObjName = When the DLL cannot be found, or one of the DLL's it needs
1616 cannot be found, the name of the DLL will be put here.
1617 ObjLen = Size of the ObjName result buffer.
1618 DLLName = Name of DLL to load. Do not give an extension or a path,
1619 just the name. OS/2 will automatically search through the
1620 LIBPATH for the DLL.
1621 Handle = Receives DLL handle.}
1622 function DosLoadModule(ObjName:PChar;ObjLen:longint;DLLName:PChar;
1623 var Handle:longint):longint; cdecl;
1624 function DosLoadModule(var ObjName:string;ObjLen:longint;
1625 const DLLName:string;var Handle:longint):longint;
1627 {Let OS/2 know that we do not need a DLL anymore. If we were the only process
1628 using the DLL, it is unloaded.}
1629 function DosFreeModule(Handle:longint):longint; cdecl;
1631 {Get the address of a procedure.
1632 Handle = DLL handle,
1633 Ordinal = Procedure to get address for. 0=Use its name.
1634 ProcName = Name of the procedure to query address for. Must be nil
1635 for PChar or '' for string variant if Ordinal is nonzero.
1636 Address = Receives address of procedure.}
1637 function DosQueryProcAddr(Handle,Ordinal:longint;ProcName:PChar;
1638 var Address:pointer):longint; cdecl;
1639 function DosQueryProcAddr(Handle,Ordinal:longint;const ProcName:string;
1640 var Address:pointer):longint;
1642 {Get the handle of a loaded DLL or a loaded executable.
1643 DLLName = Name of DLL.
1644 Handle = Receives DLL handle if present.}
1645 function DosQueryModuleHandle(DLLName:PChar;var Handle:longint):longint; cdecl;
1646 function DosQueryModuleHandle(const DLLName:string;var Handle:longint):longint;
1648 {Get the pathname of a loaded DLL or a loaded executable.
1650 Handle = Handle of DLL.
1651 NameLen = Maximum length of char array.
1652 Name = PChar (or string) where name is returned.}
1653 function DosQueryModuleName(Handle,NameLen:longint;Name:Pchar):longint; cdecl;
1654 {function DosQueryModuleName(Handle:longint;var Name:OpenString):longint;}
1656 const pt16bit=0;
1657 pt32bit=1;
1659 {Return if a procedure is either 16 or 32 bit.
1660 Handle = Handle of DLL.
1661 Ordinal = DLL index number. 0 means use Name.
1662 Name = Must be nil for PChar or '' for string variant if Ordinal
1663 is zero. Otherwise it contains the procedure name.
1664 ProcType = One of the ptXXXX constants.}
1665 function DosQueryProcType(Handle,Ordinal:longint;Name:PChar;
1666 var ProcType:longint):longint; cdecl;
1667 function DosQueryProcType(Handle,Ordinal:longint;const Name:string;
1668 var ProcType:longint):longint;
1670 {****************************************************************************
1672 Resource related routines.
1674 ****************************************************************************}
1676 {Possible resource types:}
1678 const rtPointer = 1; {Mouse pointer.}
1679 rtBitmap = 2; {Bitmap}
1680 rtMenu = 3; {Menu template.}
1681 rtDialog = 4; {Dialog template.}
1682 rtString = 5; {A string table.}
1683 rtFontDir = 6; {Font directory.}
1684 rtFont = 7; {A font.}
1685 rtAccelTable = 8; {Accelerator table.}
1686 rtRcData = 9; {Binary data.}
1687 rtMessage = 10; {Error message table.}
1688 rtDlgInclude = 11; {Dialog include filename.}
1689 rtVKeyTbl = 12; {Key to vkey tables.}
1690 rtKeyTbl = 13; {Key to ugl tables.}
1691 rtCharTbl = 14; {Glyph to character tables.}
1692 rtDisplayInfo = 15; {Screen display information.}
1693 rtFKAShort = 16; {Function key area short form.}
1694 rtFKALong = 17; {Function key area long form.}
1695 rtHelpTable = 18; {Help table.}
1696 rtHelpSubTable = 19; {Sub help table.}
1697 rtFDDir = 20; {DBCS unique/font driver directory.}
1698 rtFD = 21; {DBCS unique/font driver.}
1700 {Get the address of a resource object.
1701 Handle = Handle of DLL (or executable) to get resource from.
1702 ResType = One of the rtXXXX constants.
1703 ResName = Number associated to resource object by resource compiler.}
1704 function DosGetResource(Handle,ResType,ResName:longint;var P:pointer):longint;
1705 cdecl;
1707 {Remove a resource object from memory.
1708 P = Pointer to resource.}
1709 function DosFreeResource(P:pointer):longint; cdecl;
1711 {Get the size of a resource object.
1712 Handle = Handle to DLL (or executable).
1713 IDT = One of the rtXXXX constants.
1714 IDN = Number associated to resource object by resource compiler.
1715 Size = Receives resource size.}
1716 function DosQueryResourceSize(Handle,IDT,IDN:longint;var Size:longint):longint;
1717 cdecl;
1720 {****************************************************************************
1722 Country and codepage specific routines.
1724 ****************************************************************************}
1726 type TCountryCode=record
1727 Country, {Country to query info about (0=current).}
1728 CodePage:longint; {Code page to query info about (0=current).}
1729 end;
1730 PCountryCode=^TCountryCode;
1731 CountryCode=TCountryCode;
1733 TTimeFmt=(Clock12,Clock24);
1735 TCountryInfo=record
1736 Country,CodePage:longint; {Country and codepage requested.}
1737 case byte of
1739 DateFormat:longint; {1=ddmmyy 2=yymmdd 3=mmddyy}
1740 CurrencyUnit:array[0..4] of char;
1741 ThousandSeparator:char; {Thousands separator.}
1742 Zero1:byte; {Always zero.}
1743 DecimalSeparator:char; {Decimals separator,}
1744 Zero2:byte;
1745 DateSeparator:char; {Date separator.}
1746 Zero3:byte;
1747 TimeSeparator:char; {Time separator.}
1748 Zero4:byte;
1749 CurrencyFormat, {Bit field:
1750 Bit 0: 0=indicator before value
1751 1=indicator after value
1752 Bit 1: 1=insert space after
1753 indicator.
1754 Bit 2: 1=Ignore bit 0&1, replace
1755 decimal separator with
1756 indicator.}
1757 DecimalPlace:byte; {Number of decimal places used in
1758 currency indication.}
1759 TimeFormat:TTimeFmt; {12/24 hour.}
1760 Reserve1:array[0..1] of word;
1761 DataSeparator:char; {Data list separator}
1762 Zero5:byte;
1763 Reserve2:array[0..4] of word);
1765 fsDateFmt:longint; {1=ddmmyy 2=yymmdd 3=mmddyy}
1766 szCurrency:array[0..4] of char; {null terminated currency symbol}
1767 szThousandsSeparator:array[0..1] of char;
1768 {Thousands separator + #0}
1769 szDecimal:array[0..1] of char; {Decimals separator + #0}
1770 szDateSeparator:array[0..1] of char;
1771 {Date separator + #0}
1772 szTimeSeparator:array[0..1] of char;
1773 {Time separator + #0}
1774 fsCurrencyFmt, {Bit field:
1775 Bit 0: 0=indicator before value
1776 1=indicator after value
1777 Bit 1: 1=insert space after
1778 indicator.
1779 Bit 2: 1=Ignore bit 0&1, replace
1780 decimal separator with
1781 indicator}
1782 cDecimalPlace:byte; {Number of decimal places used in
1783 currency indication}
1784 fsTimeFmt:byte; {0=12,1=24 hours}
1785 abReserved1:array[0..1] of word;
1786 szDataSeparator:array[0..1] of char;
1787 {Data list separator + #0}
1788 abReserved2:array[0..4] of word);
1789 end;
1790 PCountryInfo=^TCountryInfo;
1791 CountryInfo=TCountryInfo;
1793 TDBCSRange=record
1794 Start,Stop:byte;
1795 end;
1797 TDBCSArray=array[0..$ffff] of TDBCSRange;
1798 PDBCSArray=^TDBCSArray;
1800 const CurrentCountry:TCountryCode=(Country:0;CodePage:0);
1802 {Get country specific information.
1803 Size = Size of our datastructure. (SizeOf(TCountryInfo))
1804 ActualSize = Size of OS/2's datastructure. ActualSize bytes of
1805 our TCountryInfo have been filled.}
1806 function DosQueryCtryInfo(Size:longint;var Country:TCountryCode;
1807 var Res:TCountryInfo;var ActualSize:longint):longint; cdecl;
1809 {Get info about a code page with a DBCS character set.}
1810 function DosQueryDBCSEnv(Size:longint;var Country:TCountryCode;
1811 Buf:PChar):longint; cdecl;
1813 {Convert a string to uppercase.
1814 Size = Length of string.
1815 Country = Country and codepage for converting.
1816 AString = String to convert.}
1817 function DosMapCase(Size:longint;var Country:TCountryCode;
1818 AString:PChar):longint; cdecl;
1819 function DosMapCase(var Country:TCountryCode;
1820 var AString:string):longint;
1822 {Get a collate table (a table for comparing which character is smaller and
1823 which one is greater).
1824 Size = Length of the databuffer the program has.
1825 Country = Country to query table for. (0,0) is default country and
1826 codepage.
1827 Buf = Buffer to return table in. It's filled with the sort
1828 weights of the ascii code. For example the 128th byte
1829 contains the weight for ascii code 128.
1830 TableLen = Length of collating table.}
1831 function DosQueryCollate(Size:longint;var Country:TCountryCode;
1832 Buf:PByteArray;var TableLen:longint):longint; cdecl;
1834 {Get the current codepage. The PWordArray is filled with the current code
1835 page followed by alternative codepages.}
1836 function DosQueryCP(Size:longint;CodePages:PWordArray;
1837 var ActSize:longint):longint; cdecl;
1839 {Change the codepage, but only for the current process.}
1840 function DosSetProcessCP(CP:longint):longint; cdecl;
1842 {****************************************************************************
1844 Exception handling related functions
1846 ****************************************************************************}
1849 {Exception constants.}
1850 const XCPT_Continue_Search = $00000000;
1851 XCPT_Continue_Execution = $ffffffff;
1852 XCPT_Continue_Stop = $00716668;
1854 XCPT_Signal_Intr = $1;
1855 XCPT_Signal_KillProc = $3;
1856 XCPT_Signal_Break = $4;
1858 XCPT_Fatal_Exception = $c0000000;
1859 XCPT_Severity_Code = $c0000000;
1860 XCPT_Customer_Code = $20000000;
1861 XCPT_Facility_Code = $1fff0000;
1862 XCPT_Exception_Code = $0000ffff;
1864 XCPT_Unknown_Access = $00000000;
1865 XCPT_Read_Access = $00000001;
1866 XCPT_Write_Access = $00000002;
1867 XCPT_Execute_Access = $00000004;
1868 XCPT_Space_Access = $00000008;
1869 XCPT_Limit_Access = $00000010;
1870 XCPT_Data_Unknown = $ffffffff;
1872 XCPT_Guard_Page_Violation = $80000001;
1873 XCPT_Unable_To_Grow_Stack = $80010001;
1874 XCPT_Access_Violation = $c0000005;
1875 XCPT_In_Page_Error = $c0000006;
1876 XCPT_Illegal_Instruction = $c000001c;
1877 XCPT_Invalid_Lock_Sequence = $c000001d;
1878 XCPT_Noncontinuable_Exception = $c0000024;
1879 XCPT_Invalid_Disposition = $c0000025;
1880 XCPT_Unwind = $c0000026;
1881 XCPT_Bad_Stack = $c0000027;
1882 XCPT_Invalid_Unwind_Target = $c0000028;
1883 XCPT_Array_Bounds_Exceeded = $c0000093;
1884 XCPT_Float_Denormal_Operand = $c0000094;
1885 XCPT_Float_Divide_By_Zero = $c0000095;
1886 XCPT_Float_Inexact_Result = $c0000096;
1887 XCPT_Float_Invalid_Operation = $c0000097;
1888 XCPT_Float_Overflow = $c0000098;
1889 XCPT_Float_Stack_Check = $c0000099;
1890 XCPT_Float_Underflow = $c000009a;
1891 XCPT_Integer_Divide_By_Zero = $c000009b;
1892 XCPT_Integer_Overflow = $c000009c;
1893 XCPT_Privileged_Instruction = $c000009d;
1894 XCPT_Datatype_Misalignment = $c000009e;
1895 XCPT_Breakpoint = $c000009f;
1896 XCPT_Single_Step = $c00000a0;
1897 XCPT_Process_Terminate = $c0010001;
1898 XCPT_Async_Process_Terminate = $c0010002;
1899 XCPT_Signal = $c0010003;
1901 type PExceptionRegistrationRecord=^TExceptionRegistrationRecord;
1902 PExceptionReportRecord=^TExceptionReportRecord;
1903 PContextRecord=^TContextRecord;
1905 TExceptionHandler=procedure(Report:PExceptionReportRecord;
1906 RegRec:PExceptionRegistrationRecord;
1907 Context:PContextRecord;
1908 DispContext:pointer); cdecl;
1910 TExceptionRegistrationRecord=record
1911 Prev_Structure:PExceptionRegistrationRecord;
1912 ExceptionHandler:TExceptionHandler;
1913 end;
1915 TExceptionReportRecord=record
1916 Exception_Num,
1917 HandlerFlags:longint;
1918 Nested_RepRec:PExceptionReportRecord;
1919 Address:pointer;
1920 ParamCount:longint;
1921 Parameters:array [0..9999] of longint;
1922 end;
1924 TContextRecord=record
1925 ContextFlags:longint;
1926 Env:array[1..7] of longint;
1927 FPUStack:array[0..7] of extended;
1928 Reg_GS,
1929 Reg_FS,
1930 Reg_ES,
1931 Reg_DS,
1932 Reg_EDI,
1933 Reg_ESI,
1934 Reg_EAX,
1935 Reg_EBX,
1936 Reg_ECX,
1937 Reg_EDX,
1938 Reg_EBP,
1939 Reg_EIP,
1940 Reg_CS,
1941 Flags,
1942 Reg_ESP,
1943 Reg_SS:longint;
1944 end;
1946 {Warning!!! Never use Presentation Manager functions from exception
1947 handlers!}
1949 {Install an exceptionhandler. The Prev_Structure field of RegRec should be
1950 nil, it will be filled in be OS/2. RegRec must be on the stack: It must be a
1951 local variable.}
1952 function DosSetExceptionHandler(var RegRec:TExceptionRegistrationRecord):longint;
1953 cdecl;
1955 {Uninstall an exception handler.}
1956 function DosUnSetExceptionHandler(var RegRec:TExceptionRegistrationRecord
1957 ):longint; cdecl;
1959 {Trigger an exception.}
1960 function DosRaiseException(var Excpt:TExceptionReportRecord):longint; cdecl;
1962 {Send a signal to a process.}
1963 function DosSendSignalException(PID,Exception:longint):longint; cdecl;
1965 {Call and remove a set of exceptionhandlers}
1966 function DosUnwindException(var Handler:TExceptionRegistrationRecord;
1967 TargetIP:pointer;
1968 var RepRec:TExceptionReportRecord):longint; cdecl;
1970 {Full screen applications can get Ctrl-C and Ctrl-Break focus. For all
1971 processes sharing one screen, only one can have Ctrl-C focus.
1972 Enable = 0 = Release focus, 1 = Get focus.
1973 Times = Number of times focus has been get minus number of times it
1974 has been released.}
1975 function DosSetSignalExceptionFocus(Enable:longint;var Times:longint):longint;
1976 cdecl;
1978 {Tell OS/2 that if an exception occurs, it must queue it up, until a
1979 DosExitMustComplete follows. Urgent exceptions still occur. The only
1980 possible error is that the nesting becomes too high, so error checking
1981 is only needed in seldom cases.
1982 Nesting = Number of DosEnterMustComplete calls minus number of
1983 DosExitMustComplete calls.}
1984 function DosEnterMustComplete(var Nesting:longint):longint; cdecl;
1986 {Tell OS/2 that it can send exceptions again. See above}
1987 function DosExitMustComplete(var Nesting:longint):longint; cdecl;
1989 {Tell we want further signal exceptions.
1990 SignalNum = Signal nummer to acknowlegde.}
1991 function DosAcknowledgeSignalException(SignalNum:longint):longint; cdecl;
1994 {****************************************************************************
1996 Queue related routines.
1998 ****************************************************************************}
2000 type TRequestData=record
2001 PID, {ID of process that wrote element.}
2002 Data:longint; {Information from process writing the data.}
2003 end;
2004 PRequestData=^TRequestData;
2006 {Useful constants for priority parameters.}
2007 const quFIFO=0;
2008 quLIFO=1;
2009 quPriority=2;
2010 quNoConvert_Address=0;
2011 quConvert_Address=4;
2013 {Close a queue. If the calling process has created the queue, it is
2014 destroyed. If you can guarantee the handle is correct, there is no need
2015 to check for error codes.}
2016 function DosCloseQueue(Handle:longint):longint; cdecl;
2018 {Create a queue. The process that creates a queue, owns that queue, and is
2019 the only one who can read from that queue. Other processes can only write
2020 to that queue. The queuename must have the format '\QUEUES\name.ext' .
2022 Handle = Receives queue handle.
2023 Priority = 0 = Use FIFO system.
2024 1 = Use LIFO system.
2025 2 = Use priority system.
2026 Add 4 to convert addresses of data inserted by 16-bit
2027 processes to 32 bit pointers.
2028 Name = Name of queue to create.}
2029 function DosCreateQueue(var Handle:longint;Priority:longint;
2030 Name:PChar):longint; cdecl;
2031 function DosCreateQueue(var Handle:longint;Priority:longint;
2032 const Name:string):longint;
2034 {Open an existing queue. You cannot read from the queue unless you are the
2035 process that created it. The name must have the format '\QUEUES\name.ext'}
2036 function DosOpenQueue(var Parent_PID:longint;var Handle:longint;
2037 Name:PChar):longint; cdecl;
2038 function DosOpenQueue(var Parent_PID:longint;var Handle:longint;
2039 const Name:string):longint;
2041 {Read a record from a queue, but do not remove it from the queue.
2042 Handle = Handle of queue to read from.
2043 ReqBuffer = Receives information about read data.
2044 DataLen = Receives length of data read.
2045 DataPtr = Receives the address of the data.
2046 Element = 0 = Return first element in queue.
2047 1 = Return next element in queue. Can be repeated.
2048 Current element number is returned here, for use
2049 with DosReadQueue.
2050 Wait = 0 = Wait until there is a queue element available.
2051 1 = Return with an error when queue is empty.
2052 Priority = Receives priority of queue record (1..15).
2053 ASem = Use NIL if Wait=0, give a handle of a semaphore when
2054 Wait=1. The semaphore will be cleared when there is an
2055 element inserted it the queue.
2056 !! event queue}
2057 function DosPeekQueue(Handle:longint;var ReqBuffer:TRequestData;
2058 var DataLen:longint;var DataPtr:pointer;
2059 var Element:longint;Wait:longint;
2060 var Priority:byte;ASem:longint):longint; cdecl;
2062 {Empty a queue. You must be the process the created the queue.}
2063 function DosPurgeQueue(Handle:longint):longint; cdecl;
2065 {Return the number of elements in the queue.}
2066 function DosQueryQueue(Handle:longint;var Count:longint):longint; cdecl;
2068 {Read a record from a queue, but do not remove it from the queue.
2069 Handle = Handle of queue to read from.
2070 ReqBuffer = Receives information about read data.
2071 DataLen = Receives length of data read.
2072 DataPtr = Receives the address of the data.
2073 Element = 0 = Return first element in queue.
2074 Otherwise: Return the element numbered with this.
2075 Wait = 0 = Wait until there is a queue element available.
2076 1 = Return with an error when queue is empty.
2077 Priority = Receives priority of queue record (1..15).
2078 ASem = Use NIL if Wait=0, give a handle of a semaphore when
2079 Wait=1. The semaphore will be cleared when there is an
2080 element inserted it the queue.
2081 !! event queue}
2082 function DosReadQueue(Handle:longint;var ReqBuffer:TRequestData;
2083 var DataLen:longint;var DataPtr:pointer;
2084 Element,Wait:longint;var Priority:byte;
2085 ASem:longint):longint; cdecl;
2087 {Write a data record to a queue.
2088 Handle = Handle of queue to write to.
2089 Request = Value that will be inserted in the RequestData field when
2090 element is read from queue.
2091 DataLen = Size of data to write.
2092 DataBuf = Data to write.
2093 Priority = Priority of data in buffer. Only relevant when queue is
2094 created with priority support.}
2095 function DosWriteQueue(Handle,Request,Datalen:longint;var DataBuf;
2096 Priority:longint):longint; cdecl;
2098 const deHardErr = 1; {Hard errors are enabled, to disable
2099 do not give this switch.}
2100 deDisableExceptions = 2; {Exceptions are disabled, to enable
2101 do not give this switch.}
2103 {****************************************************************************
2105 Error handling related routines.
2107 ****************************************************************************}
2109 {Disable the end user notification of hardware errors and exceptions. Users
2110 can overide this in config.sys. By default, notification is enabled.
2111 There is no need for error checking if you can guarantee the parameter is
2112 correct.}
2113 function DosError(Error:longint):longint; cdecl;
2115 {Get information about an error code.
2116 It cannot fail, so it is written as procedure.
2118 Code = Error code to get info about.
2119 _Class = Receives the error class.
2120 Action = Receives the recommended action you should take.
2121 Locus = Receives what could have caused the error.}
2122 procedure DosErrClass(Code:longint;var _Class,Action,Locus:longint); cdecl;
2125 {****************************************************************************
2127 Message file specific routines.
2129 ****************************************************************************}
2132 type PInsertTable=^TInsertTable;
2133 TInsertTable=array[1..9] of PChar;
2135 {Get a message from a messagefile.
2136 Table = Table of strings to insert.
2137 TableSize = Number of strings in table.
2138 Buf = Address of buffer to store message in.
2139 BufSize = Size of buffer to store message in.
2140 MsgNumber = Number of message to get.
2141 FileName = Name of file to get message from.
2142 MsgSize = The size of the message returned.}
2143 function DosGetMessage(Table:PInsertTable;TableSize:longint;Buf:PChar;
2144 BufSize,MsgNumber:longint;FileName:PChar;
2145 var MsgSize:longint):longint;
2146 {And a variant using strings and open arrays.
2147 function DosGetMessage(const Table:array of PString;var Buf:string;
2148 BufSize,MsgNumber:longint;const FileName:PChar):longint;}
2150 {And a variant using strings, but with a PChar buffer, because of long
2151 messages, and open arrays.
2152 function DosGetMessage(const Table:array of PString;Buf:PChar;
2153 BufSize,MsgNumber:longint;const FileName:string;
2154 MsgSize:longint):longint;}
2156 {Insert textstrings into a message. The message must be loaded before with
2157 DosGetMessage. This function is used when the insert strings are not yet
2158 known when the message was loaded.
2159 Table = Table of strings to insert.
2160 TableSize = Number of struings to insert.
2161 Message = Message to insert strings into.
2162 SrcMessageSize = Size of message to insert strings into.
2163 Buf = Receives adjusted message.
2164 BufSize = Size of your buffer.
2165 DstMessageSize = Receives size of adjusted message.}
2166 function DosInsertMessage(Table:PInsertTable;TableSize:longint;
2167 Message:PChar;SrcMessageSize:longint;
2168 Buf:PChar;BufSize:longint;
2169 var DstMessageSize:longint):longint; cdecl;
2170 {And a variant using strings and open arrays.
2171 function DosInsertMessage(Table:array of PString;
2172 const Message:string;
2173 var Buf:openstring):longint;}
2175 {And a variant using strings, but with a PChar buffer, because of long
2176 messages, and open arrays.
2177 function DosInsertMessage(Table:array of PString;
2178 Message:PChar;SrcMessageSize:longint;
2179 Buf:PChar;BufSize:longint;
2180 var DstMessageSize:longint):longint;}
2182 {Write a message to a file.
2183 Handle = Handle of file.
2184 Size = Size of message.
2185 Buf = Buffer where message is located.}
2186 function DosPutMessage(Handle,Size:longint;Buf:PChar):longint; cdecl;
2187 function DosPutMessage(Handle:longint;const Buf:string):longint;
2189 {Get info about which codepages and languages a messagefile supports.
2190 Buf = Receives information.
2191 BufSize = Size of buffer.
2192 FileName = Filename of message file.
2193 InfoSize = Receives size in bytes of the returned info.}
2194 function DosQueryMessageCP(var Buf;BufSize:longint;FileName:PChar;
2195 var InfoSize:longint):longint;
2196 function DosQueryMessageCP(var Buf;BufSize:longint;const FileName:string;
2197 var InfoSize:longint):longint;
2199 {****************************************************************************
2201 Session specific routines.
2203 ****************************************************************************}
2205 type TStatusData=record
2206 Length:word; {Length, in bytes, of datastructure.}
2207 SelectIND:word; {Determines if the session can be
2208 selected: Don't change/selectable/
2209 not selectable (0/1/2).}
2210 BondIND:word; {Determines which section will come
2211 to the foreground when it is
2212 selected: Don't change/child to
2213 foreground when parent selected/
2214 parent to foreground when parent
2215 selected.}
2216 end;
2217 PStatusData=^TStatusData;
2219 type TStartData=record
2220 {Note: to omit some fields, use a length smaller than
2221 SizeOf(TStartData).}
2222 Length:word; {Length, in bytes, of datastructure.}
2223 Related:word; {Independent/child session (0/1).}
2224 FgBg:word; {Foreground/background (0/1).}
2225 TraceOpt:word; {No trace/trace this/trace all
2226 (0/1/2).}
2227 PgmTitle:PChar; {Program title.}
2228 PgmName:PChar; {Filename to program.}
2229 PgmInputs:PChar; {Command parameters (nil allowed).}
2230 TermQ:PChar; {System queue. (nil allowed).}
2231 Environment:PChar; {Environment to pass (nil allowed).}
2232 InheritOpt:word; {Inherit enviroment from shell/
2233 inherit environment from parent
2234 (0/1).}
2235 SessionType:word; {Auto/full screen/window/presentation
2236 manager/full screen Dos/windowed Dos
2237 (0/1/2/3/4/5/6/7).}
2238 Iconfile:PChar; {Icon file to use (nil allowed).}
2239 PgmHandle:longint; {0 or the program handle.}
2240 PgmControl:word; {Bitfield describing initial state
2241 of windowed sessions.}
2242 InitXPos,InitYPos:word; {Initial top coordinates.}
2243 InitXSize,InitYSize:word; {Initial size.}
2244 Reserved:word;
2245 ObjectBuffer:PChar; {If a module cannot be loaded, its
2246 name will be returned here.}
2247 ObjectBuffLen:longint; {Size of your buffer.}
2248 end;
2249 PStartData=^TStartData;
2250 StartData=TStartData;
2252 {Start a new session.
2253 AStartData = A startdata record.
2254 SesID = Receives session ID of session created.
2255 PID = Receives process ID of process created.}
2256 function DosStartSession(const AStartData:TStartData;
2257 var SesID,PID:longint):longint; cdecl;
2259 {Set the status of a child session.
2260 SesID = ID of session.
2261 AStatus = Status to set.}
2262 function DosSetSession(SesID:longint;const AStatus:TStatusData):longint; cdecl;
2264 {Bring a child session to the foreground.
2265 SesID = ID of session.}
2266 function DosSelectSession(SesID:longint):longint; cdecl;
2268 {Terminate (a) child session(s).
2269 Scope = 0 = Terminate specified session.
2270 1 = Terminate all child sessions.
2271 SesID = ID of session to terminate (ignored when terminating
2272 all).}
2273 function DosStopSession(Scope,SesID:longint):longint; cdecl;
2275 {****************************************************************************
2277 Named/unnamed pipe specific routines.
2279 ****************************************************************************}
2281 type TAvailData=record
2282 cbPipe, {Number of bytes in pipe.}
2283 cbMessage:word; {Number of bytes in current message.}
2284 end;
2286 TPipeInfo=record
2287 cbOut:word; {Size of outbound data.}
2288 cbIn:word; {Size of inbound data.}
2289 MaxInst:byte; {Maximum number of instances.}
2290 CurInst:byte; {Current number of instances.}
2291 Name:string; {Name of the pipe. You can use @Name[1] if
2292 you need a PChar to the name; the string is
2293 always followed by a zero.}
2294 end;
2296 TPipeSemState=record
2297 Status:byte;
2298 Flag:byte;
2299 Key:word;
2300 Avail:word;
2301 end;
2303 {Create an unnamed pipe.
2304 ReadHandle = Receives handle for reading from pipe.
2305 WriteHandle = Receives handle to write to pipe.
2306 Size = Size of pipe to create. 0 means default size. If data is
2307 written into a pipe that is smaller than the sent data, the
2308 writing thread is suspended until the data has been read
2309 from the pipe, thus making room for more data to send.}
2310 function DosCreatePipe(var ReadHandle,WriteHandle:longint;
2311 Size:longint):longint; cdecl;
2313 const {np_XXXX constants for openmode.}
2314 np_Access_Inbound = $0000; {Client to server connection.}
2315 np_Access_Outbound = $0001; {Server to client access.}
2316 np_Access_Duplex = $0002; {Two way access.}
2317 np_Inherit = $0080; {Pipe handle is inherited by
2318 child processes.}
2319 np_No_Write_Behind = $4000; {Don't allow write behind for
2320 remote pipes.}
2321 {np_XXXX constants for pipemode.}
2322 np_Unlimited_Instances = $00ff; {Unlimited instances.}
2323 np_ReadMode_Mesg = $0100; {Read the pipe as a message
2324 stream instead of as a byte
2325 stream.}
2326 np_ReadMode_Message = np_ReadMode_Mesg;
2327 np_WriteMode_Mesg = $0400; {Write the pipe as a message
2328 stream instead of as a byte
2329 stream.}
2330 np_WriteMode_Message = np_WriteMode_Mesg;
2331 np_Type_Message = np_WriteMode_Mesg;
2332 np_NoWait = $8000; {Dosread and Doswrite do not
2333 wait is no data can be read or
2334 written; they return with an
2335 error message.}
2337 {Create a named pipe.
2338 Name = Name of pipe to create.
2339 Handle = Receives handle to pipe.
2340 OpenMode = A combination of np_XXXX constants for openmode.
2341 PipeMode = A combination of np_XXXX constants for pipemode,
2342 plus a number within [1..254] which determines the number
2343 of instances that can be created to the pipe, or,
2344 np_Unlimited_Instance for an unlimited number of
2345 instances.
2346 OutBufSize = The number of bytes to allocate for the output buffer.
2347 InBufSize = The number of bytes to allocate for the input buffer.
2348 MSec = The maximum time to wait for an available instance.}
2349 function DosCreateNPipe(Name:PChar;var Handle:longint;OpenMode,PipeMode,
2350 OutBufSize,InBufSize,MSec:longint):longint; cdecl;
2351 function DosCreateNPipe(const Name:string;var Handle:longint;OpenMode,
2352 PipeMode,OutBufSize,InBufSize,MSec:longint):longint;
2354 {Makes a procedure call to a duplex message pipe.
2355 Name = Name of pipe.
2356 Input = Buffer that contains data to be written to the pipe.
2357 InputSize = Size of the inputdata.
2358 Output = Buffer that contains data to be read from the pipe.
2359 OutputSize = Size of the outputbuffer.
2360 ReadBytes = Receives number of bytes actually read.
2361 MSec = The maximum time to wait for an available instance.}
2362 function DosCallNPipe(Name:PChar;var Input;InputSize:longint;
2363 var Output;OutputSize:longint;var ReadBytes:longint;
2364 MSec:longint):longint; cdecl;
2365 function DosCallNPipe(const Name:string;var Input;InputSize:longint;
2366 var Output;OutputSize:longint;var ReadBytes:longint;
2367 MSec:longint):longint;
2369 {Prepare a named pipe for a client process.
2370 Handle = Handle that was returned when pipe was created.}
2371 function DosConnectNPipe(Handle:longint):longint; cdecl;
2373 {Acknowledges that a client process has closed a named pipe.
2374 Handle = Handle that was returned when pipe was created.}
2375 function DosDisconnectNPipe(Handle:longint):longint; cdecl;
2377 const np_State_Disconnected = 1; {Pipe is disconnected.}
2378 np_State_Listening = 2; {Pipe is listening.}
2379 np_State_Connected = 3; {Pipe is connected.}
2380 np_State_Closing = 4; {Pipe is closing.}
2382 {Preview data in a pipe: Read data without removing it.
2383 Handle = Handle to named pipe.
2384 Buffer = Buffer to receive data in.
2385 BufSize = Size of the buffer.
2386 ReadBytes = Receives number of bytes put in buffer.
2387 Avail = Receives size of available data.
2388 State = One of the np_xxxx constants for states.}
2389 function DosPeekNPipe(Handle:longint;var Buffer;BufSize:longint;
2390 var ReadBytes:longint;var Avail:TAvailData;
2391 var State:longint):longint; cdecl;
2393 {Get information about a named pipe handle.
2394 Handle = Handle to pipe.
2395 State = A combination of np_XXXX constants for (!!!) pipemode.}
2396 function DosQueryNPHState(Handle:longint;var State:longint):longint; cdecl;
2398 {Return information about a named pipe.
2399 Handle = Handle to pipe.
2400 InfoLevel = Level of information wanted (1 or 2 allowed).
2401 Buffer = TPipeInfo datastructure for level 1.
2402 Unique 4 byte identifier of the client for level 2. Only
2403 used for LAN based pipe servers.}
2404 function DosQueryNPipeInfo(Handle,InfoLevel:longint;var Buffer;
2405 BufSize:longint):longint; cdecl;
2407 {Return information of local named pipes that are attached to a semaphore.
2408 SemHandle = Handle to a shared event or MuxWait semaphore that is
2409 attached to a named pipe.
2410 SemArray = Array in which for each pipe attached to the semaphore.
2411 BufSize = Size of SemArray, in bytes.}
2412 function DosQueryNPipeSemState(Semhandle:longint;var SemArray;
2413 BufSize:longint):longint; cdecl;
2415 {Resets the blocking mode and state of a named pipe.
2416 Handle = Handle to named pipe.
2417 State = One of the np_XXXX constants for pipemode.}
2418 function DosSetNPHState(Handle,State:longint):longint; cdecl;
2420 {Attach a shared event semaphore to a local named pipe.
2421 PipeHandle = Handle to named pipe.
2422 SemHandle = Handle to semaphore.
2423 Key = A key that must be different for each named pipe that is
2424 attached to the semaphore.}
2425 function DosSetNPipeSem(PipeHandle,SemHandle,Key:longint):longint; cdecl;
2427 {Write to a duplex named pipe; then read from it.
2428 Handle = Handle to named pipe.
2429 OutBuf = The data to write.
2430 OutSize = Size of the data to write.
2431 InBuf = Receives the read data.
2432 InSize = Size of the input buffer.
2433 ReadBytes = Number of bytes read from the pipe.}
2434 function DosTransactNPipe(Handle:longint;var OutBuf;OutSize:longint;
2435 var InBuf;InSize:longint;
2436 var ReadBytes:longint):longint; cdecl;
2438 {Waits until an instance of a named pipe becomes available.
2439 Name = Name of named pipe (always starts with '\PIPE\').
2440 MSec = Return with an error code if this time has elapsed.}
2441 function DosWaitNPipe(Name:PChar;MSec:longint):longint; cdecl;
2442 function DosWaitNPipe(const Name:string;MSec:longint):longint;
2444 {****************************************************************************
2446 Virtual device driver related routines.
2448 ****************************************************************************}
2450 {Open a virtual device driver.
2451 Name = Name of virtual device driver.
2452 Handle = Receives handle to virtual device driver.}
2453 function DosOpenVDD(Name:PChar;var Handle:longint):longint; cdecl;
2455 {Request to talk with a virtual device driver.
2456 Handle = Handle to virtual device driver.
2457 SGroup = Handle to the screen group of a DOS session (may be nil).
2458 Cmd = A number which indicates the service you call.
2459 InSize = Size of the data to send to the VDD.
2460 InBuffer = Buffer which contains the data to send to the VDD.
2461 OutSize = Size of the buffer in which the VDD will return data.
2462 OutBuffer = Receives the data that the VDD returns.}
2463 function DosRequestVDD(Handle,SGroup,Cmd:longint;
2464 InSize:longint;var InBuffer;
2465 OutSize:longint;var OutBuffer):longint; cdecl;
2467 {Close a virtual device driver.}
2468 function DosCloseVDD(Handle:longint):longint; cdecl;
2470 {****************************************************************************
2472 16 <=> 32 bit support related routines
2474 ****************************************************************************}
2476 {Convert a 16 bit far pointer to a 32 bit near pointer.
2477 This procedure needs to be called from assembler.
2478 This procedure works by mapping an area in your flat address space onto the
2479 same physical memory address as the selector of the 16 bit far pointer.
2482 eax Pointer to convert in selector:offset format.
2484 Out:
2485 eax Returned 32 bit near pointer.}
2486 procedure DosSelToFlat; cdecl;
2488 type
2489 TFarPtr = record
2490 Sel, Offset: word;
2491 end;
2493 function SelToFlat (AFarPtr: TFarPtr): pointer;
2495 {Convert a 32 bit near pointer to a 16 bit far pointer.
2496 This procedure needs to be called from assembler.
2497 This procedure works by allocating a selector at the same physical address
2498 as the pointer you pass points to.
2501 eax Pointer to convert in 32 bit near format.
2503 Out:
2504 eax Returned 16 bit far pointer in selector:offset format.}
2505 procedure DosFlatToSel; cdecl;
2507 {typecast result to TFarPtr}
2508 function FlatToSel (APtr: pointer): cardinal;
2510 {***************************************************************************}
2511 implementation
2512 {***************************************************************************}
2514 {$L code2.oo2}
2515 {$L code3.oo2}
2517 function DosCreateThread(var TID:longint;Address:TThreadEntry;
2518 aParam:pointer;Flags:longint;
2519 StackSize:longint):longint; cdecl;
2521 external 'DOSCALLS' index 311;
2523 function DosSuspendThread(TID:longint):longint; cdecl;
2525 external 'DOSCALLS' index 238;
2527 function DosResumeThread(TID:longint):longint; cdecl;
2529 external 'DOSCALLS' index 237;
2531 function DosKillThread(TID:longint):longint; cdecl;
2533 external 'DOSCALLS' index 111;
2535 function DosWaitThread(var TID:longint;Option:longint):longint; cdecl;
2537 external 'DOSCALLS' index 349;
2539 function DosEnterCritSec:longint; cdecl;
2541 external 'DOSCALLS' index 232;
2543 function DosExitCritSec:longint; cdecl;
2545 external 'DOSCALLS' index 233;
2547 procedure DosExit(Action,Result:longint); cdecl;
2549 external 'DOSCALLS' index 233;
2551 {procedure DosGetInfoBlocks(var ATIB:PThreadInfoBlock;
2552 var APIB:PProcessInfoBlock); cdecl;}
2554 procedure DosGetInfoBlocks(PATIB:PPThreadInfoBlock;
2555 PAPIB:PPProcessInfoBlock); cdecl;
2557 external 'DOSCALLS' index 312;
2559 procedure DosSleep (MSec:longint); cdecl;
2561 external 'DOSCALLS' index 229;
2563 function DosBeep(Freq,MS:longint):longint; cdecl;
2565 external 'DOSCALLS' index 286;
2567 function DosDebug(DebugBuf:pointer):longint; cdecl;
2569 external 'DOSCALLS' index 317;
2571 function DosExitList(OrderCode:longint;Proc:TExitProc):longint; cdecl;
2573 external 'DOSCALLS' index 296;
2575 function DosExecPgm(ObjName:PChar;ObjLen,ExecFlag:longint;
2576 Args,Env:PByteArray;var Res:TResultCodes;
2577 FileName:PChar):longint; cdecl;
2579 external 'DOSCALLS' index 283;
2581 function DosExecPgm(var ObjName:string;Execflag:longint;
2582 Args,Env:PByteArray;var Res:TResultCodes;
2583 const FileName:string):longint;
2585 var T,T2:array[0..255] of char;
2587 begin
2588 StrPCopy(@T,FileName);
2589 DosExecPgm:=DosExecPgm(@T2,SizeOf(T2),ExecFlag,Args,Env,Res,@T);;
2590 ObjName:=StrPas(@T2);
2591 end;
2593 function DosWaitChild(Action,Option:longint;var Res:TResultCodes;
2594 var TermPID:longint;PID:longint):longint; cdecl;
2596 external 'DOSCALLS' index 280;
2598 function DosSetPriority(Scope,TrClass,Delta,PortID:longint):longint; cdecl;
2600 external 'DOSCALLS' index 236;
2602 function DosKillProcess(Action,PID:longint):longint; cdecl;
2604 external 'DOSCALLS' index 235;
2606 function DosQueryAppType(FileName:PChar;var Flags:longint):longint; cdecl;
2608 external 'DOSCALLS' index 323;
2610 function DosDevConfig(var DevInfo:byte;Item:longint):longint; cdecl;
2612 external 'DOSCALLS' index 231;
2614 function DosSetFileLocks(Handle:longint;var Unlock,Lock:TFileLock;
2615 Timeout,Flags:longint):longint; cdecl;
2617 external 'DOSCALLS' index 428;
2619 function DosCancelLockRequest(Handle:longint;var Lock:TFileLock):longint;
2620 cdecl;
2622 external 'DOSCALLS' index 429;
2624 function DosOpen(FileName:PChar;var Handle,Action:longint;
2625 InitSize,Attrib,OpenFlags,FileMode:longint;
2626 EA:PEAOp2):longint; cdecl;
2628 external 'DOSCALLS' index 273;
2630 function DosCreate(FileName:PChar;var Handle:longint;
2631 Attrib,OpenMode:longint):longint;
2633 var Action:longint;
2635 begin
2636 DosCreate:=DosOpen(FileName,Handle,Action,0,Attrib,18,OpenMode,nil);
2637 end;
2639 function DosOpen(FileName:PChar;var Handle:longint;
2640 Attrib,OpenMode:longint):longint;
2642 var Action:longint;
2644 begin
2645 DosOpen:=DosOpen(FileName,Handle,Action,0,Attrib,1,OpenMode,nil);
2646 end;
2648 function DosOpen(const FileName:string;var Handle,Action:longint;
2649 InitSize,Attrib,OpenFlags,OpenMode:longint;
2650 EA:PEAOp2):longint;
2652 var T:array[0..255] of char;
2654 begin
2655 StrPCopy(@T,FileName);
2656 DosOpen:=DosOpen(@T,Handle,Action,InitSize,Attrib,OpenFlags,OpenMode,EA);
2657 end;
2659 function DosCreate(const FileName:string;var Handle:longint;
2660 Attrib,OpenMode:longint):longint;
2662 var T:array[0..255] of char;
2663 Action:longint;
2665 begin
2666 StrPCopy(@T,FileName);
2667 DosCreate:=DosOpen(@T,Handle,Action,0,Attrib,18,OpenMode,nil);
2668 end;
2670 function DosOpen(const FileName:string;var Handle:longint;
2671 Attrib,OpenMode:longint):longint;
2673 var T:array[0..255] of char;
2674 Action:longint;
2676 begin
2677 StrPCopy(@T,FileName);
2678 DosOpen:=DosOpen(@T,Handle,Action,0,Attrib,1,OpenMode,nil);
2679 end;
2681 function DosClose(Handle:longint):longint; cdecl;
2683 external 'DOSCALLS' index 257;
2685 function DosRead(Handle:longint;var Buffer;Count:longint;
2686 var ActCount:longint):longint; cdecl;
2688 external 'DOSCALLS' index 281;
2690 function DosWrite(Handle:longint;var Buffer;Count:longint;
2691 var ActCount:longint):longint; cdecl;
2693 external 'DOSCALLS' index 282;
2695 function DosSetFilePtr(Handle:longint;Pos,Method:longint;
2696 var PosActual:longint):longint; cdecl;
2698 external 'DOSCALLS' index 256;
2700 function DosSetFilePtr(Handle:longint;Pos:longint):longint;
2702 var PosActual:longint;
2704 begin
2705 DosSetFilePtr:=DosSetFilePtr(Handle,Pos,0,PosActual);
2706 end;
2708 function DosGetFilePtr(Handle:longint;var PosActual:longint):longint;
2710 begin
2711 DosGetFilePtr:=DosSetFilePtr(Handle,0,1,PosActual);
2712 end;
2714 function DosSetFileSize(Handle,Size:longint):longint; cdecl;
2716 external 'DOSCALLS' index 272;
2718 function DosResetBuffer(Handle:longint):longint; cdecl;
2720 external 'DOSCALLS' index 254;
2722 function DosDupHandle(Handle:longint;var Duplicate:longint):longint; cdecl;
2724 external 'DOSCALLS' index 260;
2726 function DosQueryFHState(Handle:longint;var FileMode:longint):longint; cdecl;
2728 external 'DOSCALLS' index 276;
2730 function DosSetFHState(Handle,FileMode:longint):longint; cdecl;
2732 external 'DOSCALLS' index 221;
2734 function DosQueryHType(Handle:longint;var HandType:longint;
2735 var Attr:longint):longint; cdecl;
2737 external 'DOSCALLS' index 224;
2739 function DosEditName(MetaLevel:longint;Source,Edit:PChar;
2740 Target:PChar;TargetLen:longint):longint; cdecl;
2742 external 'DOSCALLS' index 261;
2744 function DosEditName(MetaLevel:longint;const Source,Edit:string;
2745 var Target:string):longint;
2747 var T,T2,T3:array[0..255] of char;
2749 begin
2750 StrPCopy(@T,Source);
2751 StrPCopy(@T2,Edit);
2752 DosEditName:=DosEditName(MetaLevel,@T,@T2,@T3,SizeOf(T3));
2753 Target:=StrPas(@T3);
2754 end;
2756 function DosMove(OldFile,NewFile:PChar):longint; cdecl;
2758 external 'DOSCALLS' index 271;
2760 function DosMove(const OldFile,NewFile:string):longint;
2762 var T,T2:array[0..255] of char;
2764 begin
2765 StrPCopy(@T,OldFile);
2766 StrPCopy(@T2,NewFile);
2767 DosMove:=DosMove(@T,@T2);
2768 end;
2770 function DosCopy(OldFile,NewFile:PChar;Option:longint):longint; cdecl;
2772 external 'DOSCALLS' index 258;
2774 function DosCopy(const OldFile,NewFile:string;Option:longint):longint;
2776 var T,T2:array[0..255] of char;
2778 begin
2779 StrPCopy(@T,OldFile);
2780 StrPCopy(@T2,NewFile);
2781 DosCopy:=DosCopy(@T,@T2,Option);
2782 end;
2784 function DosDelete(FileName:PChar):longint; cdecl;
2786 external 'DOSCALLS' index 259;
2788 function DosDelete(const FileName:string):longint;
2790 var T:array[0..255] of char;
2792 begin
2793 StrPCopy(@T,FileName);
2794 DosDelete:=DosDelete(@T);
2795 end;
2797 function DosForceDelete(FileName:PChar):longint; cdecl;
2799 external 'DOSCALLS' index 110;
2801 function DosForceDelete(const FileName:string):longint;
2803 var T:array[0..255] of char;
2805 begin
2806 StrPCopy(@T,FileName);
2807 DosForceDelete:=DosForceDelete(@T);
2808 end;
2810 function DosCreateDir(Name:PChar;EA:PEAOp2):longint; cdecl;
2812 external 'DOSCALLS' index 270;
2814 function DosCreateDir(Name:PChar):longint;
2816 begin
2817 DosCreateDir:=DosCreateDir(Name,nil);
2818 end;
2820 function DosCreateDir(const Name:string;EA:PEAOp2):longint;
2822 var T:array[0..255] of char;
2824 begin
2825 StrPCopy(@T,Name);
2826 DosCreateDir:=DosCreateDir(@T,EA);
2827 end;
2829 function DosCreateDir(const Name:string):longint;
2831 var T:array[0..255] of char;
2833 begin
2834 StrPCopy(@T,Name);
2835 DosCreateDir:=DosCreateDir(@T,nil);
2836 end;
2838 function DosDeleteDir(Name:PChar):longint; cdecl;
2840 external 'DOSCALLS' index 226;
2842 function DosDeleteDir(const Name:string):longint;
2844 var T:array[0..255] of char;
2846 begin
2847 StrPCopy(@T,Name);
2848 DosDeleteDir:=DosDeleteDir(@T);
2849 end;
2851 function DosSetDefaultDisk(DiskNum:longint):longint; cdecl;
2853 external 'DOSCALLS' index 220;
2855 procedure DosQueryCurrentDisk(var DiskNum:longint;var Logical:longint); cdecl;
2857 external 'DOSCALLS' index 275;
2859 function DosSetCurrentDir(Name:PChar):longint; cdecl;
2861 external 'DOSCALLS' index 255;
2863 function DosSetCurrentDir(const Name:string):longint;
2865 var T:array[0..255] of char;
2867 begin
2868 StrPCopy(@T,Name);
2869 DosSetCurrentDir:=DosSetCurrentDir(@T);
2870 end;
2872 function DosQueryCurrentDir(DiskNum:longint;var Buffer;
2873 var BufLen:longint):longint; cdecl;
2875 external 'DOSCALLS' index 274;
2877 function DosQueryCurrentDir(DiskNum:longint;var Buffer:string):longint;
2879 var T:array[0..255] of char;
2880 L:longint;
2882 begin
2883 L:=255;
2884 DosQueryCurrentDir:=DosQueryCurrentDir(DiskNum,T,L);
2885 Buffer:=StrPas(@T);
2886 end;
2888 function DosDevIOCtl(Handle,Category,Func:longint;var Params;
2889 ParamLen:longint;var ParamSize:longint;
2890 var Data;DataLen:longint;var DataSize:longint):longint; cdecl;
2892 external 'DOSCALLS' index 284;
2894 function DosFindFirst(FileMask:PChar;var Handle:longint;Attrib:longint;
2895 AFileStatus:PFileStatus;FileStatusLen:longint;
2896 var Count:longint;InfoLevel:longint):longint; cdecl;
2898 external 'DOSCALLS' index 264;
2900 function DosFindFirst(const FileMask:string;var Handle:longint;
2901 Attrib:longint;AFileStatus:PFileStatus;
2902 FileStatusLen:longint;var Count:longint;
2903 InfoLevel:longint):longint;
2905 var T:array[0..255] of char;
2907 begin
2908 StrPCopy(@T,FileMask);
2909 DosFindFirst:=DosFindFirst(@T,Handle,Attrib,AFileStatus,FileStatusLen,
2910 Count,InfoLevel);
2911 end;
2913 function DosFindNext(Handle:longint;AFileStatus:PFileStatus;
2914 FileStatusLen:longint;var Count:longint):longint; cdecl;
2916 external 'DOSCALLS' index 265;
2918 function DosFindClose(Handle:longint):longint; cdecl;
2920 external 'DOSCALLS' index 263;
2922 function DosQueryFileInfo(Handle,InfoLevel:longint;AFileStatus:PFileStatus;
2923 FileStatusLen:longint):longint; cdecl;
2925 external 'DOSCALLS' index 279;
2927 function DosSetFileInfo(Handle,InfoLevel:longint;AFileStatus:PFileStatus;
2928 FileStatusLen:longint):longint; cdecl;
2930 external 'DOSCALLS' index 218;
2932 function DosQueryPathInfo(FileName:PChar;InfoLevel:longint;
2933 AFileStatus:PFileStatus;FileStatusLen:longint):longint; cdecl;
2935 external 'DOSCALLS' index 223;
2937 function DosQueryPathInfo(const FileName:string;InfoLevel:longint;
2938 AFileStatus:PFileStatus;FileStatusLen:longint):longint;
2940 var T:array[0..255] of char;
2942 begin
2943 StrPCopy(@T,FileName);
2944 DosQueryPathInfo:=DosQueryPathInfo(@T,InfoLevel,AFileStatus,
2945 FileStatusLen);
2946 end;
2948 function DosSetPathInfo(FileName:PChar;InfoLevel:longint;
2949 AFileStatus:PFileStatus;FileStatusLen,
2950 Options:longint):longint; cdecl;
2952 external 'DOSCALLS' index 219;
2954 function DosEnumAttribute(RefType:longint;AFile:pointer;
2955 Entry:longint;var Buf;BufSize:longint;
2956 var Count:longint;InfoLevel:longint):longint; cdecl;
2958 external 'DOSCALLS' index 372;
2960 function DosEnumAttribute(Handle,Entry:longint;var Buf;BufSize:longint;
2961 var Count:longint;InfoLevel:longint):longint;
2963 begin
2964 DosEnumAttribute:=DosEnumAttribute(0,@Handle,Entry,Buf,BufSize,Count,
2965 InfoLevel);
2966 end;
2968 function DosEnumAttribute(const FileName:string;
2969 Entry:longint;var Buf;BufSize:longint;
2970 var Count:longint;InfoLevel:longint):longint;
2972 var T:array[0..255] of char;
2974 begin
2975 StrPCopy(@T,FileName);
2976 DosEnumAttribute:=DosEnumAttribute(1,@T,Entry,Buf,BufSize,Count,
2977 InfoLevel);
2978 end;
2980 function DosScanEnv(Name:PChar;var Value:PChar):longint; cdecl;
2982 external 'DOSCALLS' index 227;
2984 function DosScanEnv(const Name:string;var Value:string):longint;
2986 var T:array[0..255] of char;
2987 P:PChar;
2989 begin
2990 StrPCopy(@T,Name);
2991 DosScanEnv:=DosScanEnv(@T,P);
2992 Value:=StrPas(P);
2993 end;
2995 function DosSearchPath(Flag:longint;DirList,FileName:PChar;
2996 FullName:PChar;FullLen:longint):longint; cdecl;
2998 external 'DOSCALLS' index 228;
3000 function DosSearchPath(Flag:longint;const DirList,FileName:string;
3001 var FullName:string):longint;
3003 var T1,T2,T3:array[0..255] of char;
3005 begin
3006 StrPCopy(@T1,DirList);
3007 StrPCopy(@T2,FileName);
3008 DosSearchPath:=DosSearchPath(Flag,@T1,@T2,@T3,SizeOf(T3));
3009 FullName:=StrPas(@T3);
3010 end;
3012 function DosFSAttach(DevName,FileSystem:PChar;var Data:TAttachData;
3013 DataLen,Flag:longint):longint; cdecl;
3015 external 'DOSCALLS' index 269;
3017 function DosFSAttach(const DevName,FileSystem:string;var Data:TAttachData;
3018 DataLen,Flag:longint):longint;
3020 var T1,T2:array[0..255] of char;
3022 begin
3023 StrPCopy(@T1,DevName);
3024 StrPCopy(@T2,FileSystem);
3025 DosFSAttach:=DosFSAttach(@T1,@T2,Data,DataLen,Flag);
3026 end;
3028 function DosQueryFSAttach(DevName:PChar;Ordinal,InfoLevel:longint;
3029 var Buffer:TFSQBuffer2;var BufLen:longint):longint; cdecl;
3031 external 'DOSCALLS' index 277;
3033 function DosQueryFSAttach(const DevName:string;Ordinal,InfoLevel:longint;
3034 var Buffer:TFSQBuffer2;var BufLen:longint):longint;
3036 var T:array[0..255] of char;
3038 begin
3039 StrPCopy(@T,DevName);
3040 DosQueryFSAttach:=DosQueryFSAttach(@T,Ordinal,InfoLevel,Buffer,BufLen);
3041 end;
3043 function DosFSCtl(Data:pointer;DataLen:longint;var ResDataLen:longint;
3044 Parms:pointer;ParmsLen:longint;var ResParmsLen:longint;
3045 _Function:longint;Route:PChar;
3046 Handle,Method:longint):longint; cdecl;
3048 external 'DOSCALLS' index 285;
3050 function DosFSCtl(Data:pointer;DataLen:longint;var ResDataLen:longint;
3051 Parms:pointer;ParmsLen:longint;var ResParmsLen:longint;
3052 _Function:longint;const Route:string;
3053 Handle,Method:longint):longint;
3055 var T:array[0..255] of char;
3057 begin
3058 StrPCopy(@T,Route);
3059 DosFSCtl:=DosFSCtl(Data,Datalen,ResDataLen,Parms,ParmsLen,ResParmsLen,
3060 _Function,Route,Handle,Method);
3061 end;
3063 function DosQueryFSInfo(DiskNum,InfoLevel:longint;var Buffer:TFSInfo;
3064 BufLen:longint):longint; cdecl;
3066 external 'DOSCALLS' index 278;
3068 function DosSetFSInfo(DiskNum,InfoLevel:longint;var Buffer:TFSInfo;
3069 BufLen:longint):longint; cdecl;
3071 external 'DOSCALLS' index 222;
3073 function DosQueryVerify(var Enabled:longint):longint; cdecl;
3075 external 'DOSCALLS' index 225;
3077 function DosSetVerify(Enable:longint):longint; cdecl;
3079 external 'DOSCALLS' index 210;
3081 function DosSetMaxFH(Count:longint):longint; cdecl;
3083 external 'DOSCALLS' index 209;
3085 function DosSetRelMaxFH(var ReqCount,CurMaxFH:longint):longint; cdecl;
3087 external 'DOSCALLS' index 382;
3089 function DosShutDown(Flags:longint):longint; cdecl;
3091 external 'DOSCALLS' index 415;
3093 function DosQuerySysInfo(First,Last:longint;var Buf;BufSize:longint):longint;
3094 cdecl;
3096 external 'DOSCALLS' index 348;
3098 function DosPhysicalDisk(Func:longint;Buf:pointer;BufSize:longint;
3099 Params:pointer;ParamSize:longint):longint; cdecl;
3101 external 'DOSCALLS' index 287;
3103 function DosAllocMem(var P:pointer;Size,Flag:longint):longint; cdecl;
3105 external 'DOSCALLS' index 299;
3107 function DosFreeMem(P:pointer):longint; cdecl;
3109 external 'DOSCALLS' index 304;
3111 function DosSetMem(P:pointer;Size,Flag:longint):longint; cdecl;
3113 external 'DOSCALLS' index 305;
3115 function DosGiveSharedMem(P:pointer;PID,Flag:longint):longint; cdecl;
3117 external 'DOSCALLS' index 303;
3119 function DosGetSharedMem(P:pointer;Flag:longint):longint; cdecl;
3121 external 'DOSCALLS' index 302;
3123 function DosGetNamedSharedMem(var P:pointer;Name:PChar;Flag:longint):longint;
3124 cdecl;
3126 external 'DOSCALLS' index 301;
3128 function DosGetNamedSharedMem(var P:pointer;const Name:string;
3129 Flag:longint):longint;
3131 var T:array[0..255] of char;
3133 begin
3134 StrPCopy(@T,Name);
3135 DosGetNamedSharedMem:=DosGetNamedSharedMem(P,@T,Flag);
3136 end;
3138 function DosAllocSharedMem(var P:pointer;Name:PChar;Size,Flag:longint):longint;
3139 cdecl;
3141 external 'DOSCALLS' index 300;
3143 function DosAllocSharedMem(var P:pointer;const Name:string;
3144 Size,Flag:longint):longint;
3146 var T:array[0..255] of char;
3148 begin
3149 if Name<>'' then
3150 begin
3151 StrPCopy(@T,Name);
3152 DosAllocSharedMem:=DosAllocSharedMem(P,@T,Size,Flag);
3154 else
3155 DosAllocSharedMem:=DosAllocSharedMem(P,nil,Size,Flag);
3156 end;
3158 function DosQueryMem(P:pointer;var Size,Flag:longint):longint; cdecl;
3160 external 'DOSCALLS' index 306;
3162 function DosSubAllocMem(Base:pointer;var P:pointer;Size:longint):longint;
3163 cdecl;
3165 external 'DOSCALLS' index 345;
3167 function DosSubFreeMem(Base,P:pointer;Size:longint):longint; cdecl;
3169 external 'DOSCALLS' index 346;
3171 function DosSubSetMem(Base:pointer;Flag,Size:longint):longint; cdecl;
3173 external 'DOSCALLS' index 344;
3175 function DosSubUnSetMem(Base:pointer):longint; cdecl;
3177 external 'DOSCALLS' index 347;
3179 function DosCreateEventSem(Name:PChar;var Handle:longint;
3180 Attr,State:longint):longint; cdecl;
3182 external 'DOSCALLS' index 324;
3184 function DosCreateEventSem(const Name:string;var Handle:longint;
3185 Attr,State:longint):longint;
3187 var T:array[0..255] of char;
3189 begin
3190 if Name<>'' then
3191 begin
3192 StrPCopy(@T,Name);
3193 DosCreateEventSem:=DosCreateEventSem(@T,Handle,Attr,State);
3195 else
3196 DosCreateEventSem:=DosCreateEventSem(nil,Handle,Attr,State);
3197 end;
3199 function DosOpenEventSem(Name:PChar;var Handle:longint):longint; cdecl;
3201 external 'DOSCALLS' index 325;
3203 function DosOpenEventSem(const Name:string;var Handle:longint):longint;
3205 var T:array[0..255] of char;
3207 begin
3208 StrPCopy(@T,Name);
3209 DosOpenEventSem:=DosOpenEventSem(@T,Handle);
3210 end;
3212 function DosCloseEventSem(Handle:longint):longint; cdecl;
3214 external 'DOSCALLS' index 326;
3216 function DosResetEventSem(Handle:longint;var PostCount:longint):longint; cdecl;
3218 external 'DOSCALLS' index 327;
3220 function DosPostEventSem(Handle:longint):longint; cdecl;
3222 external 'DOSCALLS' index 328;
3224 function DosWaitEventSem(Handle,Timeout:longint):longint; cdecl;
3226 external 'DOSCALLS' index 329;
3228 function DosQueryEventSem(Handle:longint;var Posted:longint):longint; cdecl;
3230 external 'DOSCALLS' index 330;
3232 function DosCreateMutExSem(Name:PChar;var Handle:longint;
3233 Attr,State:longint):longint; cdecl;
3235 external 'DOSCALLS' index 331;
3237 function DosCreateMutExSem(const Name:string;var Handle:longint;
3238 Attr,State:longint):longint;
3240 var T:array[0..255] of char;
3242 begin
3243 if Name<>'' then
3244 begin
3245 StrPCopy(@T,Name);
3246 DosCreateMutExSem:=DosCreateMutExSem(@T,Handle,Attr,State);
3248 else
3249 DosCreateMutExSem:=DosCreateMutExSem(nil,Handle,Attr,State);
3250 end;
3252 function DosOpenMutExSem(Name:PChar;var Handle:longint):longint; cdecl;
3254 external 'DOSCALLS' index 332;
3256 function DosOpenMutExSem(const Name:string;var Handle:longint):longint;
3258 var T:array[0..255] of char;
3260 begin
3261 StrPCopy(@T,Name);
3262 DosOpenMutExSem:=DosOpenMutExSem(@T,Handle);
3263 end;
3265 function DosCloseMutExSem(handle:longint):longint; cdecl;
3267 external 'DOSCALLS' index 333;
3269 function DosRequestMutExSem(Handle,Timeout:longint):longint; cdecl;
3271 external 'DOSCALLS' index 334;
3273 function DosReleaseMutExSem(Handle:longint):longint; cdecl;
3275 external 'DOSCALLS' index 335;
3277 function DosQueryMutExSem(Handle:longint;var PID,TID,Count:longint):longint;
3278 cdecl;
3280 external 'DOSCALLS' index 336;
3282 function DosCreateMuxWaitSem(Name:PChar;var Handle:longint;CSemRec:longint;
3283 var SemArray:TSemArray;Attr:longint):longint; cdecl;
3285 external 'DOSCALLS' index 337;
3287 function DosCreateMuxWaitSem(const Name:string;var Handle:longint;
3288 CSemRec:longint;var SemArray:TSemArray;
3289 Attr:longint):longint;
3291 var T:array[0..255] of char;
3293 begin
3294 if Name<>'' then
3295 begin
3296 StrPCopy(@T,Name);
3297 DosCreateMuxWaitSem:=DosCreateMuxWaitSem(@T,Handle,CSemRec,
3298 SemArray,Attr);
3300 else
3301 DosCreateMuxWaitSem:=DosCreateMuxWaitSem(nil,Handle,CSemRec,SemArray,
3302 Attr);
3303 end;
3305 function DosOpenMuxWaitSem(Name:PChar;var Handle:longint):longint; cdecl;
3307 external 'DOSCALLS' index 338;
3309 function DosOpenMuxWaitSem(const Name:string;var Handle:longint):longint;
3311 var T:array[0..255] of char;
3313 begin
3314 StrPCopy(@T,Name);
3315 DosOpenMuxWaitSem:=DosOpenMuxWaitSem(@T,Handle);
3316 end;
3318 function DosCloseMuxWaitSem(Handle:longint):longint; cdecl;
3320 external 'DOSCALLS' index 339;
3322 function DosWaitMuxWaitSem(Handle,Timeout:longint;var User:longint):longint;
3323 cdecl;
3325 external 'DOSCALLS' index 340;
3327 function DosAddMuxWaitSem(Handle:longint;var SemRec:TSemRecord):longint; cdecl;
3329 external 'DOSCALLS' index 341;
3331 function DosDeleteMuxWaitSem(Handle,Sem:longint):longint; cdecl;
3333 external 'DOSCALLS' index 342;
3335 function DosQueryMuxWaitSem(Handle:longint;var CSemRec:longint;
3336 var SemRecs:TSemArray;var Attr:longint):longint; cdecl;
3338 external 'DOSCALLS' index 343;
3340 function DosGetDateTime(var Buf:TDateTime):longint; cdecl;
3342 external 'DOSCALLS' index 230;
3344 function DosSetDateTime(var Buf:TDateTime):longint; cdecl;
3346 external 'DOSCALLS' index 292;
3348 function DosAsyncTimer(MSec,HSem:longint;
3349 var TimHandle:longint):longint; cdecl;
3351 external 'DOSCALLS' index 350;
3353 function DosStartTimer(MSec,HSem:longint;
3354 var TimHandle:longint):longint; cdecl;
3356 external 'DOSCALLS' index 351;
3358 function DosStopTimer(TimHandle:longint):longint; cdecl;
3360 external 'DOSCALLS' index 290;
3362 function DosTmrQueryFreq(var Freq:longint):longint; cdecl;
3364 external 'DOSCALLS' index 362;
3366 function DosTmrQueryTime(var Time:comp):longint; cdecl;
3368 external 'DOSCALLS' index 363;
3370 function DosLoadModule(ObjName:PChar;ObjLen:longint;DLLName:PChar;
3371 var Handle:longint):longint; cdecl;
3373 external 'DOSCALLS' index 318;
3375 function DosLoadModule(var ObjName:string;ObjLen:longint;
3376 const DLLName:string;var Handle:longint):longint;
3378 var T1,T2:array[0..255] of char;
3380 begin
3381 StrPCopy(@T2,DLLName);
3382 DosLoadModule:=DosLoadModule(@T1,ObjLen,@T2,Handle);
3383 ObjName:=StrPas(@T1);
3384 end;
3386 function DosFreeModule(Handle:longint):longint; cdecl;
3388 external 'DOSCALLS' index 322;
3390 function DosQueryProcAddr(Handle,Ordinal:longint;ProcName:PChar;
3391 var Address:pointer):longint; cdecl;
3393 external 'DOSCALLS' index 321;
3395 function DosQueryProcAddr(Handle,Ordinal:longint;
3396 const ProcName:string;var Address:pointer):longint;
3398 var T1:array[0..255] of char;
3400 begin
3401 if ProcName<>'' then
3402 begin
3403 StrPCopy(@T1,ProcName);
3404 DosQueryProcAddr:=DosQueryProcAddr(Handle,Ordinal,@T1,Address);
3406 else
3407 DosQueryProcAddr:=DosQueryProcAddr(Handle,Ordinal,nil,Address);
3408 end;
3410 function DosQueryModuleHandle(DLLName:PChar;var Handle:longint):longint; cdecl;
3412 external 'DOSCALLS' index 319;
3414 function DosQueryModuleHandle(const DLLName:string;var Handle:longint):longint;
3416 var T1:array[0..255] of char;
3418 begin
3419 StrPCopy(@T1,DLLName);
3420 DosQueryModuleHandle:=DosQueryModuleHandle(@T1,Handle);
3421 end;
3423 function DosQueryModuleName(Handle,NameLen:longint;Name:PChar):longint; cdecl;
3425 external 'DOSCALLS' index 320;
3427 {function DosQueryModuleName(Handle:longint;var Name:openstring):longint;
3429 var T1:array[0..255] of char;
3431 begin
3432 DosQueryModuleName:=DosQueryModuleName(Handle,High(Name),@T1);
3433 Name:=StrPas(@T1);
3434 end;}
3436 function DosQueryProcType(Handle,Ordinal:longint;Name:PChar;
3437 var ProcType:longint):longint; cdecl;
3439 external 'DOSCALLS' index 586;
3441 function DosQueryProcType(Handle,Ordinal:longint;const Name:string;
3442 var ProcType:longint):longint;
3444 var T1:array[0..255] of char;
3446 begin
3447 if Name<>'' then
3448 begin
3449 StrPCopy(@T1,Name);
3450 DosQueryProcType:=DosQueryProcType(Handle,Ordinal,@T1,ProcType);
3452 else
3453 DosQueryProcType:=DosQueryProcType(Handle,Ordinal,nil,ProcType);
3454 end;
3456 function DosGetResource(Handle,ResType,ResName:longint;var P:pointer):longint;
3457 cdecl;
3459 external 'DOSCALLS' index 352;
3461 function DosFreeResource(P:pointer):longint; cdecl;
3463 external 'DOSCALLS' index 353;
3465 function DosQueryResourceSize(Handle,IDT,IDN:longint;var Size:longint):longint;
3466 cdecl;
3468 external 'DOSCALLS' index 572;
3470 function DosQueryCtryInfo(Size:longint;var Country:TCountryCode;
3471 var Res:TCountryInfo;var ActualSize:longint):longint; cdecl;
3473 external 'NLS' index 5;
3475 function DosQueryDBCSEnv(Size:longint;var Country:TCountryCode;
3476 Buf:PChar):longint; cdecl;
3478 external 'NLS' index 6;
3480 function DosMapCase(Size:longint;var Country:TCountryCode;
3481 AString:PChar):longint; cdecl;
3483 external 'NLS' index 7;
3485 function DosMapCase(var Country:TCountryCode;var AString:string):longint;
3487 var T1:string;
3489 begin
3490 StrPCopy(@T1,AString);
3491 DosMapCase:=DosMapCase(length(AString),Country,@T1);
3492 AString:=StrPas(@T1);
3493 end;
3495 function DosQueryCollate(Size:longint;var Country:TCountryCode;
3496 buf:PByteArray;var TableLen:longint):longint; cdecl;
3498 external 'NLS' index 8;
3500 function DosQueryCP(Size:longint;CodePages:PWordArray;
3501 var ActSize:longint):longint; cdecl;
3503 external 'DOSCALLS' index 291;
3505 function DosSetProcessCP(CP:longint):longint; cdecl;
3507 external 'DOSCALLS' index 289;
3509 function DosSetExceptionHandler(var RegRec:TExceptionRegistrationRecord
3510 ):longint; cdecl;
3512 external 'DOSCALLS' index 354;
3514 function DosUnsetExceptionHandler(var RegRec:TExceptionRegistrationRecord
3515 ):longint; cdecl;
3517 external 'DOSCALLS' index 355;
3519 function DosRaiseException(var Excpt:TExceptionReportRecord):longint; cdecl;
3521 external 'DOSCALLS' index 356;
3523 function DosSendSignalException(PID,Exception:longint):longint; cdecl;
3525 external 'DOSCALLS' index 379;
3527 function DosUnwindException(var Handler:TExceptionRegistrationRecord;
3528 TargetIP:pointer;
3529 var RepRec:TExceptionReportRecord):longint; cdecl;
3531 external 'DOSCALLS' index 357;
3533 function DosSetSignalExceptionFocus(Enable:longint;var Times:longint):longint;
3534 cdecl;
3536 external 'DOSCALLS' index 378;
3538 function DosEnterMustComplete(var Nesting:longint):longint; cdecl;
3540 external 'DOSCALLS' index 380;
3542 function DosExitMustComplete(var Nesting:longint):longint; cdecl;
3544 external 'DOSCALLS' index 381;
3546 function DosAcknowledgeSignalException(SignalNum:longint):longint; cdecl;
3548 external 'DOSCALLS' index 418;
3550 function DosCloseQueue(Handle:longint):longint; cdecl;
3552 external 'QUECALLS' index 11;
3554 function DosCreateQueue(var Handle:longint;Priority:longint;
3555 Name:PChar):longint; cdecl;
3557 external 'QUECALLS' index 16;
3559 function DosCreateQueue(var Handle:longint;Priority:longint;
3560 const Name:string):longint;
3562 var T1:array[0..255] of char;
3564 begin
3565 StrPCopy(@T1,Name);
3566 DosCreateQueue:=DosCreateQueue(Handle,Priority,@T1);
3567 end;
3569 function DosOpenQueue(var Parent_PID:longint;var Handle:longint;
3570 Name:PChar):longint; cdecl;
3572 external 'QUECALLS' index 15;
3574 function DosOpenQueue(var Parent_PID:longint;var Handle:longint;
3575 const Name:string):longint;
3577 var T1:array[0..255] of char;
3579 begin
3580 StrPCopy(@T1,Name);
3581 DosOpenQueue:=DosOpenQueue(Parent_PID,Handle,@T1);
3582 end;
3584 function DosPeekQueue(Handle:longint;var ReqBuffer:TRequestData;
3585 var DataLen:longint;var DataPtr:pointer;
3586 var Element:longint;Wait:longint;
3587 var Priority:byte;ASem:longint):longint; cdecl;
3589 external 'QUECALLS' index 13;
3591 function DosPurgeQueue(Handle:longint):longint; cdecl;
3593 external 'QUECALLS' index 10;
3595 function DosQueryQueue(Handle:longint;var Count:longint):longint; cdecl;
3597 external 'QUECALLS' index 12;
3599 function DosReadQueue(Handle:longint;var ReqBuffer:TRequestData;
3600 var DataLen:longint;var DataPtr:pointer;
3601 Element,Wait:longint;var Priority:byte;
3602 ASem:longint):longint; cdecl;
3604 external 'QUECALLS' index 9;
3606 function DosWriteQueue(Handle,Request,DataLen:longint;var DataBuf;
3607 Priority:longint):longint; cdecl;
3609 external 'QUECALLS' index 14;
3611 function DosError(Error:longint):longint; cdecl;
3613 external 'DOSCALLS' index 212;
3615 procedure DosErrClass(Code:longint;var _Class,Action,Locus:longint); cdecl;
3617 external 'DOSCALLS' index 211;
3619 function DosTrueGetMessage(MsgSeg:pointer;Table:PInsertTable;
3620 TableSize:longint;Buf:PChar;BufSize,
3621 MsgNumber:longint;FileName:PChar;
3622 var MsgSize:longint):longint; {cdecl;}
3624 external 'MSG' index 6;
3626 function DosGetMessage(Table:PInsertTable;TableSize:longint;Buf:PChar;
3627 BufSize,MsgNumber:longint;FileName:PChar;
3628 var MsgSize:longint):longint;
3630 external name 'DosGetMessage'; {Procedure is in code2.so2.}
3632 (*function DosGetMessage(const Table:array of PString;var Buf:openstring;
3633 MsgNumber:longint;const FileName:string):longint;
3635 {Hmm. This takes too much stackspace. Let's use the
3636 heap instead.}
3638 type TTableBuffer=record
3639 IT:TinsertTable;
3640 Strings:TByteArray;
3641 end;
3642 PTableBuffer=^TTableBuffer;
3644 var Buffer:PTableBuffer;
3645 I,S:word;
3646 BufPtr:pointer;
3647 T1,T2:array[0..255] of char;
3649 begin
3650 {Check if there are more than nine items in the table.}
3651 if High(Table)>8 then
3652 DosGetMessage:=87
3653 else
3654 begin
3655 {Step 1: Calculate the space we need on the heap.}
3656 S:=SizeOf(TInsertTable);
3657 for I:=Low(Table) to High(Table) do
3658 S:=S+Length(Table[I])+1;
3660 {Step 2: Allocate the buffer.}
3661 GetMem(Buffer,S);
3663 {Step 3: Fill the buffer.}
3664 BufPtr:=@(S^.Strings);
3665 for I:=Low(Table) to High(Table) do
3666 begin
3667 S^.IT[I+1]:=bufptr;
3668 StrPCopy(BufPtr,Table[I]);
3669 Inc(longint(BufPtr),Length(Table[I])+1);
3670 end;
3672 {Step 4: Convert the filename.}
3673 StrPCopy(@T2,FileName);
3675 {Step 5: Get the message.}
3676 DosGetMessage:=DosGetMessage(@(S^.IT),High(Table)+1,@T1,
3677 High(Buf),MsgNumber,@T2,I);
3679 {Step 6: Convert the returned message.}
3680 Buf[0]:=Char(I);
3681 Move(T1,Buf[1],I);
3683 {Step 7: Free the memory.}
3684 FreeMem(Buffer,S);
3685 end;
3686 end;*)
3688 {function DosGetMessage(const Table:array of PString;Buf:PChar;
3689 BufSize,MsgNumber:longint;const FileName:string;
3690 MsgSize:longint):longint;}
3692 function DosInsertMessage(Table:PInsertTable;TableSize:longint;
3693 Message:PChar;SrcMessageSize:longint;
3694 Buf:PChar;BufSize:longint;
3695 var DstMessageSize:longint):longint; cdecl;
3697 external 'MSG' index 4;
3699 {function DosInsertMessage(Table:array of PString;
3700 const Message:string;
3701 var Buf:openstring):longint;
3703 function DosInsertMessage(Table:array of PString;
3704 Message:PChar;SrcMessageSize:longint;
3705 Buf:PChar;BufSize:longint;
3706 var DstMessageSize:longint):longint;}
3708 function DosPutMessage(Handle,Size:longint;Buf:PChar):longint; cdecl;
3710 external 'MSG' index 5;
3712 function DosPutMessage(Handle:longint;const Buf:string):longint;
3714 begin
3715 DosPutMessage:=DosPutMessage(Handle,Length(Buf),@Buf[1]);
3716 end;
3718 function DosIQueryMessageCP(var Buf;BufSize:longint;FileName:PChar;
3719 var InfoSize:longint;MesSeg:pointer):longint; {cdecl;}
3721 external 'MSG' index 8;
3723 function DosQueryMessageCP(var Buf;BufSize:longint;FileName:PChar;
3724 var InfoSize:longint):longint;
3726 external name 'DosQueryMessageCP';
3728 function DosQueryMessageCP(var Buf;BufSize:longint;const FileName:string;
3729 var InfoSize:longint):longint;
3731 var T:array[0..255] of char;
3733 begin
3734 StrPCopy(@T,FileName);
3735 DosQueryMessageCP:=DosQueryMessageCP(Buf,BufSize,@T,InfoSize);
3736 end;
3738 function DosStartSession(const AStartData:TStartData;
3739 var SesID,PID:longint):longint; cdecl;
3741 external 'SESMGR' index 37;
3743 function DosSetSession(SesID:longint;const AStatus:TStatusData):longint; cdecl;
3745 external 'SESMGR' index 39;
3747 function DosSelectSession(SesID:longint):longint; cdecl;
3749 external 'SESMGR' index 38;
3751 function DosStopSession(Scope,SesID:longint):longint; cdecl;
3753 external 'SESMGR' index 40;
3755 function DosCreatePipe(var ReadHandle,WriteHandle:longint;
3756 Size:longint):longint; cdecl;
3758 external 'DOSCALLS' index 239;
3760 function DosCreateNPipe(Name:PChar;var Handle:longint;OpenMode,PipeMode,
3761 OutBufSize,InBufSize,MSec:longint):longint; cdecl;
3763 external 'DOSCALLS' index 243;
3765 function DosCreateNPipe(const Name:string;var Handle:longint;OpenMode,
3766 PipeMode,OutBufSize,InBufSize,MSec:longint):longint;
3768 var T:array[0..255] of char;
3770 begin
3771 StrPCopy(@T,Name);
3772 DosCreateNPipe:=DosCreateNPipe(@T,Handle,OpenMode,PipeMode,OutBufSize,
3773 InBufSize,MSec);
3774 end;
3776 function DosCallNPipe(Name:PChar;var Input;InputSize:longint;
3777 var Output;OutputSize:longint;var ReadBytes:longint;
3778 MSec:longint):longint; cdecl;
3780 external 'DOSCALLS' index 240;
3782 function DosCallNPipe(const Name:string;var Input;InputSize:longint;
3783 var Output;OutputSize:longint;var ReadBytes:longint;
3784 MSec:longint):longint;
3786 var T:array[0..255] of char;
3788 begin
3789 StrPCopy(@T,Name);
3790 DosCallNPipe:=DosCallNPipe(@T,Input,InputSize,Output,OutputSize,
3791 ReadBytes,MSec);
3792 end;
3794 function DosConnectNPipe(Handle:longint):longint; cdecl;
3796 external 'DOSCALLS' index 241;
3798 function DosDisconnectNPipe(Handle:longint):longint; cdecl;
3800 external 'DOSCALLS' index 242;
3802 function DosPeekNPipe(Handle:longint;var Buffer;BufSize:longint;
3803 var ReadBytes:longint;var Avail:TAvailData;
3804 var State:longint):longint; cdecl;
3806 external 'DOSCALLS' index 244;
3808 function DosQueryNPHState(Handle:longint;var State:longint):longint; cdecl;
3810 external 'DOSCALLS' index 245;
3812 function DosQueryNPipeInfo(Handle,InfoLevel:longint;var Buffer;
3813 BufSize:longint):longint; cdecl;
3815 external 'DOSCALLS' index 248;
3817 function DosQueryNPipeSemState(SemHandle:longint;var SemArray;
3818 BufSize:longint):longint; cdecl;
3820 external 'DOSCALLS' index 249;
3822 function DosSetNPHState(Handle,State:longint):longint; cdecl;
3824 external 'DOSCALLS' index 250;
3826 function DosSetNPipeSem(PipeHandle,SemHandle,Key:longint):longint; cdecl;
3828 external 'DOSCALLS' index 251;
3830 function DosTransactNPipe(Handle:longint;var OutBuf;OutSize:longint;
3831 var InBuf;InSize:longint;
3832 var ReadBytes:longint):longint; cdecl;
3834 external 'DOSCALLS' index 252;
3836 function DosWaitNPipe(Name:PChar;MSec:longint):longint; cdecl;
3838 external 'DOSCALLS' index 253;
3840 function DosWaitNPipe(const Name:string;MSec:longint):longint;
3842 var T:array[0..255] of char;
3844 begin
3845 StrPCopy(@T,Name);
3846 DosWaitNPipe:=DosWaitNPipe(@T,MSec);
3847 end;
3849 function DosOpenVDD(Name:PChar;var Handle:longint):longint; cdecl;
3851 external 'DOSCALLS' index 308;
3853 function DosRequestVDD(Handle,SGroup,Cmd:longint;
3854 InSize:longint;var InBuffer;
3855 OutSize:longint;var OutBuffer):longint; cdecl;
3857 external 'DOSCALLS' index 309;
3859 function DosCloseVDD(Handle:longint):longint; cdecl;
3861 external 'DOSCALLS' index 310;
3863 procedure DosSelToFlat; cdecl;
3865 external 'DOSCALLS' index 426;
3867 procedure DosFlatToSel; cdecl;
3869 external 'DOSCALLS' index 425;
3871 {$ASMMODE INTEL}
3872 function SelToFlat (AFarPtr: TFarPtr): pointer; assembler;
3874 mov eax, AFarPtr
3875 call DosSelToFlat
3876 end;
3878 function FlatToSel (APtr: pointer): cardinal; assembler;
3880 mov eax, APtr
3881 call DosFlatToSel
3882 end;
3884 (* Todo:
3886 function DosRawReadNPipe ...; cdecl;
3888 external 'DOSCALLS' index 246;
3890 function DosRawWriteNPipe ...; cdecl;
3892 external 'DOSCALLS' index 247;
3894 function DosSetCP ...; cdecl;
3896 external 'DOSCALLS' index 288;
3898 function DosDynamicTrace ...; cdecl;
3900 external 'DOSCALLS' index 316;
3902 function DosRegisterPerfCtrs ...; cdecl;
3904 external 'DOSCALLS' index 367;
3906 function DosQueryDOSProperty ...; cdecl;
3908 external 'DOSCALLS' index 373;
3910 function DosSetDOSProperty ...; cdecl;
3912 external 'DOSCALLS' index 374;
3914 function DosProfile ...; cdecl;
3916 external 'DOSCALLS' index 377;
3918 function DosReplaceModule ...; cdecl;
3920 external 'DOSCALLS' index 417;
3922 function DosTIB ...; cdecl;
3924 external 'DOSCALLS' index 419;
3926 function DosOpenChangeNotify ...; cdecl;
3928 external 'DOSCALLS' index 440;
3930 function DosResetChangeNotify ...; cdecl;
3932 external 'DOSCALLS' index 441;
3934 function DosCloseChangeNotify ...; cdecl;
3936 external 'DOSCALLS' index 442;
3938 function DosInitializePorthole ...; cdecl;
3940 external 'DOSCALLS' index 580;
3942 function DosQueryHeaderInfo ...; cdecl;
3944 external 'DOSCALLS' index 582;
3949 end.
3951 $Log$
3952 Revision 1.1 2002/02/19 08:25:52 sasu
3953 Initial revision
3955 Revision 1.1.2.4 2000/12/21 21:14:59 hajny
3956 * TThreadEntry corrected (needed for FCL)
3958 Revision 1.1.2.3 2000/10/26 20:00:30 hajny
3959 * DosDevIOCtl prototype fixed, cdecl removed in DosSetFilePtr helper declaration
3961 Revision 1.1.2.2 2000/10/08 18:41:45 hajny
3962 * wrong index for DosSelToFlat, DosFlatToSel
3964 Revision 1.1.2.1 2000/09/28 19:52:23 hajny
3965 * SelToFlat correction (still not OK probably)
3967 Revision 1.1 2000/07/13 06:31:04 michael
3968 + Initial import
3970 Revision 1.13 2000/05/09 17:29:52 hajny
3971 * DosGetInfoBlocks updated again
3973 Revision 1.12 2000/04/01 10:46:07 hajny
3974 * DosGetInfoBloBlocks updated
3976 Revision 1.11 2000/01/09 20:51:03 hajny
3977 * FPK changed to FPC
3979 Revision 1.10 2000/01/07 16:41:46 daniel
3980 * copyright 2000
3982 Revision 1.9 2000/01/07 16:32:30 daniel
3983 * copyright 2000 added
3985 Revision 1.8 1999/12/26 19:30:18 hajny
3986 * cdecl modifications
3988 Revision 1.7 1999/12/18 18:32:38 hajny
3989 + Starting cdecl additions
3991 Revision 1.6 1999/08/10 14:18:40 hajny
3992 * corrected characters >127 broken by DBCS editor