1 /*static char *SCCSID = "@(#)doscall.h 6.25 86/06/03";*/
5 * (C) Copyright 1988 Microsoft Corporation
10 * Function declarations to provide strong type checking
11 * on arguments to DOS 4.0 function calls
13 * Major Modifications 04/28/86 by S. S.
14 * Major Modifications 04/30/86 by K. D.
15 * Minor Modifications 04/30/86 by S. S. (DosTimerAsync/Start)
16 * Major Modifications 05/01/86 by S. S. (fix Sems,add Queues)
17 * Minor Modifications 05/14/86 by K. D. (DosFileLocks)
18 * Minor Modifications 05/16/86 by S. S. (NLS routines)
19 * Minor Modifications 05/20/86 by S. S. (Get/SetPrty,CreateThread)
20 * Minor Modifications 05/20/86 by S. S. (add DosSetVector)
21 * Minor Modifications 06/02/86 by S. S. (GetHugeShift, MuxSemWait)
22 * Major Modifications 06/03/86 by S. S. (Mouse calls)
27 /*** CursorData - structure that contains the characteristics
32 unsigned cur_start; /* Cursor start line */
33 unsigned cur_end; /* Cursor end line */
34 unsigned cur_width; /* Cursor width */
35 unsigned cur_attribute; /* Cursor attribute */
40 /*** DateTime - structure for date and time */
43 unsigned char hour; /* current hour */
44 unsigned char minutes; /* current minute */
45 unsigned char seconds; /* current second */
46 unsigned char hundredths; /* current hundredths of a second */
47 unsigned char day; /* current day */
48 unsigned char month; /* current month */
49 unsigned year; /* current year */
50 unsigned timezone; /* minutes of time west of GMT */
51 unsigned char day_of_week; /* current day of week */
56 /*** FileFindBuf - structure of area where the filesystem driver
57 * returns the results of the search
61 unsigned create_date; /* date of file creation */
62 unsigned create_time; /* time of file creation */
63 unsigned access_date; /* date of last access */
64 unsigned access_time; /* time of last access */
65 unsigned write_date; /* date of last write */
66 unsigned write_time; /* time of last write */
67 unsigned long file_size; /* file size (end of data) */
68 unsigned long falloc_size; /* file allocated size */
69 unsigned attributes; /* attributes of the file */
70 char string_len; /* returned length of ascii name str. */
71 /* length does not include null byte */
72 char file_name[12]; /* name string */
76 /*** FileStatus - structure of information list used by DosQFileInfo */
79 unsigned create_date; /* date of file creation */
80 unsigned create_time; /* time of file creation */
81 unsigned access_date; /* date of last access */
82 unsigned access_time; /* time of last access */
83 unsigned write_date; /* date of last write */
84 unsigned write_time; /* time of last write */
85 unsigned long file_size; /* file size (end of data) */
86 unsigned long falloc_size; /* file allocated size */
87 unsigned block_size; /* blocking factor */
88 unsigned attributes; /* attributes of the file */
92 /*** FSAllocate - structure of file system allocation */
95 unsigned long filsys_id; /* file system ID */
96 unsigned long sec_per_unit; /* number sectors per allocation unit */
97 unsigned long num_units; /* number of allocation units */
98 unsigned long avail_units; /* avaliable allocation units */
99 unsigned bytes_sec; /* bytes per sector */
104 /*** KbdStatus - structure in which the keyboard support will information */
107 unsigned length; /* length in words of data structure */
108 unsigned bit_mask; /* bit mask */
109 unsigned turn_around_char; /* turnaround character */
110 unsigned interim_char_flags; /* interim character flags */
111 unsigned shift_state; /* shift state */
116 /*** KeyData - structure that contains character data */
119 char char_code; /* ASCII character code */
120 char scan_code; /* scan code */
121 char status; /* indicates state of the character */
122 unsigned shift_state; /* state of the shift keys */
123 unsigned long time; /* time stamp of the keystroke */
128 /*** ModeData - structure that contains characteristics of the mode */
131 unsigned length; /* Length of structure */
132 char type; /* Text or graphics */
133 char color; /* Color or monochrome */
134 unsigned col; /* Column resolution */
135 unsigned row; /* Row resolution */
136 unsigned hres; /* horizontal resolution */
137 unsigned vres; /* vertical resolution */
143 /*** ProcIDsArea - structure of the address of the area where the
144 * ID's will be placed
148 unsigned procid_cpid; /* current process' process ID */
149 unsigned procid_ctid; /* current process' thread ID */
150 unsigned procid_ppid; /* process ID of the parent */
155 /*** PVBData - structure that contains information about the
156 * physical video buffer
160 unsigned pvb_size; /* size of the structure */
161 unsigned long pvb_ptr; /* returns pointer to the pvb buffer */
162 unsigned pvb_length; /* length of PVB */
163 unsigned pvb_rows; /* buffer dimension (rows) */
164 unsigned pvb_cols; /* buffer dimension (cols) */
165 char pvb_type; /* color or mono */
170 /*** SchedParmsArea - structure of address in which the scheduler
171 * parms will be placed
174 struct SchedParmsArea {
175 char dynvar_flag; /* dynamic variation flag, 1=enabled */
176 char maxwait; /* maxwait (sec) */
177 unsigned mintime; /* minimum timeslice (ms) */
178 unsigned maxtime; /* maximum timeslice (ms) */
183 /*** Tasking Processes:
202 /*** DosCreateThread - Create another thread of execution
204 * Creates an asynchronous thread of execution under the
208 extern unsigned far pascal DOSCREATETHREAD (
209 void (far *)(void), /* Starting Address for new thread */
210 unsigned far *, /* Address to put new thread ID */
211 unsigned char far * ); /* Address of stack for new thread */
215 /*** DosCwait - Wait for child termination
217 * Places the current thread in a wait state until a child process
218 * has terminated, then returns the ending process' process ID and
222 extern unsigned far pascal DOSCWAIT (
223 unsigned, /* Action (execution) codes */
224 unsigned, /* Wait options */
225 unsigned far *, /* Address to put result code */
226 unsigned far *, /* Address to put process ID */
227 unsigned ); /* ProcessID of process to wait for */
231 /*** DosEnterCritSec - Enter critical section of execution
233 * Disables thread switching for the current process
236 extern void far pascal DOSENTERCRITSEC (void);
240 /*** DosExecPgm - Execute a program
242 * Allows a program to request another program be executed as a
243 * child process. The requestor's process may optionally continue
244 * to execute asynchronous to the new program
247 extern unsigned far pascal DOSEXECPGM (
248 unsigned, /* 0=synchronous, 1=asynchronous with */
249 /* return code discarded, 2=async */
250 /* with return code saved */
251 unsigned, /* Trace process */
252 char far *, /* Address of argument string */
253 char far *, /* Address of environment string */
254 unsigned far *, /* Address to put Process ID */
255 char far * ); /* Address of program filename */
259 /*** DosExit - Exit a program
261 * This call is issued when a thread completes its execution.
262 * The current thread is ended.
265 extern void far pascal DOSEXIT (
266 unsigned, /* 0=end current thread, 1=end all */
267 unsigned ); /* Result Code to save for DosCwait */
271 /*** DosExitCritSec - Exit critical section of execution
273 * Re-enables thread switching for the current process
276 extern void far pascal DOSEXITCRITSEC (void);
280 /*** DosExitList - Routine list for process termination
282 * Maintains a list of routines which are to be executed when the
283 * current process ends, normally or otherwise
286 extern unsigned far pascal DOSEXITLIST (
287 unsigned, /* Function request code */
288 void (far *)(void) ); /* Address of routine to be executed */
292 /*** DosGetPID - Return process ID
294 * Returns the current process's process ID (PID), thread ID,
295 * and the PID of the process that spawned it
298 extern void far pascal DOSGETPID (
299 struct ProcIDsArea far *); /* ProcID structure */
303 /*** DosGetPrty - Get Process's Priority
305 * Allows the caller to learn the priority of a process or thread
308 extern unsigned far pascal DOSGETPRTY (
309 unsigned, /* Indicate thread or process ID */
310 unsigned far *, /* Address to put priority */
311 unsigned ); /* PID of process/thread of interest */
315 /*** DosGetSchedParms - Get scheduler's parameters
317 * Gets the scheduler's current configuration parameters
320 extern void far pascal DOSGETSCHEDPARMS (
321 struct SchedParmsArea far * ); /* Address to put parameters */
325 /*** DosSetFgnd - Set Foreground Process
327 * Allows the session manager to designate which process
328 * is to receive favored dispatching
331 extern unsigned far pascal DOSSETFGND (
332 unsigned ); /* Process ID of target process */
336 /*** DosSetPrty - Set Process Priority
338 * Allows the caller to change the base priority or priority
339 * class of a child process or a thread in the current process
342 extern unsigned far pascal DOSSETPRTY (
343 unsigned, /* Indicate scope of change */
344 unsigned, /* Priority class to set */
345 unsigned, /* Priority delta to apply */
346 unsigned ); /* Process or Thread ID of target */
350 /*** DosKillProcess - Terminate a Process
352 * Terminates a child process and returns its termination code
353 * to its parent (if any)
356 extern unsigned far pascal DOSKILLPROCESS (
357 unsigned, /* 0=kill child processes also, */
358 /* 1=kill only indicated process */
359 unsigned ); /* Process ID of process to end */
364 /*** Asynchronous Notification (Signals):
373 /*** DosHoldSignal - Disable / Enable signals
375 * Used to termporarily disable or enable signal processing
376 * for the current process.
379 extern void far pascal DOSHOLDSIGNAL (
380 unsigned ); /* 0=enable signal, 1=disable signal */
384 /*** DosSendSignal - Issue signal
386 * Used to send a signal event to an arbitrary process or
390 extern unsigned far pascal DOSSENDSIGNAL (
391 unsigned, /* Process ID to signal */
392 unsigned, /* 0=notify entire subtree, 1=notify */
393 /* only the indicated process */
394 unsigned, /* Signal argument */
395 unsigned ); /* Signal number */
399 /*** DosSetSigHandler - Handle Signal
401 * Notifies CP/DOS of a handler for a signal. It may also be used
402 * to ignore a signal or install a default action for a signal.
405 extern unsigned far pascal DOSSETSIGHANDLER (
406 void (far *)(), /* Signal handler address */
407 unsigned long far *, /* Address of previous handler */
408 unsigned far *, /* Address of previous action */
409 unsigned, /* Indicate request type */
410 unsigned ); /* Signal number */
422 /*** DosMakePipe - Create a Pipe */
424 extern unsigned far pascal DOSMAKEPIPE (
425 unsigned far *, /* Addr to place the read handle */
426 unsigned far *, /* Addr to place the write handle */
427 unsigned ); /* Size to reserve for the pipe */
444 /*** DosCloseQueue - Close a Queue
446 * close a queue which is in use by the requesting process
450 extern unsigned far pascal DOSCLOSEQUEUE (
451 unsigned ) ; /* queue handle */
454 /*** DosCreateQueue - Create a Queue
456 * creates a queue to be owned by the requesting process
460 extern unsigned far pascal DOSCREATEQUEUE (
461 unsigned far *, /* queue handle */
462 unsigned, /* queue priority */
463 char far * ) ; /* queue name */
466 /*** DosOpenQueue - Open a Queue
468 * opens a queue for the current process
472 extern unsigned far pascal DOSOPENQUEUE (
473 unsigned far *, /* PID of queue owner */
474 unsigned far *, /* queue handle */
475 char far * ) ; /* queue name */
479 /*** DosPeekQueue - Peek at a Queue
481 * retrieves an element from a queue without removing it from the queue
485 extern unsigned far pascal DOSPEEKQUEUE (
486 unsigned, /* queue handle */
487 unsigned long far *, /* pointer to request */
488 unsigned far *, /* length of datum returned */
489 unsigned long far *, /* pointer to address of datum */
490 unsigned far *, /* indicator of datum returned */
491 unsigned char, /* wait indicator for empty queue */
492 unsigned char far *, /* priority of element */
493 unsigned long ) ; /* semaphore handle */
497 /*** DosPurgeQueue - Purge a Queue
499 * purges all elements from a queue
503 extern unsigned far pascal DOSPURGEQUEUE (
504 unsigned ) ; /* queue handle */
508 /*** DosQueryQueue - Query size of a Queue
510 * returns the number of elements in a queue
514 extern unsigned far pascal DOSQUERYQUEUE (
515 unsigned, /* queue handle */
516 unsigned far * ); /* pointer for number of elements */
520 /*** DosReadQueue - Read from a Queue
522 * retrieves an element from a queue
526 extern unsigned far pascal DOSREADQUEUE (
527 unsigned, /* queue handle */
528 unsigned long far *, /* pointer to request */
529 unsigned far *, /* length of datum returned */
530 unsigned long far *, /* pointer to address of datum */
531 unsigned, /* indicator of datum returned */
532 unsigned char, /* wait indicator for empty queue */
533 unsigned char far *, /* priority of element */
534 unsigned long ) ; /* semaphore handle */
538 /*** DosWriteQueue - Write to a Queue
540 * adds an element to a queue
544 extern unsigned far pascal DOSWRITEQUEUE (
545 unsigned, /* queue handle */
546 unsigned, /* request */
547 unsigned, /* length of datum */
548 unsigned char far *, /* address of datum */
549 unsigned char ); /* priority of element */
570 /*** DosSemClear - Unconditionally clears a semaphore
572 * Unconditionally clears a semaphore; i.e., sets the
573 * state of the specified semaphore to unowned.
576 extern unsigned far pascal DOSSEMCLEAR (
577 unsigned long ); /* semaphore handle */
581 /*** DosSemRequest - Wait until next DosSemClear
583 * Blocks the current thread until the next DosSemClear is
584 * issued to the indicated semaphore
587 extern unsigned far pascal DOSSEMREQUEST (
588 unsigned long, /* semaphore handle */
589 unsigned long ); /* Timeout, -1=no timeout, */
590 /* 0=immediate timeout, >1=number ms */
593 /*** DosSemSet - Unconditionally take a semaphore
595 * Unconditionally takes a semaphore; i.e., sets the status
596 * of the specified semaphore to owned.
599 extern unsigned far pascal DOSSEMSET (
600 unsigned long ); /* semaphore handle */
604 /*** DosSemSetWait - Wait for a semaphore to be cleared and set it
606 * Blocks the current thread until the indicated semaphore is
607 * cleared and then establishes ownership of the semaphore
610 extern unsigned far pascal DOSSEMSETWAIT (
611 unsigned long, /* semaphore handle */
612 unsigned long ); /* Timeout, -1=no timeout, */
613 /* 0=immediate timeout, >1=number ms */
616 /*** DosSemWait - Wait for a semaphore to be cleared
618 * Blocks the current thread until the indicated semaphore is
619 * cleared but does not establish ownership of the semaphore
622 extern unsigned far pascal DOSSEMWAIT (
623 unsigned long, /* semaphore handle */
624 unsigned long ); /* Timeout, -1=no timeout, */
625 /* 0=immediate timeout, >1=number ms */
628 /*** DosMuxSemWait - Wait for 1 of N semaphores to be cleared
630 * Blocks the current thread until the indicated semaphore is
631 * cleared but does not establish ownership of the semaphore
634 extern unsigned far pascal DOSMUXSEMWAIT (
635 unsigned far *, /* address for event index number */
636 unsigned far *, /* list of semaphores */
637 unsigned long ); /* Timeout, -1=no timeout, */
638 /* 0=immediate timeout, >1=number ms */
642 /*** DosCloseSem - Close a system semaphore
644 * closed the specified system semaphore
647 extern unsigned far pascal DOSCLOSESEM (
648 unsigned long ); /* semaphore handle */
652 /*** DosCreateSem - Create a system semaphore
654 * create a system semaphore
657 extern unsigned far pascal DOSCREATESEM (
658 unsigned, /* =0 indicates exclusive ownership */
659 unsigned long far *, /* address for semaphore handle */
660 char far * ); /* name of semaphore */
663 /*** DosOpenSem - Open a system semaphore
665 * open a system semaphore
668 extern unsigned far pascal DOSOPENSEM (
669 unsigned long far *, /* address for semaphore handle */
670 char far * ); /* name of semaphore */
688 /*** DosGetDateTime - Get the current date and time
690 * Used to get the current date and time that are maintained by
691 * the operating system
694 extern unsigned far pascal DOSGETDATETIME (
695 struct DateTime far * );
699 /*** DosSetDateTime - Set the current date and time
701 * Used to set the date and time that are maintained by the
705 extern unsigned far pascal DOSSETDATETIME (
706 struct DateTime far * );
710 /*** DosSleep - Delay Process Execution
712 * Suspends the current thread for a specified interval of time,
713 * or if the requested interval is '0', simply gives up the
714 * remainder of the current time slice.
717 extern unsigned far pascal DOSSLEEP (
718 unsigned long ); /* TimeInterval - interval size */
722 /*** DosGetTimerInt - Get the timer tick interval in 1/10000 sec.
724 * Gets a word that contains the timer tick interval in ten
725 * thousandths of a second. This is the amount of time that
726 * elapses with every timer tick
729 extern unsigned far pascal DOSGETTIMERINT (
730 unsigned far * ); /* interval size */
734 /*** DosTimerAsync - Start an asynchronous time delay
736 * Starts a timer that runs asynchronously to the thread issuing
737 * the request. It sets a RAM semaphore which can be used by the
741 extern unsigned far pascal DOSTIMERASYNC (
742 unsigned long, /* Interval size */
743 unsigned long, /* handle of semaphore */
744 unsigned far * ); /* handle of timer */
748 /*** DosTimerStart - Start a Periodic Interval Timer
750 * Starts a periodic interval timer that runs asynchronously to
751 * the thread issuing the request. It sets a RAM semaphore which
752 * can be used by the wait facility. The semaphore is continually
753 * signalled at the specified time interval until the timer is
754 * turned off by DosTimerStop
757 extern unsigned far pascal DOSTIMERSTART (
758 unsigned long, /* Interval size */
759 unsigned long, /* handle of semaphore */
760 unsigned far * ); /* handle of timer */
764 /*** DosTimerStop - Stop an interval timer
766 * Stops an interval timer that was started by DosTimerStart
769 extern unsigned far pascal DOSTIMERSTOP (
770 unsigned ); /* Handle of the timer */
775 /*** Memory Management:
790 /*** DosAllocSeg - Allocate Segment
792 * Allocates a segment of memory to the requesting process.
795 extern unsigned far pascal DOSALLOCSEG (
796 unsigned, /* Number of bytes requested */
797 unsigned far *, /* Selector allocated (returned) */
798 unsigned ); /* Indicator for sharing */
802 /*** DosAllocShrSeg - Allocate Shared Segment
804 * Allocates a shared memory segment to a process.
807 extern unsigned far pascal DOSALLOCSHRSEG (
808 unsigned, /* Number of bytes requested */
809 char far *, /* Name string */
810 unsigned far * ); /* Selector allocated (returned) */
814 /*** DosGetShrSeg - Access Shared Segment
816 * Allows a process to access a shared memory segment previously
817 * allocated by another process. The reference count for the
818 * shared segment is incremented.
821 extern unsigned far pascal DOSGETSHRSEG (
822 char far *, /* Name string */
823 unsigned far * ); /* Selector (returned) */
827 /*** DosGiveSeg - Give access to Segment
829 * Gives another process access to a shares memory segment
832 extern unsigned far pascal DOSGIVESEG (
833 unsigned, /* Caller's segment handle */
834 unsigned, /* Process ID of recipient */
835 unsigned far * ); /* Recipient's segment handle */
839 /*** DosReallocSeg - Change Segment Size
841 * Changes the size of a segment already allocated.
844 extern unsigned far pascal DOSREALLOCSEG (
845 unsigned, /* New size requested in bytes */
846 unsigned ); /* Selector */
850 /*** DosFreeSeg - Free a Segment
852 * Deallocates a segment
855 extern unsigned far pascal DOSFREESEG (
856 unsigned ); /* Selector */
860 /*** DosAllocHuge - Allocate Huge Memory
862 * Allocates memory greater than the maximum segment size
865 extern unsigned far pascal DOSALLOCHUGE (
866 unsigned, /* Number of 65536 byte segments */
867 unsigned, /* Number of bytes in last segment */
868 unsigned far *, /* Selector allocated (returned) */
869 unsigned ); /* Max number of 65536-byte segments */
873 /*** DosGetHugeShift - Get shift count used with Huge Segments
875 * Returns the shift count used in deriving selectors
876 * to address memory allocated by DosAllocHuge.
879 extern unsigned far pascal DOSGETHUGESHIFT (
880 unsigned far *); /* Shift Count (returned) */
884 /*** DosReallocHuge - Change Huge Memory Size
886 * Changes the size of memory originally allocated by DosAllocHuge
889 extern unsigned far pascal DOSREALLOCHUGE (
890 unsigned, /* Number of 65536 byte segments */
891 unsigned, /* Number of bytes in last segment */
892 unsigned ); /* Selector */
896 /*** DosCreateCSAlias - Create CS Alias
898 * Creates an alias descriptor for a data type descriptor passed
899 * as input. The type of the new descriptor is executable.
902 extern unsigned far pascal DOSCREATECSALIAS (
903 unsigned, /* Data segment selector */
904 unsigned far * ); /* Code segment selector (returned) */
909 /*** Memory Sub-Allocation Package (MSP)
918 /*** DosSubAlloc - Allocate Memory
920 * Allocates memory from a segment previously allocated by
921 * DosAllocSeg or DosAllocShrSeg and initialized by DosSubSet
924 extern unsigned far pascal DOSSUBALLOC (
925 unsigned, /* Segment selector */
926 unsigned far *, /* Address of block offset */
927 unsigned ); /* Size of requested block */
931 /*** DosSubFree - Free Memory
933 * Frees memory previously allocated by DosSubAlloc
936 extern unsigned far pascal DOSSUBFREE (
937 unsigned, /* Segment selector */
938 unsigned, /* Offset of memory block to free */
939 unsigned ); /* Size of block in bytes */
943 /*** DosSubSet - Initialize or Set Allocated Memory
945 * Can be used either to initialize a segment for sub-allocation
946 * of to notify MSP of a change in the size of a segment already
950 extern unsigned far pascal DOSSUBSET (
951 unsigned, /* Segment selector */
952 unsigned, /* Parameter flags */
953 unsigned ); /* New size of the block */
958 /*** Program Execution Control:
969 /*** DosLoadModule - Load Dynamic Link Routines
971 * Loads a dynamic link module and returns a handle for the module
974 extern unsigned far pascal DOSLOADMODULE (
975 char far *, /* Module name string */
976 unsigned far * ); /* Module handle (returned) */
980 /*** DosFreeModule - Free Dynamic Link Routines
982 * Frees the reference to the dynamic link module for this process.
983 * If the dynamic link module is no longer used by any process, the
984 * module will be freed from system memory.
987 extern unsigned far pascal DOSFREEMODULE (
988 unsigned ); /* Module handle */
992 /*** DosGetProcAddr - Get Dynamic Link Procedure Address
994 * Retruns a far address to the desired procedure within a dynamic
998 extern unsigned far pascal DOSGETPROCADDR (
999 unsigned, /* Module handle */
1000 char far *, /* Module name string */
1001 unsigned long far * ); /* Procedure address (returned) */
1005 /*** DosGetModHandle - Get Dynamic Link Module Handle
1007 * Returns the handle to a dynamic link module that was previously
1008 * loaded. The interface provides a mechanism for testing whether
1009 * a dynamic link module is already loaded.
1012 extern unsigned far pascal DOSGETMODHANDLE (
1013 char far *, /* Module name string */
1014 unsigned far *); /* Module handle (returned) */
1018 /*** DosGetModName - Get Dynamic Link Module Name
1020 * returns the fully qualified drive, path, filename, and
1021 * extension associated with the referenced modul handle
1024 extern unsigned far pascal DOSGETMODNAME (
1025 unsigned, /* Module handle */
1026 unsigned, /* Maximum buffer length */
1027 unsigned far * ); /* Buffer (returned) */
1032 /*** Device I/O Services:
1083 * VioSaveRedrawWaitUndo
1095 /*** DosBeep - Generate Sound From Speaker */
1097 extern unsigned far pascal DOSBEEP (
1098 unsigned, /* Hertz (25H-7FFFH) */
1099 unsigned ); /* Length of sound in ms */
1103 /*** DosDevConfig - Get Device Configurations
1105 * Get information about attached devices
1108 extern unsigned far pascal DOSDEVCONFIG (
1109 unsigned char far *, /* Returned information */
1110 unsigned, /* Item number */
1111 unsigned ); /* Reserved */
1115 /*** DosDevIOCtl - Preform Control Functions Directly On Device
1117 * Control functions on the device specified by the opened
1121 extern unsigned far pascal DOSDEVIOCTL (
1122 char far *, /* Data area */
1123 char far *, /* Command-specific argument list */
1124 unsigned, /* Device-specific function code */
1125 unsigned, /* Device category */
1126 unsigned ); /* Device handle returned by Open */
1130 /*** DosScrDirectIO - Direct Screen I/O
1132 * Indicate direct screen I/O
1135 extern unsigned far pascal DOSSCRDIRECTIO (
1136 unsigned ); /* Indicates state of direct I/O */
1141 /*** DosScrRedrawWait - Screen Refresh
1143 * Wait for notification to refresh or redraw screen
1146 extern unsigned far pascal DOSSCRREDRAWWAIT (void);
1150 /*** DosScrLock - Lock Screen
1152 * Lock the screen for I/O
1155 extern unsigned far pascal DOSSCRLOCK (
1156 unsigned, /* Block or not - 0=return if */
1157 /* screen unavailable, 1=wait */
1158 unsigned far *); /* Return status of lock - */
1159 /* 0=sucessful, 1=unsuccessful */
1163 /*** DosScrUnLock - Unlock Screen
1165 * Unlock the screen for I/O
1168 extern unsigned far pascal DOSSCRUNLOCK (void) ;
1172 /*** DosSGInit - Initialize Screen Group
1174 * Initialize the specified screen group
1177 extern unsigned far pascal DOSSGINIT (
1178 unsigned ); /* Number of screen group */
1182 /*** DosSGNum - Get Number of Screen Groups
1184 * Get the number of screen groups
1187 extern unsigned far pascal DOSSGNUM (
1188 unsigned far *); /* Total number of screen groups */
1192 /*** DosSGRestore - Restore Screen Group
1194 * Restore the current screen group
1197 extern unsigned far pascal DOSSGRESTORE (void);
1201 /*** DosSGSave - Save Screen Group
1203 * Save the current screen group
1206 extern unsigned far pascal DOSSGSAVE (void);
1210 /*** DosSGSwitch - Switch Screen Groups
1212 * Switch the specified screen group to the active screen group
1215 extern unsigned far pascal DOSSGSWITCH (
1216 unsigned ); /* Number of screen group */
1220 /*** DosSGSwitchMe - Put Process in Screen Group
1222 * Switch the caller into the specified screen group
1225 extern unsigned far pascal DOSSGSWITCHME (
1226 unsigned ); /* Number of screen groups */
1230 /*** DosVioAttach - Attach to Video Subsystem
1232 * Attach to the current video subsystem for the current screen
1233 * group. This must be done prior to using any VIO functions.
1236 extern unsigned far pascal DOSVIOATTACH (void);
1240 /*** DosVioRegister - Register Video Subsystem
1242 * Register a video subsystem for a screen group
1245 extern unsigned far pascal DOSVIOREGISTER (
1246 char far *, /* Module name */
1247 char far * ); /* Table of entries supported by */
1248 /* the VIO dynamic link module */
1252 /*** KbdCharIn - Read Character, Scan Code
1254 * Return a character and scan code from the standard input device
1257 extern unsigned far pascal KBDCHARIN (
1258 struct KeyData far *, /* Buffer for character code */
1259 unsigned, /* I/O wait - 0=wait for a */
1260 /* character, 1=no wait */
1261 unsigned ); /* keyboard handle */
1265 /*** KbdFlushBuffer - Flush Keystroke Buffer
1267 * Clear the keystroke buffer
1270 extern unsigned far pascal KBDFLUSHBUFFER (
1271 unsigned ); /* keyboard handle */
1275 /*** KbdGetStatus - Get Keyboard Status
1277 * Gets the current state of the keyboard.
1280 extern unsigned far pascal KBDGETSTATUS (
1281 struct KbdStatus far *, /* data structure */
1282 unsigned ); /* Keyboard device handle */
1286 /*** KbdPeek - Peek at Character, Scan Code
1288 * Return the character/scan code, if available, from the
1289 * standard input device without removing it from the buffer.
1292 extern unsigned far pascal KBDPEEK (
1293 struct KeyData far *, /* buffer for data */
1294 unsigned ); /* keyboard handle */
1298 /*** KbdSetStatus - Set Keyboard Status
1300 * Sets the characteristics of the keyboard.
1303 extern unsigned far pascal KBDSETSTATUS (
1304 struct KbdStatus far *, /* data structure */
1305 unsigned ); /* device handle */
1309 /*** KbdStringIn - Read Character String
1311 * Read a character string (character codes only) from the
1312 * standard input device. The character string may optionally
1313 * be echoed at the standard output device if the echo mode
1314 * is set (KbdSetEchoMode)
1317 extern unsigned far pascal KBDSTRINGIN (
1318 char far *, /* Char string buffer */
1319 unsigned far *, /* Length of buffer */
1320 unsigned, /* I/O wait- 0=wait for a */
1321 /* character, 1=no wait */
1322 unsigned ); /* keyboard handle */
1326 /*** VioRegister - Register Video Subsystem
1328 * Register a video subsystem within a screen group
1332 extern unsigned far pascal VIOREGISTER (
1333 char far *, /* Module name */
1334 char far *, /* Entry Point name */
1335 unsigned long, /* Function mask 1 */
1336 unsigned long ); /* Function mask 2 */
1340 /*** VioFreePhysBuf - Free Physical Video Buffer
1342 * Release the physical video buffer
1345 extern unsigned far pascal VIOFREEPHYSBUF (
1346 char far * ); /* Physical video buffer */
1350 /*** VioGetBuf - Get Logical Video Buffer
1352 * Return the address of the logical video buffer
1355 extern unsigned far pascal VIOGETBUF (
1356 unsigned long far *, /* Will point to logical video buffer */
1357 unsigned far *, /* Length of Buffer */
1358 unsigned ); /* Vio Handle */
1362 /*** VioGetCurPos - Get Cursor Position
1364 * Return the cursor position
1367 extern unsigned far pascal VIOGETCURPOS (
1368 unsigned far *, /* Current row position */
1369 unsigned far *, /* Current column position */
1370 unsigned ); /* Vio Handle */
1374 /*** VioGetCurType - Get Cursor Type
1376 * Return the cursor type
1379 extern unsigned far pascal VIOGETCURTYPE (
1380 struct CursorData far *, /* Cursor characteristics */
1381 unsigned ); /* Vio Handle */
1385 /*** VioGetMode - Get Display Mode
1387 * Return the mode of the display
1390 extern unsigned far pascal VIOGETMODE (
1391 struct ModeData far *, /* Length of Buffer */
1392 unsigned ); /* Vio Handle */
1396 /*** VioGetPhysBuf - Get Physical Video Buffer
1398 * Return the address of the physical video buffer
1401 extern unsigned far pascal VIOGETPHYSBUF (
1402 char far *, /* Buffer start address */
1403 char far *, /* Buffer end address */
1404 unsigned far *, /* Address of selector list */
1405 unsigned ); /* Length of selector list */
1409 /*** VioReadCellStr - Read Character/Attributes String
1411 * Read a string of character/attributes (or cells) from the
1412 * screen starting at the specified location.
1415 extern unsigned far pascal VIOREADCELLSTR (
1416 char far *, /* Character Buffer */
1417 unsigned far *, /* Length of cell string buffer */
1418 unsigned, /* Starting location (row) */
1419 unsigned, /* Starting location (col) */
1420 unsigned ); /* Vio Handle */
1424 /*** VioReadCharStr - Read Character String
1426 * Read a character string from the display starting at the
1427 * current cursor position
1430 extern unsigned far pascal VIOREADCHARSTR (
1431 char far *, /* Character Buffer */
1432 unsigned far *, /* Length of cell string buffer */
1433 unsigned, /* Starting location (row) */
1434 unsigned, /* Starting location (col) */
1435 unsigned ); /* Vio Handle */
1439 /*** VioScrollDn - Scroll Screen Down
1441 * Scroll the current screen down
1444 extern unsigned far pascal VIOSCROLLDN (
1445 unsigned, /* Top row of section to scroll */
1446 unsigned, /* Left column of section to scroll */
1447 unsigned, /* Bottom row of section to scroll */
1448 unsigned, /* Right column of section to scroll */
1449 unsigned, /* Number of blank lines at bottom */
1450 char far *, /* pointer to blank Char,Attr */
1451 unsigned ); /* Vio Handle */
1455 /*** VioScrollUp - Scroll Screen Up
1457 * Scroll the active page (or display) up
1460 extern unsigned far pascal VIOSCROLLUP (
1461 unsigned, /* Top row of section to scroll */
1462 unsigned, /* Left column of section to scroll */
1463 unsigned, /* Bottom row of section to scroll */
1464 unsigned, /* Right column of section to scroll */
1465 unsigned, /* Number of blank lines at bottom */
1466 char far *, /* pointer to blank Char,Attr */
1467 unsigned ); /* Vio Handle */
1471 /*** VioScrollLf - Scroll Screen Left
1473 * Scroll the current screen left
1476 extern unsigned far pascal VIOSCROLLLF (
1477 unsigned, /* Top row of section to scroll */
1478 unsigned, /* Left column of section to scroll */
1479 unsigned, /* Bottom row of section to scroll */
1480 unsigned, /* Right column of section to scroll */
1481 unsigned, /* Number of blank columsn at right */
1482 char far *, /* pointer to blank Char,Attr */
1483 unsigned ); /* Vio Handle */
1487 /*** VioScrollLf - Scroll Screen Right
1489 * Scroll the current screen right
1492 extern unsigned far pascal VIOSCROLLRT (
1493 unsigned, /* Top row of section to scroll */
1494 unsigned, /* Left column of section to scroll */
1495 unsigned, /* Bottom row of section to scroll */
1496 unsigned, /* Right column of section to scroll */
1497 unsigned, /* Number of blank columsn at left */
1498 char far *, /* pointer to blank Char,Attr */
1499 unsigned ); /* Vio Handle */
1503 /*** VioSetCurPos - Set Cursor Position
1505 * Set the cursor position
1508 extern unsigned far pascal VIOSETCURPOS (
1509 unsigned, /* Row return data */
1510 unsigned, /* Column return data */
1511 unsigned ); /* Vio Handle */
1515 /*** VioSetCurType - Set Cursor Type
1517 * Set the cursor type
1520 extern unsigned far pascal VIOSETCURTYPE (
1521 struct CursorData far *, /* Cursor characteristics */
1522 unsigned ); /* Vio Handle */
1526 /*** VioSetMode - Set Display Mode
1528 * Set the mode of the display
1531 extern unsigned far pascal VIOSETMODE (
1532 struct ModeData far *, /* Mode characteristics */
1533 unsigned ); /* Vio Handle */
1537 /*** VioShowBuf - Display Logical Buffer
1539 * Update the display with the logical video buffer
1542 extern unsigned far pascal VIOSHOWBUF (
1543 unsigned, /* Offset into buffer */
1544 unsigned, /* Length of area to be updated */
1545 unsigned ); /* Vio Handle */
1549 /*** VioWrtCellStr - Write Character/Attribute String
1551 * Write a character,attribute string to the display
1554 extern unsigned far pascal VIOWRTCELLSTR (
1555 char far *, /* String to be written */
1556 unsigned, /* Length of string */
1557 unsigned, /* Starting position for output (row) */
1558 unsigned, /* Starting position for output (col) */
1559 unsigned ); /* Vio Handle */
1563 /*** VioWrtCharStr - Write Character String
1565 * Write a character string to the display
1568 extern unsigned far pascal VIOWRTCHARSTR (
1569 char far *, /* String to be written */
1570 unsigned, /* Length of string */
1571 unsigned, /* Starting position for output (row) */
1572 unsigned, /* Starting position for output (col) */
1573 unsigned ); /* Vio Handle */
1577 /*** VioWrtCharStrAtt - Write Character String With Attribute
1579 * Write a character string with repeated attribute to the display
1582 extern unsigned far pascal VIOWRTCHARSTRATT (
1583 char far *, /* String to be written */
1584 unsigned, /* Length of string */
1585 unsigned, /* Starting position for output (row) */
1586 unsigned, /* Starting position for output (col) */
1587 char far *, /* Attribute to be replicated */
1588 unsigned ); /* Vio Handle */
1592 /*** VioWrtNAttr - Write N Attributes
1594 * Write an attribute to the display a specified number of times
1597 extern unsigned far pascal VIOWRTNATTR (
1598 char far *, /* Attribute to be written */
1599 unsigned, /* Length of write */
1600 unsigned, /* Starting position for output (row) */
1601 unsigned, /* Starting position for output (col) */
1602 unsigned ); /* Vio Handle */
1606 /*** VioWrtNCell - Write N Character/Attributes
1608 * Write a cell (or character/attribute) to the display a
1609 * specified number of times
1612 extern unsigned far pascal VIOWRTNCELL (
1613 char far *, /* Cell to be written */
1614 unsigned, /* Length of write */
1615 unsigned, /* Starting position for output (row) */
1616 unsigned, /* Starting position for output (col) */
1617 unsigned ); /* Vio Handle */
1621 /*** VioWrtNChar - Write N Characters
1623 * Write a character to the display a specified number of times
1626 extern unsigned far pascal VIOWRTNCHAR (
1627 unsigned, /* Character to be written */
1628 unsigned, /* Length of write */
1629 unsigned, /* Starting position for output (row) */
1630 unsigned, /* Starting position for output (col) */
1631 unsigned ); /* Vio Handle */
1635 /*** VioWrtTTY - Write TTY String
1637 * Write a character string from the current cursor position in
1638 * TTY mode to the display. The cursor will be positioned at the
1639 * end of the string+1 at the end of the write.
1642 extern unsigned far pascal VIOWRTTTY (
1643 char far *, /* String to be written */
1644 unsigned, /* Length of string */
1645 unsigned ); /* Vio Handle */
1649 /*** VioSetAnsi - Set ANSI On or Off
1651 * Activates or deactivates ANSI support
1655 extern unsigned far pascal VIOSETANSI (
1656 unsigned, /* ON (=1) or OFF (=0) indicator */
1657 unsigned ); /* Vio Handle */
1661 /*** VioGetAnsi - Get ANSI State
1663 * Returns the current ANSI state (0=inactive, 1=active)
1667 extern unsigned far pascal VIOGETANSI (
1668 unsigned far *, /* ANSI state (returned) */
1669 unsigned ); /* Vio Handle */
1673 /*** VioPrtScreen - Print Screen
1675 * Copies the screen to the printer
1679 extern unsigned far pascal VIOPRTSCREEN (
1680 unsigned ); /* Vio Handle */
1684 /*** VioSaveRedrWait - Screen Save Redraw Wait
1686 * Allows a process to be notified when it must
1687 * save or redraw its screen
1691 extern unsigned far pascal VIOSAVEREDRAWWAIT (
1692 unsigned, /* Save/Redraw Indicator */
1693 unsigned far *, /* Notify type (returned) */
1694 unsigned ); /* Vio Handle */
1698 /*** VioSaveRedrWaitUndo - Undo Screen Save Redraw Wait
1700 * Allows a one thread within a process to cancel a
1701 * VIOSAVREDRAWWAIT issued by another thread within
1702 * that same process. Ownership of the VIOSAVREDRAWWAIT
1703 * can either be reserved or given up.
1707 extern unsigned far pascal VIOSAVEREDRAWWAITUNDO (
1708 unsigned, /* Ownership Indicator */
1709 unsigned, /* Terminate Indicator */
1710 unsigned ); /* Vio Handle */
1714 /*** VioScrLock - Lock Screen
1716 * Tells a process if I/O to the physical screen buffer can occur.
1720 extern unsigned far pascal VIOSCRLOCK (
1721 unsigned, /* Wait Flag */
1722 unsigned char far *, /* Status of lock (returned) */
1723 unsigned ); /* Vio Handle */
1727 /*** VioScrUnlock - Unlock Screen
1729 * Unlocks the physical screen buffer for I/O.
1733 extern unsigned far pascal VIOSCRUNLOCK (
1734 unsigned ); /* Vio Handle */
1738 /*** VioSetMnLockTime - Set Minimum Screen Lock Time
1740 * Sets the minimum amount of time that the system will allow a
1741 * process to have exclusive use of the screen via VIOSCRLOCK.
1745 extern unsigned far pascal VIOSETMNLOCKTIME (
1746 unsigned, /* Number of seconds */
1747 unsigned ); /* Vio Handle */
1751 /*** VioSetMxSaveTime - Set Maximum Screen Save/Restore Time
1753 * Sets the maximum amount of time (in msec) that the system will
1754 * allow a process to take before issuing a VIOSAVREDRWAIT call
1755 * after being notified by the Session Mgr that one is needed.
1759 extern unsigned far pascal VIOSETMXSAVETIME (
1760 unsigned, /* Number of milliseconds */
1761 unsigned ); /* Vio Handle */
1765 /*** VioGetTimes - Return VIO Lock and Save/Redraw Times
1767 * Returns the 2 word values set by the calls
1768 * VIOSETMNLOCKTIME and VIOSETMXSAVETIME.
1772 extern unsigned far pascal VIOGETTIMES (
1773 unsigned far *, /* Min. Lock time (in seconds) */
1774 unsigned far *, /* Max. Save time (in msec) */
1775 unsigned ); /* Vio Handle */
1779 /*** VioPopUp - Allocate a PopUp Display Screen
1781 * Creates a temporary window to display a momentary message
1785 extern unsigned far pascal VIOPOPUP (
1786 unsigned far *, /* Wait/Nowait Bit flags */
1787 unsigned ); /* Vio Handle */
1791 /*** VioEndPopUp - Deallocate a PopUp Display Screen
1793 * Closes a PopUp window
1797 extern unsigned far pascal VIOENDPOPUP (
1798 unsigned ); /* Vio Handle */
1824 /*** MouRegister - Register a Mouse Subsystem or Environment Manager
1828 extern unsigned far pascal MOUREGISTER (
1829 char far *, /* Module name */
1830 char far *, /* Entry Point name */
1831 unsigned long, /* Function mask */
1832 unsigned ); /* Mouse Device Handle */
1836 /*** MouGetNumButtons - returns the number of mouse buttons supported
1840 extern unsigned far pascal MOUGETNUMBUTTONS (
1841 unsigned far *, /* Number of mouse buttons (returned) */
1842 unsigned ); /* Mouse Device Handle */
1846 /*** MouGetNumMickeys - returns the number of mickeys per centimeter
1850 extern unsigned far pascal MOUGETNUMMICKEYS (
1851 unsigned far *, /* Number of Mickeys/cm (returned) */
1852 unsigned ); /* Mouse Device Handle */
1856 /*** MouGetDevStatus - returns the mouse driver status flags
1860 extern unsigned far pascal MOUGETDEVSTATUS (
1861 unsigned far *, /* Device Status (returned) */
1862 unsigned ); /* Mouse Device Handle */
1866 /*** MouReadEventQueue - reads an event from the mouse event queue
1870 extern unsigned far pascal MOUREADEVENTQUEUE (
1871 unsigned, /* Type of read operation */
1872 unsigned char far *, /* Event Queue Entry (returned) */
1873 unsigned ); /* Mouse Device Handle */
1877 /*** MouGetNumQueEl - returns the status of the Mouse Event Queue
1881 extern unsigned far pascal MOUGETNUMQUEEL (
1882 unsigned far *, /* Maximum # of Elements in Queue */
1883 unsigned far *, /* Current # of Elements in Queue */
1884 unsigned ); /* Mouse Device Handle */
1888 /*** MouGetEventMask - Returns the current mouse 1-word event mask
1892 extern unsigned far pascal MOUGETEVENTMASK (
1893 unsigned far *, /* Event Mask (returned) */
1894 unsigned ); /* Mouse Device Handle */
1898 /*** MouGetScaleFact - Returns the current mouse scaling factors
1902 extern unsigned far pascal MOUGETSCALEFACT (
1903 unsigned far *, /* Y Coordinate Scaling Factor */
1904 unsigned far *, /* X Coordinate Scaling Factor */
1905 unsigned ); /* Mouse Device Handle */
1909 /*** MouSetScaleFact - Sets the current mouse scaling factors
1913 extern unsigned far pascal MOUSETSCALEFACT (
1914 unsigned, /* Y Coordinate Scaling Factor */
1915 unsigned, /* X Coordinate Scaling Factor */
1916 unsigned ); /* Mouse Device Handle */
1920 /*** MouSetEventMask - Set the current mouse 1-word event mask
1924 extern unsigned far pascal MOUSETEVENTMASK (
1925 unsigned, /* Event Mask */
1926 unsigned ); /* Mouse Device Handle */
1930 /*** MouOpen - Open the mouse device
1934 extern unsigned far pascal MOUOPEN (
1935 unsigned far * ); /* Mouse Device Handle (returned) */
1939 /*** MouClose - Close the mouse device
1943 extern unsigned far pascal MOUCLOSE (
1944 unsigned ); /* Mouse Device Handle */
1948 /*** MouSetPtrShape - Set the shape and size of the mouse pointer image
1952 extern unsigned far pascal MOUSETPTRSHAPE (
1953 unsigned char far *, /* Pointer Shape (returned) */
1954 unsigned long, /* Size of data passed */
1955 unsigned, /* Height of Ptr Shape */
1956 unsigned, /* Width of Ptr Shape */
1957 unsigned, /* Offset to Ptr Column Center */
1958 unsigned, /* Offset to Ptr Row Center */
1959 unsigned ); /* Mouse Device Handle */
1963 /*** MouRemovePtr - Restricts the Mouse Ptr from occurring in a region
1967 extern unsigned far pascal MOUREMOVEPTR (
1968 unsigned far *, /* Pointer Area */
1969 unsigned ); /* Mouse Device Handle */
1973 /*** MouDrawPtr - Unrestricts the Mouse Ptr
1977 extern unsigned far pascal MOUDRAWPTR (
1978 unsigned ); /* Mouse Device Handle */
1981 /*** MouSetHotKey - Determines which Mouse Key is the system hot key
1985 extern unsigned far pascal MOUSETHOTKEY (
1986 unsigned, /* Mouse Button Mask */
1987 unsigned ); /* Mouse Device Handle */
1992 /*** Device Monitor Services
2003 /*** DosMonOpen - Open a Connection to a CP/DOS Device Monitor
2005 * This call is issued once by a process which wishes to use
2009 extern unsigned far pascal DOSMONOPEN (
2010 char far *, /* Ascii string of device name */
2011 unsigned far * ); /* Address for handle return value */
2015 /*** DosMonClose - Close a Connection to a CP/DOS Device Monitor
2017 * This call is issued once by a process which wishes to terminate
2018 * monitoring. This call causes all monitor buffers associated to
2019 * be flushed and closed.
2022 extern unsigned far pascal DOSMONCLOSE (
2023 unsigned ); /* Handle from DosMonOpen */
2027 /*** DosMonReg - Register a Set of Buffers as a Monitor
2029 * This call is issued to establish a pair of buffer structures -
2030 * one input and one output - to monitor an I/O stream
2033 extern unsigned far pascal DOSMONREG (
2034 unsigned, /* Handle from DosMonOpen */
2035 unsigned char far *, /* Address of monitor input buffer */
2036 unsigned char far *, /* Address of monitor output buffer */
2037 unsigned, /* Position flag - 0=no positional */
2038 /* preference, 1=front of list, */
2039 /* 2=back of the list */
2040 unsigned ); /* Index */
2044 /*** DosMonRead - Read Input From Monitor Structure
2046 * This call is issued to wait for and read input records from
2047 * the monitor buffer structure
2050 extern unsigned far pascal DOSMONREAD (
2051 unsigned char far *, /* Address of monitor input buffer */
2052 unsigned char, /* Block/Run indicator - 0=block */
2053 /* input ready, 1=return */
2054 unsigned char far *, /* Address of data buffer */
2055 unsigned far * ); /* Number of bytes in the data record */
2059 /*** DosMonWrite - Write Output to Monitor Structure
2061 * Writes data to the monitor output buffer structure
2064 extern unsigned far pascal DOSMONWRITE (
2065 unsigned char far *, /* Address of monitor output buffer */
2066 unsigned char far *, /* Address of data buffer */
2067 unsigned ); /* Number of bytes in data record */
2072 /*** File I/O Services:
2115 /*** DosBufReset - Commit File's Cache Buffers
2117 * Flushes requesting process's cache buffers for the specified
2121 extern unsigned far pascal DOSBUFRESET (
2122 unsigned ); /* File handle */
2126 /*** DosChdir - Change The Current Directory
2128 * Define the current directory for the requesting process
2131 extern unsigned far pascal DOSCHDIR (
2132 char far *, /* Directory path name */
2133 unsigned long ); /* Reserved (must be 0) */
2137 /*** DosChgFilePtr - Change (Move) File Read Write Pointer
2139 * Move the read/write pointer according to the method specified
2142 extern unsigned far pascal DOSCHGFILEPTR (
2143 unsigned, /* File handle */
2144 long, /* Distance to move in bytes */
2145 unsigned, /* Method of moving (0,1,2) */
2146 unsigned long far * ); /* New pointer location */
2150 /*** DosClose - Close a File Handle
2152 * Closes the specified file handle
2155 extern unsigned far pascal DOSCLOSE (
2156 unsigned ); /* File handle */
2160 /*** DosCreateUn - Create a Unique File Path Name
2162 * Generates a unique file path name
2165 extern unsigned far pascal DOSCREATEUN (
2166 char far * ); /* File path name area */
2170 /*** DosDelete - Delete a File
2172 * Removes a directory entry associated with a filename
2175 extern unsigned far pascal DOSDELETE (
2176 char far *, /* Filename path */
2177 unsigned long ); /* Reserved (must be 0) */
2181 /*** DosDupHandle - Duplicate a File Handle
2183 * Returns a new file handle for an open file that refers to the
2184 * same file at the same position
2187 extern unsigned far pascal DOSDUPHANDLE (
2188 unsigned, /* Existing file handle */
2189 unsigned far * ); /* New file handle */
2193 /*** DosFindClose - Close Find Handle
2195 * Closes the association between a directory handle and a
2196 * DosFindFirst or DosFindNext directory search function
2199 extern unsigned far pascal DOSFINDCLOSE (
2200 unsigned ); /* Directory search handle */
2204 /*** DosFindFirst - Find First Matching File
2206 * Finds the first filename that matches the specified file
2210 extern unsigned far pascal DOSFINDFIRST (
2211 char far *, /* File path name */
2212 unsigned far *, /* Directory search handle */
2213 unsigned, /* Search attribute */
2214 struct FileFindBuf far *, /* Result buffer */
2215 unsigned, /* Result buffer length */
2216 unsigned far *, /* Number of entries to find */
2217 unsigned long ); /* Reserved (must be 0) */
2221 /*** DosFindNext - Find Next Matching File
2223 * Finds the next directory entry matching the name that was
2224 * specified on the previous DosFindFirst or DosFindNext function
2228 extern unsigned far pascal DOSFINDNEXT (
2229 unsigned, /* Directory handle */
2230 struct FileFindBuf far *, /* Result buffer */
2231 unsigned, /* Result buffer length */
2232 unsigned far * ); /* Number of entries to find */
2236 /*** DosFileLocks - File Lock Manager
2238 * Unlock and/or lock multiple ranges in an opened file
2241 extern unsigned far pascal DOSFILELOCKS (
2242 unsigned, /* File handle */
2243 long far *, /* Unlock Range */
2244 long far * ); /* Lock Range */
2248 /*** DosGetInfoSeg - Get addresses of system variable segments
2250 * Returns 2 selectors: one for the global information segment,
2251 * the other for a process information segment
2254 extern unsigned far pascal DOSGETINFOSEG (
2255 unsigned far *, /* Selector for Global Info Seg */
2256 unsigned far * ); /* Selector for Process Info Seg */
2260 /*** DosMkdir - Make Subdirectory
2262 * Creates the specified directory
2265 extern unsigned far pascal DOSMKDIR (
2266 char far *, /* New directory name */
2267 unsigned long ); /* Reserved (must be 0) */
2271 /*** DosMove - Move a file or SubDirectory
2273 * Moves the specified file or directory
2276 extern unsigned far pascal DOSMOVE (
2277 char far *, /* Old path name */
2278 char far *, /* New path name */
2279 unsigned long ); /* Reserved (must be 0) */
2283 /*** DosNewSize - Change File's Size
2285 * Changes a file's size
2288 extern unsigned far pascal DOSNEWSIZE (
2289 unsigned, /* File handle */
2290 unsigned long ); /* File's new size */
2294 /*** DosOpen - Open a File
2296 * Creates the specified file (if necessary) and opens it
2299 extern unsigned far pascal DOSOPEN (
2300 char far *, /* File path name */
2301 unsigned far *, /* New file's handle */
2302 unsigned far *, /* Action taken - 1=file existed, */
2303 /* 2=file was created */
2304 unsigned long, /* File primary allocation */
2305 unsigned, /* File attributes */
2306 unsigned, /* Open function type */
2307 unsigned, /* Open mode of the file */
2308 unsigned long ); /* Reserved (must be zero) */
2312 /*** DosQCurDir - Query Current Directory
2314 * Get the full path name of the current directory for the
2315 * requesting process for the specified drive
2318 extern unsigned far pascal DOSQCURDIR (
2319 unsigned, /* Drive number - 1=A, etc */
2320 char far *, /* Directory path buffer */
2321 unsigned far * ); /* Directory path buffer length */
2325 /*** DosQCurDisk - Query Current Disk
2327 * Determine the current default drive for the requesting process
2330 extern unsigned far pascal DOSQCURDISK (
2331 unsigned far *, /* Default drive number */
2332 unsigned long far * ); /* Drive-map area */
2337 /*** DosQFHandState - Query file handle state
2339 * Query the state of the specified handle
2342 extern unsigned far pascal DOSQFHANDSTATE (
2343 unsigned, /* File Handle */
2344 unsigned far * ); /* File handle state */
2348 /*** DosQFileInfo - Query a File's Information
2350 * Returns information for a specific file
2353 extern unsigned far pascal DOSQFILEINFO (
2354 unsigned, /* File handle */
2355 unsigned, /* File data required */
2356 char far *, /* File data buffer */
2357 unsigned ); /* File data buffer size */
2360 /*** DosQFileMode - Query File Mode
2362 * Get the mode (attribute) of the specified file
2365 extern unsigned far pascal DOSQFILEMODE (
2366 char far *, /* File path name */
2367 unsigned far *, /* Data area */
2368 unsigned long ); /* Reserved (must be zero) */
2372 /*** DosQFSInfo - Query File System Information
2374 * Gets information from a file system device
2377 extern unsigned far pascal DOSQFSINFO (
2378 unsigned, /* Drive number - 0=default, 1=A, etc */
2379 unsigned, /* File system info required */
2380 char far *, /* File system info buffer */
2381 unsigned ); /* File system info buffer size */
2385 /*** DosQHandType - Query Handle type
2387 * Returns a flag as to whether a handle references a device or
2388 * a file, and if a device, returns device driver attribute word
2391 extern unsigned far pascal DOSQHANDTYPE (
2392 unsigned, /* File Handle */
2393 unsigned far *, /* Handle Type (0=file, 1=device) */
2394 unsigned far * ); /* Device Driver Attribute Word */
2398 /*** DosQSwitChar - Query Switch Character
2400 * Returns the system switch character
2403 extern unsigned far pascal DOSQSWITCHAR (
2404 unsigned char far * ); /* Switch Character (returned) */
2408 /*** DosQVerify - Query Verify Setting
2410 * Returns the value of the Verify flag
2413 extern unsigned far pascal DOSQVERIFY (
2414 unsigned far * ); /* Verify setting - 0=verify mode */
2415 /* not active, 1=verify mode active */
2419 /*** DosRead - Read from a File
2421 * Reads the specified number of bytes from a file to a
2425 extern unsigned far pascal DOSREAD (
2426 unsigned, /* File handle */
2427 char far *, /* Address of user buffer */
2428 unsigned, /* Buffer length */
2429 unsigned far * ); /* Bytes read */
2433 /*** DosReadAsync - Async Read from a File
2435 * Reads the specified number of bytes from a file to a buffer
2436 * location asynchronously with respect to the requesting process's
2440 extern unsigned far pascal DOSREADASYNC (
2441 unsigned, /* File handle */
2442 unsigned long far *, /* Address of Ram semaphore */
2443 unsigned far *, /* Address of I/O error return code */
2444 char far *, /* Address of user buffer */
2445 unsigned, /* Buffer length */
2446 unsigned far * ); /* Number of bytes actually read */
2450 /*** DosRmDir - Remove Subdirectory
2452 * Removes a subdirectory from the specified disk
2455 extern unsigned far pascal DOSRMDIR (
2456 char far *, /* Directory name */
2457 unsigned long ); /* Reserved (must be zero) */
2461 /*** DosSelectDisk - Select Default Drive
2463 * Select the drive specified as the default drive for the
2467 extern unsigned far pascal DOSSELECTDISK (
2468 unsigned ); /* Default drive number */
2472 /*** DosSetFHandState - Set File Handle State
2474 * Get the state of the specified file
2477 extern unsigned far pascal DOSSETFHANDSTATE (
2478 unsigned, /* File handle */
2479 unsigned); /* File handle state */
2482 /*** DosSetFSInfo - Set File System Information
2484 * Set information for a file system device
2487 extern unsigned far pascal DOSSETFSINFO (
2488 unsigned, /* Drive number - 0=default, 1=A, etc */
2489 unsigned, /* File system info required */
2490 char far *, /* File system info buffer */
2491 unsigned ); /* File system info buffer size */
2495 /*** DosSetFileInfo - Set a File's Information
2497 * Specifies information for a file
2500 extern unsigned far pascal DOSSETFILEINFO (
2501 unsigned, /* File handle */
2502 unsigned, /* File info data required */
2503 char far *, /* File info buffer */
2504 unsigned ); /* File info buffer size */
2508 /*** DosSetFileMode - Set File Mode
2510 * Change the mode (attribute) of the specified file
2513 extern unsigned far pascal DOSSETFILEMODE (
2514 char far *, /* File path name */
2515 unsigned, /* New attribute of file */
2516 unsigned long ); /* Reserved (must be zero) */
2520 /*** DosSetMaxFH - Set Maximum File Handles
2522 * Defines the maximum number of file handles for the
2526 extern unsigned far pascal DOSSETMAXFH (
2527 unsigned ); /* Number of file handles */
2531 /*** DosSetVerify - Set/Reset Verify Switch
2533 * Sets the verify switch
2536 extern unsigned far pascal DOSSETVERIFY (
2537 unsigned ); /* New value of verify switch */
2541 /*** DosWrite - Synchronous Write to a File
2543 * Transfers the specified number of bytes from a buffer to
2544 * the specified file, synchronously with respect to the
2545 * requesting process's execution
2548 extern unsigned far pascal DOSWRITE (
2549 unsigned, /* File handle */
2550 char far *, /* Address of user buffer */
2551 unsigned, /* Buffer length */
2552 unsigned far * ); /* Bytes written */
2556 /*** DosWriteAsync - Asynchronous Write to a File
2558 * Transfers the specified number of bytes from a buffer to
2559 * the specified file, asynchronously with respect to the
2560 * requesting process's execution
2563 extern unsigned far pascal DOSWRITEASYNC (
2564 unsigned, /* File handle */
2565 unsigned long far *, /* Address of RAM semaphore */
2566 unsigned far *, /* Address of I/O error return code */
2567 char far *, /* Address of user buffer */
2568 unsigned, /* Buffer length */
2569 unsigned far * ); /* Bytes written */
2574 /*** Hard Error Handling
2581 /*** DosError - Enable Hard Error Processing
2583 * Allows a CP/DOS process to receive hard error notification
2584 * without generating a hard error signal. Hard errors generated
2585 * under a process which has issued a DosError call are FAILed and
2586 * the appropriate error code is returned.
2589 extern unsigned far pascal DOSERROR (
2590 unsigned ); /* Action flag */
2594 /*** Machine Exception Handling
2601 /*** DosSetVec - Establish a handler for an Exception
2603 * Allows a process to register an address to be
2604 * called when a 286 processor exception occurs.
2607 extern unsigned far pascal DOSSETVEC (
2608 unsigned, /* Exception Vector */
2609 void (far *)(void), /* Address of exception handler */
2610 void (far * far *)(void) ); /* Address to store previous handler */
2614 /*** Message Functions
2623 /*** DosGetMessage - Return System Message With Variable Text
2625 * Retrieves a message from the specified system message file
2626 * and inserts variable information into the body of the message
2629 extern unsigned far pascal DOSGETMESSAGE (
2630 char far * far *, /* Table of variables to insert */
2631 unsigned, /* Number of variables */
2632 char far *, /* Address of message buffer */
2633 unsigned, /* Length of buffer */
2634 unsigned, /* Number of the message */
2635 char far *, /* Message file name */
2636 unsigned far * ); /* Length of returned message */
2640 /*** DosInsMessage - Insert Variable Text into Message
2642 * Inserts variable text string information into the body ofa message.
2645 extern unsigned far pascal DOSINSMESSAGE (
2646 char far * far *, /* Table of variables to insert */
2647 unsigned, /* Number of variables */
2648 char far *, /* Address of output buffer */
2649 unsigned, /* Length of output buffer */
2650 unsigned, /* Length of message */
2651 char far *, /* Address of input string */
2652 unsigned far * ); /* Length of returned message */
2656 /*** DosPutMessage - Output Message Text to Indicated Handle
2658 * Outputs a message in a buffer passed by a caller to the
2659 * specified handle. The function formats the buffer to
2660 * prevent words from wrapping if displayed to a screen.
2663 extern unsigned far pascal DOSPUTMESSAGE (
2664 unsigned, /* Handle of output file/device */
2665 unsigned, /* Length of message buffer */
2666 char far * ); /* Message buffer */
2677 /*** DosSysTrace - Add a Trace record to the System Trace Buffer
2679 * Allows a subsystem or system extension to add information to the
2680 * System trace buffer. This call can only be made from protected
2684 extern unsigned far pascal DOSSYSTRACE (
2685 unsigned, /* Major trace event code (0-255) */
2686 unsigned, /* Length of area to be recorded */
2687 unsigned, /* Minor trace event code (0-FFFFH) */
2688 char far * ); /* Pointer to area to be traced */
2692 /*** Program Startup Conventions
2700 /*** DosGetEnv - Get the Address of Process' Environment String
2702 * Return the address of the current process' environment string
2705 extern unsigned far pascal DOSGETENV (
2706 unsigned far *, /* Address to place segment handle */
2707 unsigned far * ); /* Address for command line start */
2711 /*** DosGetVersion - Get DOS Version
2713 * Returns the DOS version number
2716 extern unsigned far pascal DOSGETVERSION (
2717 unsigned far * ); /* Address to put version number */
2721 /*** World Trade Support
2723 * All of these functions declarations have the string NLS in a comment.
2724 * This is required in the generation of the Imports Library DOSCALLS.LIB
2738 * Returns the country dependant formatting information that
2739 * resides in the NLSCDIT.SYS World Trade Support file
2742 extern unsigned far pascal DOSGETCTRYINFO ( /*<NLS>*/
2743 unsigned, /* Length of data area provided */
2744 unsigned long far *, /* Country code */
2745 char far *, /* Memory buffer */
2746 unsigned far * ); /* Length of returned data */
2752 * Sets the current country code for the system
2755 extern unsigned far pascal DOSSETCTRYCODE ( /*<NLS>*/
2756 unsigned long far * ); /* Country code */
2760 /*** DosGetDBCSEv - Get the DBCS Environment Vector
2762 * Used to obtain the DBCS environmental vector that resides in
2763 * the NLSDBCS.SYS World Trade Support file.
2766 extern unsigned far pascal DOSGETDBCSEV ( /*<NLS>*/
2767 unsigned, /* Length of data area provided */
2768 unsigned long far *, /* Country code */
2769 char far * ); /* Pointer to data area */
2775 * Used to perform case mapping on a string of binary values which
2776 * represent ASCII characters.
2779 extern unsigned far pascal DOSCASEMAP ( /*<NLS>*/
2780 unsigned, /* Length of string to case map */
2781 unsigned long far *, /* Country code */
2782 char far * ); /* Address of string of binary values */
2788 * Gets a list of special characters that are valid in file names, etc.
2789 * The list corresponds to the byte values 128-255.
2792 extern unsigned far pascal DOSGETSPECCHAR ( /*<NLS>*/
2793 unsigned, /* Length of data area provided */
2794 unsigned long far *, /* Country Code */
2795 unsigned char far * ); /* Data area */
2801 * Undocumented NLS feature
2804 extern unsigned far pascal DOSCOLLATE ( /*<NLS>*/
2805 unsigned, /* Buffer Length */
2806 unsigned long far *, /* Country Code */
2807 char far * ); /* Buffer Address */