|
|
1.1 root 1: /*static char *SCCSID = "@(#)bsedos.h 13.61 90/05/05";*/
2: /***************************************************************************\
3: *
4: * Module Name: BSEDOS.H
5: *
6: * OS/2 Base Include File
7: *
8: * Copyright (c) 1987 Microsoft Corporation
9: * Copyright (c) 1987 IBM Corporation
10: *
11: *****************************************************************************
12: *
13: * Subcomponents marked with "+" are partially included by default
14: *
15: * #define: To include:
16: *
17: * + INCL_DOSPROCESS Process and thread support
18: * + INCL_DOSFILEMGR File Management
19: * + INCL_DOSMEMMGR Memory Management
20: * + INCL_DOSSEMAPHORES Semaphore support
21: * + INCL_DOSDATETIME Date/Time and Timer support
22: * INCL_DOSMODULEMGR Module manager
23: * + INCL_DOSRESOURCES Resource support
24: * INCL_DOSNLS National Language Support
25: * INCL_DOSSIGNALS Signals
26: * INCL_DOSMISC Miscellaneous
27: * INCL_DOSMONITORS Monitors
28: * INCL_DOSQUEUES Queues
29: * INCL_DOSSESMGR Session Manager Support
30: * INCL_DOSDEVICES Device specific, ring 2 support
31: * INCL_DOSNMPIPES Named Pipes Support
32: * INCL_DOSPROFILE DosProfile API
33: * INCL_DOSMVDM MVDM support
34: *
35: \***************************************************************************/
36:
37: #define INCL_DOSINCLUDED
38:
39: #ifndef INCL_BASEINCLUDED
40: #if !(defined(INCL_32) || defined(INCL_16))
41: #ifdef M_I386
42: #define INCL_32
43: #else /* not M_I386 */
44: #define INCL_16
45: #endif /* M_I386 */
46: #endif /* INCL_32 || INCL_16 */
47:
48: /* XLATOFF */
49: #if defined(INCL_16)
50: #pragma message ("32-bit Base API included when using 16-bit compiler")
51: #endif /* INCL_32 */
52: /* XLATON */
53: #endif /* INCL_BASEINCLUDED */
54:
55: #ifdef INCL_32 /* This #ifdef brackets the rest of this entire */
56: /* file. It is used to include either the */
57: /* 32-bit or 16-bit base definitions. No */
58: /* definitions (other than 16/32-bit */
59: /* determination) must be placed above this. */
60:
61: #ifdef INCL_DOS
62:
63: #define INCL_DOSPROCESS
64: #define INCL_DOSFILEMGR
65: #define INCL_DOSMEMMGR
66: #define INCL_DOSSEMAPHORES
67: #define INCL_DOSDATETIME
68: #define INCL_DOSMODULEMGR
69: #define INCL_DOSRESOURCES
70: #define INCL_DOSNLS
71: #define INCL_DOSSIGNALS
72: #define INCL_DOSMISC
73: #define INCL_DOSMONITORS
74: #define INCL_DOSQUEUES
75: #define INCL_DOSSESMGR
76: #define INCL_DOSDEVICES
77: #define INCL_DOSNMPIPES
78: #define INCL_DOSPROFILE
79: #define INCL_DOSMVDM
80:
81: #endif /* INCL_DOS */
82:
83: #ifdef INCL_ERRORS
84: #define INCL_DOSERRORS
85: #endif /* INCL_ERRORS */
86:
87: #if (defined(INCL_DOSPROCESS) || !defined(INCL_NOCOMMON))
88:
89: /*** General services */
90:
91: APIRET APIENTRY DosBeep(ULONG freq, ULONG dur);
92:
93: /*** Process and Thread support */
94:
95: VOID APIENTRY DosExit(ULONG action, ULONG result);
96:
97: /* DosExit codes */
98:
99: #define EXIT_THREAD 0
100: #define EXIT_PROCESS 1
101:
102: #endif /* common INCL_DOSPROCESS stuff */
103:
104: #ifdef INCL_DOSPROCESS
105:
106: /* XLATOFF */
107: #define DosCwait DosWaitChild
108: #define DosSetPrty DosSetPriority
109: /* XLATON */
110:
111: #include <bsetib.h>
112:
113: typedef VOID (*PFNTHREAD)(VOID);
114:
115: APIRET APIENTRY DosCreateThread(PTID ptid, PFNTHREAD pfn, ULONG param, ULONG flag, ULONG cbStack);
116:
117: APIRET APIENTRY DosResumeThread(TID tid);
118:
119: APIRET APIENTRY DosSuspendThread(TID tid);
120:
121: APIRET APIENTRY DosGetThreadInfo(PTIB *pptib,PPIB *pppib);
122:
123: /* Action code values */
124:
125: #define DCWA_PROCESS 0
126: #define DCWA_PROCESSTREE 1
127:
128: /* Wait option values */
129:
130: #define DCWW_WAIT 0
131: #define DCWW_NOWAIT 1
132:
133: typedef struct _RESULTCODES { /* resc */
134: ULONG codeTerminate;
135: ULONG codeResult;
136: } RESULTCODES;
137: typedef RESULTCODES *PRESULTCODES;
138:
139: APIRET APIENTRY DosWaitChild(ULONG action, ULONG option, PRESULTCODES pres, PPID ppid, PID pid);
140:
141: APIRET APIENTRY DosWaitThread(PPID ppid, ULONG option);
142:
143: APIRET APIENTRY DosSleep(ULONG msec);
144:
145: APIRET APIENTRY DosDebug(PVOID pdbgbuf);
146:
147:
148: /* codeTerminate values (also passed to ExitList routines) */
149:
150: #define TC_EXIT 0
151: #define TC_HARDERROR 1
152: #define TC_TRAP 2
153: #define TC_KILLPROCESS 3
154:
155: typedef VOID (*PFNEXITLIST)(ULONG);
156:
157: APIRET APIENTRY DosEnterCritSec(VOID);
158:
159: APIRET APIENTRY DosExitCritSec(VOID);
160:
161: APIRET APIENTRY DosExitList(ULONG ordercode, PFNEXITLIST pfn);
162:
163: /* DosExitList functions */
164:
165: #define EXLST_ADD 1
166: #define EXLST_REMOVE 2
167: #define EXLST_EXIT 3
168:
169: APIRET APIENTRY DosExecPgm(PCHAR pObjname, LONG cbObjname, ULONG execFlag, PSZ pArg, PSZ pEnv, PRESULTCODES pRes, PSZ pName);
170:
171: /* DosExecPgm functions */
172:
173: #define EXEC_SYNC 0
174: #define EXEC_ASYNC 1
175: #define EXEC_ASYNCRESULT 2
176: #define EXEC_TRACE 3
177: #define EXEC_BACKGROUND 4
178: #define EXEC_LOAD 5
179:
180:
181: APIRET APIENTRY DosSetPriority(ULONG scope, ULONG class, LONG delta, ULONG PorTid);
182:
183: /* Priority scopes */
184:
185: #define PRTYS_PROCESS 0
186: #define PRTYS_PROCESSTREE 1
187: #define PRTYS_THREAD 2
188:
189: /* Priority classes */
190:
191: #define PRTYC_NOCHANGE 0
192: #define PRTYC_IDLETIME 1
193: #define PRTYC_REGULAR 2
194: #define PRTYC_TIMECRITICAL 3
195: #define PRTYC_FOREGROUNDSERVER 4
196:
197: /* Priority deltas */
198:
199: #define PRTYD_MINIMUM -31
200: #define PRTYD_MAXIMUM 31
201:
202: APIRET APIENTRY DosKillProcess(ULONG action, PID pid);
203:
204: #define DKP_PROCESSTREE 0
205: #define DKP_PROCESS 1
206:
207: #endif /* INCL_DOSPROCESS */
208:
209: #ifndef INCL_SAADEFS
210:
211: /*
212: * CCHMAXPATH is the maximum fully qualified path name length including
213: * the drive letter, colon, backslashes and terminating NULL.
214: */
215: #define CCHMAXPATH 260
216:
217: /*
218: * CCHMAXPATHCOMP is the maximum individual path component name length
219: * including a terminating NULL.
220: */
221: #define CCHMAXPATHCOMP 256
222:
223: #endif /* !INCL_SAADEFS */
224:
225: #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
226:
227: /*** File manager */
228:
229: /* DosSetFilePtr() file position codes */
230:
231: #define FILE_BEGIN 0x0000 /* Move relative to beginning of file */
232: #define FILE_CURRENT 0x0001 /* Move relative to current fptr position */
233: #define FILE_END 0x0002 /* Move relative to end of file */
234:
235: /* DosFindFirst/Next Directory handle types */
236:
237: #define HDIR_SYSTEM 1 /* Use system handle (1) */
238: #define HDIR_CREATE (-1) /* Allocate a new, unused handle */
239:
240: /* DosCopy control bits; may be or'ed together */
241: #define DCPY_EXISTING 0x00001 /* Copy even if target exists */
242: #define DCPY_APPEND 0x00002 /* Append to existing file, do not replace */
243: #define DCPY_FAILEAS 0x00004 /* Fail if EAs not supported on target*/
244:
245: /* DosOpen/DosQFHandState/DosQueryFileInfo et al file attributes; also */
246: /* known as Dso File Mode bits... */
247: #define FILE_NORMAL 0x0000
248: #define FILE_READONLY 0x0001
249: #define FILE_HIDDEN 0x0002
250: #define FILE_SYSTEM 0x0004
251: #define FILE_DIRECTORY 0x0010
252: #define FILE_ARCHIVED 0x0020
253:
254: /* DosOpen() actions */
255:
256: #define FILE_EXISTED 0x0001
257: #define FILE_CREATED 0x0002
258: #define FILE_TRUNCATED 0x0003
259:
260: /* DosOpen() open flags */
261: #define FILE_OPEN 0x0001
262: #define FILE_TRUNCATE 0x0002
263: #define FILE_CREATE 0x0010
264:
265: /* this nibble applies if file already exists xxxx */
266:
267: #define OPEN_ACTION_FAIL_IF_EXISTS 0x0000 /* ---- ---- ---- 0000 */
268: #define OPEN_ACTION_OPEN_IF_EXISTS 0x0001 /* ---- ---- ---- 0001 */
269: #define OPEN_ACTION_REPLACE_IF_EXISTS 0x0002 /* ---- ---- ---- 0010 */
270:
271: /* this nibble applies if file does not exist xxxx */
272:
273: #define OPEN_ACTION_FAIL_IF_NEW 0x0000 /* ---- ---- 0000 ---- */
274: #define OPEN_ACTION_CREATE_IF_NEW 0x0010 /* ---- ---- 0001 ---- */
275:
276: /* DosOpen/DosSetFHandState flags */
277:
278: #define OPEN_ACCESS_READONLY 0x0000 /* ---- ---- ---- -000 */
279: #define OPEN_ACCESS_WRITEONLY 0x0001 /* ---- ---- ---- -001 */
280: #define OPEN_ACCESS_READWRITE 0x0002 /* ---- ---- ---- -010 */
281: #define OPEN_SHARE_DENYREADWRITE 0x0010 /* ---- ---- -001 ---- */
282: #define OPEN_SHARE_DENYWRITE 0x0020 /* ---- ---- -010 ---- */
283: #define OPEN_SHARE_DENYREAD 0x0030 /* ---- ---- -011 ---- */
284: #define OPEN_SHARE_DENYNONE 0x0040 /* ---- ---- -100 ---- */
285: #define OPEN_FLAGS_NOINHERIT 0x0080 /* ---- ---- 1--- ---- */
286: #define OPEN_FLAGS_NO_LOCALITY 0x0000 /* ---- -000 ---- ---- */
287: #define OPEN_FLAGS_SEQUENTIAL 0x0100 /* ---- -001 ---- ---- */
288: #define OPEN_FLAGS_RANDOM 0x0200 /* ---- -010 ---- ---- */
289: #define OPEN_FLAGS_RANDOMSEQUENTIAL 0x0300 /* ---- -011 ---- ---- */
290: #define OPEN_FLAGS_NO_CACHE 0x1000 /* ---1 ---- ---- ---- */
291: #define OPEN_FLAGS_FAIL_ON_ERROR 0x2000 /* --1- ---- ---- ---- */
292: #define OPEN_FLAGS_WRITE_THROUGH 0x4000 /* -1-- ---- ---- ---- */
293: #define OPEN_FLAGS_DASD 0x8000 /* 1--- ---- ---- ---- */
294:
295:
296: /* DosSearchPath() constants */
297:
298: #define SEARCH_PATH 0x0000
299: #define SEARCH_CUR_DIRECTORY 0x0001
300: #define SEARCH_ENVIRONMENT 0x0002
301: #define SEARCH_IGNORENETERRS 0x0004
302:
303: /************************************************************
304: DosFileIO
305: =========================================
306: ************************************************************/
307: /* File IO command words */
308: #define FIO_LOCK 0 /* Lock Files */
309: #define FIO_UNLOCK 1 /* Unlock Files */
310: #define FIO_SEEK 2 /* Seek (set file ptr) */
311: #define FIO_READ 3 /* File Read */
312: #define FIO_WRITE 4 /* File Write */
313:
314: /* Lock Sharing Modes */
315: #define FIO_NOSHARE 0 /* None */
316: #define FIO_SHAREREAD 1 /* Read-Only */
317:
318: typedef struct _FIOLOCKCMD { /* FLC File Lock Cmd prefix */
319: USHORT usCmd; /* Cmd = FIO_LOCK */
320: ULONG cTimeOut; /* in Msec */
321: USHORT cLockCnt; /* Lock records that follow */
322: } FIOLOCKCMD;
323: typedef FIOLOCKCMD FAR *PFIOLOCKCMD;
324:
325:
326: typedef struct _FIOLOCKREC { /* FLR File Lock Record */
327: USHORT fShare; /* FIO_NOSHARE or FIO_SHAREREAD */
328: ULONG cbStart; /* Starting offset for lock region */
329: ULONG cbLength; /* Length of lock region */
330: } FIOLOCKREC;
331: typedef FIOLOCKREC FAR *PIOLOCKREC;
332:
333:
334: typedef struct _FIOUNLOCKCMD { /* FUC File Unlock Cmd prefix */
335: USHORT usCmd; /* Cmd = FIO_UNLOCK */
336: USHORT cUnlockCnt; /* Unlock records that follow */
337: } FIOUNLOCKCMD;
338: typedef FIOUNLOCKCMD FAR *PFIOUNLOCKCMD;
339:
340:
341: typedef struct _FIOUNLOCKREC { /* FUR File Unlock Record */
342: ULONG cbStart; /* Starting offset for unlock region */
343: ULONG cbLength; /* Length of unlock region */
344: } FIOUNLOCKREC;
345: typedef FIOUNLOCKREC FAR *PFIOUNLOCKREC;
346:
347:
348: typedef struct _FIOSEEKCMD { /* FSC Seek command structure */
349: USHORT usCmd; /* Cmd = FIO_SEEK */
350: USHORT fsMethod; /* One of&gml FPM_BEGINNING,
351: FPM_CURRENT, or FPM_END */
352: ULONG cbDistance; /* Byte offset for seek */
353: ULONG cbNewPosition; /* Bytes from start of file after
354: seek */
355: } FIOSEEKCMD;
356: typedef FIOSEEKCMD FAR *PFIOSEEKCMD;
357:
358:
359: typedef struct _FIOREADWRITE { /* RWC Read & Write command structure */
360: USHORT usCmd; /* Cmd = FIO_READ or FIO_WRITE */
361: PVOID pbBuffer; /* Pointer to data buffer */
362: ULONG cbBufferLen; /* Bytes in buffer or max size */
363: ULONG cbActualLen; /* Bytes actually read/written */
364: } FIOREADWRITE;
365: typedef FIOREADWRITE FAR *PFIOREADWRITE;
366:
367:
368: /************************************************************
369: EA Info Levels & Find First/Next
370: =========================================
371: API's: DosFindFirst, DosQueryFileInfo, DosQueryPathInfo, DosSetFileInfo,
372: DosSetPathInfo
373: ************************************************************/
374:
375: /* File info levels&gml All listed API's */
376: #define FIL_STANDARD 1 /* Info level 1, standard file info */
377: #define FIL_QUERYEASIZE 2 /* Level 2, return Full EA size */
378: #define FIL_QUERYEASFROMLIST 3 /* Level 3, return requested EA's */
379: #define FIL_QUERYALLEAS 4 /* Level 4, return all EA's */
380:
381: /* File info levels: Dos...PathInfo only */
382: #define FIL_QUERYFULLNAME 5 /* Level 5, return fully qualified
383: name of file */
384: #define FIL_NAMEISVALID 6 /* Level 6, check validity of file/path
385: name for this FSD */
386:
387:
388: /* DosFsAttach() */
389: /* Attact or detach */
390: #define FS_ATTACH 0 /* Attach file server */
391: #define FS_DETACH 1 /* Detach file server */
392:
393:
394: /* DosFsCtl() */
395: /* Routing type */
396: #define FSCTL_HANDLE 1 /* File Handle directs req routing */
397: #define FSCTL_PATHNAME 2 /* Path Name directs req routing */
398: #define FSCTL_FSDNAME 3 /* FSD Name directs req routing */
399:
400:
401: /* DosQueryFSAttach() */
402: /* Information level types (defines method of query) */
403: #define FSAIL_QUERYNAME 1 /* Return data for a Drive or Device */
404: #define FSAIL_DEVNUMBER 2 /* Return data for Ordinal Device # */
405: #define FSAIL_DRVNUMBER 3 /* Return data for Ordinal Drive # */
406:
407: /* Item types (from data structure item "iType") */
408: #define FSAT_CHARDEV 1 /* Resident character device */
409: #define FSAT_PSEUDODEV 2 /* Pusedu-character device */
410: #define FSAT_LOCALDRV 3 /* Local drive */
411: #define FSAT_REMOTEDRV 4 /* Remote drive attached to FSD */
412:
413: typedef struct _FSQBUFFER { /* fsqbuf Data structure for QFSAttach*/
414: USHORT iType; /* Item type */
415: USHORT cbName; /* Length of item name, sans NULL */
416: UCHAR szName[1]; /* ASCIIZ item name */
417: USHORT cbFSDName; /* Length of FSD name, sans NULL */
418: UCHAR szFSDName[1]; /* ASCIIZ FSD name */
419: USHORT cbFSAData; /* Length of FSD Attach data returned */
420: UCHAR rgFSAData[1]; /* FSD Attach data from FSD */
421: } FSQBUFFER;
422: typedef FSQBUFFER FAR *PFSQBUFFER;
423:
424:
425: /***********
426: File System Drive Information&gml DosQueryFSInfo DosSetFSInfo
427: ***********/
428:
429: /* FS Drive Info Levels */
430: #define FSIL_ALLOC 1 /* Drive allocation info (Query only) */
431: #define FSIL_VOLSER 2 /* Drive Volum/Serial info */
432:
433: /* DosQueryFHType() */
434: /* Handle classes (low 8 bits of Handle Type) */
435: #define FHT_DISKFILE 0x0000 /* Disk file handle */
436: #define FHT_CHRDEV 0x0001 /* Character device handle */
437: #define FHT_PIPE 0x0002 /* Pipe handle */
438:
439: /* Handle bits (high 8 bits of Handle Type) */
440: #define FHB_DSKREMOTE 0x8000 /* Remote disk */
441: #define FHB_CHRDEVREMOTE 0x8000 /* Remote character device */
442: #define FHB_PIPEREMOTE 0x8000 /* Remote pipe */
443:
444: #ifndef INCL_SAADEFS
445:
446: /* File time and date types */
447:
448: typedef struct _FTIME { /* ftime */
449: USHORT twosecs : 5;
450: USHORT minutes : 6;
451: USHORT hours : 5;
452: } FTIME;
453: typedef FTIME *PFTIME;
454:
455: typedef struct _FDATE { /* fdate */
456: USHORT day : 5;
457: USHORT month : 4;
458: USHORT year : 7;
459: } FDATE;
460: typedef FDATE *PFDATE;
461:
462: #endif /* INCL_SAADEFS */
463:
464: typedef struct _VOLUMELABEL { /* vol */
465: BYTE cch;
466: CHAR szVolLabel[12];
467: } VOLUMELABEL;
468: typedef VOLUMELABEL FAR *PVOLUMELABEL;
469:
470: typedef struct _FSINFO { /* fsinf */
471: FDATE fdateCreation;
472: FTIME ftimeCreation;
473: VOLUMELABEL vol;
474: } FSINFO;
475: typedef FSINFO FAR *PFSINFO;
476:
477: /* HANDTYPE values */
478:
479: #define HANDTYPE_FILE 0x0000
480: #define HANDTYPE_DEVICE 0x0001
481: #define HANDTYPE_PIPE 0x0002
482: #define HANDTYPE_NETWORK 0x8000
483:
484: typedef struct _FILELOCK { /* flock */
485: LONG lOffset;
486: LONG lRange;
487: } FILELOCK;
488: typedef FILELOCK FAR *PFILELOCK;
489:
490: typedef SHANDLE HFILE; /* hf */
491: typedef HFILE *PHFILE;
492:
493: #ifndef INCL_SAADEFS
494:
495: typedef struct _FILEFINDBUF { /* findbuf */
496: FDATE fdateCreation;
497: FTIME ftimeCreation;
498: FDATE fdateLastAccess;
499: FTIME ftimeLastAccess;
500: FDATE fdateLastWrite;
501: FTIME ftimeLastWrite;
502: ULONG cbFile;
503: ULONG cbFileAlloc;
504: USHORT attrFile;
505: UCHAR cchName;
506: CHAR achName[CCHMAXPATHCOMP];
507: } FILEFINDBUF;
508: typedef FILEFINDBUF *PFILEFINDBUF;
509:
510: #pragma pack(2)
511:
512: typedef struct _FILEFINDBUF2 { /* findbuf2 */
513: FDATE fdateCreation;
514: FTIME ftimeCreation;
515: FDATE fdateLastAccess;
516: FTIME ftimeLastAccess;
517: FDATE fdateLastWrite;
518: FTIME ftimeLastWrite;
519: ULONG cbFile;
520: ULONG cbFileAlloc;
521: USHORT attrFile;
522: ULONG cbList;
523: UCHAR cchName;
524: CHAR achName[CCHMAXPATHCOMP];
525: } FILEFINDBUF2;
526:
527: #pragma pack()
528:
529: typedef FILEFINDBUF2 *PFILEFINDBUF2;
530:
531: /* extended attribute structures */
532:
533: typedef struct _GEA { /* gea */
534: BYTE cbName; /* name length not including NULL */
535: CHAR szName[1]; /* attribute name */
536: } GEA;
537: typedef GEA *PGEA;
538:
539: typedef struct _GEALIST { /* geal */
540: ULONG cbList; /* total bytes of structure including full list */
541: GEA list[1]; /* variable length GEA structures */
542: } GEALIST;
543: typedef GEALIST* PGEALIST;
544:
545: typedef struct _FEA { /* fea */
546: BYTE fEA; /* flags */
547: BYTE cbName; /* name length not including NULL */
548: USHORT cbValue; /* value length */
549: } FEA;
550: typedef FEA *PFEA;
551:
552: /* flags for _FEA.fEA */
553:
554: #define FEA_NEEDEA 0x80 /* need EA bit */
555:
556: typedef struct _FEALIST { /* feal */
557: ULONG cbList; /* total bytes of structure including full list */
558: FEA list[1]; /* variable length FEA structures */
559: } FEALIST;
560: typedef FEALIST* PFEALIST;
561:
562: typedef struct _EAOP { /* eaop */
563: PGEALIST fpGEAList; /* general EA list */
564: PFEALIST fpFEAList; /* full EA list */
565: ULONG oError;
566: } EAOP;
567: typedef EAOP* PEAOP;
568:
569: /*
570: * Equates for the types of EAs that follow the convention that we have
571: * established.
572: *
573: * Values 0xFFFE thru 0x8000 are reserved.
574: * Values 0x0000 thru 0x7fff are user definable.
575: * Value 0xFFFC is not used
576: */
577:
578: #define EAT_BINARY 0xFFFE /* length preceeded binary */
579: #define EAT_ASCII 0xFFFD /* length preceeded ASCII */
580: #define EAT_BITMAP 0xFFFB /* length preceeded bitmap */
581: #define EAT_METAFILE 0xFFFA /* length preceeded metafile */
582: #define EAT_ICON 0xFFF9 /* length preceeded icon */
583: #define EAT_EA 0xFFEE /* length preceeded ASCII */
584: /* name of associated data (#include) */
585: #define EAT_MVMT 0xFFDF /* multi-valued, multi-typed field */
586: #define EAT_MVST 0xFFDE /* multi-valued, single-typed field */
587: #define EAT_ASN1 0xFFDD /* ASN.1 field */
588:
589: #endif /* !INCL_SAADEFS */
590:
591: APIRET APIENTRY DosOpen(PSZ pszFile, PHFILE pHfile, PULONG pulAction, ULONG cbSize, ULONG attr, ULONG flag, ULONG mode, PEAOP peaop);
592:
593: APIRET APIENTRY DosClose(HFILE hFile);
594:
595: APIRET APIENTRY DosRead(HFILE hFile, PVOID pBuffer, ULONG cbRead, PULONG pcbActual);
596:
597: APIRET APIENTRY DosWrite(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual);
598:
599: /* File time and date types */
600:
601: typedef struct _FILESTATUS { /* fsts */
602: FDATE fdateCreation;
603: FTIME ftimeCreation;
604: FDATE fdateLastAccess;
605: FTIME ftimeLastAccess;
606: FDATE fdateLastWrite;
607: FTIME ftimeLastWrite;
608: ULONG cbFile;
609: ULONG cbFileAlloc;
610: USHORT attrFile;
611: } FILESTATUS;
612: typedef FILESTATUS *PFILESTATUS;
613:
614: #pragma pack(2)
615:
616: typedef struct _FILESTATUS2 { /* fsts2 */
617: FDATE fdateCreation;
618: FTIME ftimeCreation;
619: FDATE fdateLastAccess;
620: FTIME ftimeLastAccess;
621: FDATE fdateLastWrite;
622: FTIME ftimeLastWrite;
623: ULONG cbFile;
624: ULONG cbFileAlloc;
625: USHORT attrFile;
626: ULONG cbList;
627: } FILESTATUS2;
628:
629: #pragma pack()
630:
631: typedef FILESTATUS2 *PFILESTATUS2;
632:
633: typedef struct _FSALLOCATE { /* fsalloc */
634: ULONG idFileSystem;
635: ULONG cSectorUnit;
636: ULONG cUnit;
637: ULONG cUnitAvail;
638: USHORT cbSector;
639: } FSALLOCATE;
640: typedef FSALLOCATE *PFSALLOCATE;
641:
642: typedef SHANDLE HDIR; /* hdir */
643: typedef HDIR *PHDIR;
644:
645: /* XLATOFF */
646: #define DosOpen2 DosOpen
647: #define DosFindFirst2 DosFindFirst
648: #define DosQFHandState DosQueryFHState
649: #define DosSetFHandState DosSetFHState
650: #define DosQHandType DosQueryHType
651: #define DosQFSAttach DosQueryFSAttach
652: #define DosNewSize DosSetFileSize
653: #define DosBufReset DosResetBuffer
654: #define DosChgFilePtr DosSetFilePtr
655: #define DosFileLocks DosSetFileLocks
656: #define DosMkDir DosCreateDir
657: #define DosMkDir2 DosCreateDir
658: #define DosRmDir DosDeleteDir
659: #define DosSelectDisk DosSetDefaultDisk
660: #define DosQCurDisk DosQueryCurrentDisk
661: #define DosChDir DosSetCurrentDir
662: #define DosQCurDir DosQueryCurrentDir
663: #define DosQFSInfo DosQueryFSInfo
664: #define DosQVerify DosQueryVerify
665: #define DosQFileInfo DosQueryFileInfo
666: #define DosQPathInfo DosQueryPathInfo
667: /* XLATON */
668:
669: APIRET APIENTRY DosDelete(PSZ pszFile);
670:
671: APIRET APIENTRY DosDupHandle(HFILE hFile, PHFILE pHfile);
672:
673: APIRET APIENTRY DosQueryFHState(HFILE hFile, PULONG pMode);
674:
675: APIRET APIENTRY DosSetFHState(HFILE hFile, ULONG mode);
676:
677: APIRET APIENTRY DosQueryHType(HFILE hFile, PULONG pType, PULONG pAttr);
678:
679: APIRET APIENTRY DosFindFirst(PSZ pszMatch, PHDIR pHdir, ULONG attr, PFILEFINDBUF pfindbuf, ULONG cbBuf, PULONG pcSearch, ULONG infolevel);
680:
681: APIRET APIENTRY DosFindNext(HDIR hDir, PFILEFINDBUF pFindbuf, ULONG cbBuf, PULONG pcSearch);
682:
683: APIRET APIENTRY DosFindClose(HDIR hDir);
684:
685: APIRET APIENTRY DosFSAttach(PSZ pszDevice, PSZ pszFilesystem, PVOID pData, ULONG cbData, ULONG flag);
686:
687: APIRET APIENTRY DosQueryFSAttach(PSZ pszDevice, ULONG ordinal, ULONG infolevel, PVOID pFSAttr, PULONG cbFSAttr);
688:
689: APIRET APIENTRY DosFSCtl(PVOID pData, ULONG cbData, PULONG pcbData, PVOID pParms, ULONG cbParms, PULONG pcbParms, ULONG function, PSZ pszRoute, HFILE hFile, ULONG method);
690:
691: APIRET APIENTRY DosSetFileSize(HFILE hFile, ULONG cbSize);
692:
693: APIRET APIENTRY DosResetBuffer(HFILE hFile);
694:
695: APIRET APIENTRY DosSetFilePtr(HFILE hFile, LONG ib, ULONG method, PULONG ibActual);
696:
697: APIRET APIENTRY DosSetFileLocks(HFILE hFile, PFILELOCK pflUnlock, PFILELOCK pflLock);
698:
699: APIRET APIENTRY DosMove(PSZ pszOld, PSZ pszNew);
700:
701: APIRET APIENTRY DosCopy(PSZ pszOld, PSZ pszNew, ULONG option);
702:
703: APIRET APIENTRY DosEditName(ULONG metalevel, PSZ pszSource, PSZ pszEdit, PBYTE pszTarget, ULONG cbTarget);
704:
705: APIRET APIENTRY DosFileIO(HFILE hFile, PVOID pCmd, ULONG cbCmd, PLONG ibError);
706:
707: APIRET APIENTRY DosCreateDir(PSZ pszDir, PEAOP peaop);
708:
709: APIRET APIENTRY DosDeleteDir(PSZ pszDir);
710:
711: APIRET APIENTRY DosSetDefaultDisk(ULONG disknum);
712:
713: APIRET APIENTRY DosQueryCurrentDisk(PULONG pdisknum, PULONG plogical);
714:
715: APIRET APIENTRY DosSetCurrentDir(PSZ pszDir);
716:
717: APIRET APIENTRY DosQueryCurrentDir(ULONG disknum, PBYTE pBuf, PULONG pcbBuf);
718:
719: APIRET APIENTRY DosQueryFSInfo(ULONG disknum, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
720:
721: APIRET APIENTRY DosSetFSInfo(ULONG disknum, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
722:
723: APIRET APIENTRY DosQueryVerify(PBOOL32 pBool);
724:
725: APIRET APIENTRY DosSetVerify(BOOL32);
726:
727: APIRET APIENTRY DosSetMaxFH(ULONG cFH);
728:
729: APIRET APIENTRY DosSetRelMaxFH(PLONG pcbReqCount, PULONG pcbCurMaxFH);
730:
731: APIRET APIENTRY DosQueryFileInfo(HFILE hFile, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
732:
733: APIRET APIENTRY DosSetFileInfo(HFILE hFile, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
734:
735: APIRET APIENTRY DosQueryPathInfo(PSZ pszPath, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
736:
737: APIRET APIENTRY DosSetPathInfo(PSZ pszPath, ULONG infolevel, PVOID pBuf, ULONG cbBuf, ULONG usFlags);
738:
739: /* defines for DosSetPathInfo -pathinfo flag */
740: #define DSPI_WRTTHRU 0x10 /* write through */
741:
742:
743: APIRET APIENTRY DosEnumAttribute(ULONG fRefType, PVOID pFileRef, ULONG iStartEntry, PVOID pEnumBuf, ULONG cbBuf, PULONG pcbActual, ULONG infoLevel);
744:
745: typedef struct _DENA1 { /* _dena1 level 1 info returned from DosEnumAttribute */
746: UCHAR reserved; /* 0 */
747: UCHAR cbName; /* length of name exculding NULL */
748: USHORT cbValue; /* length of value */
749: UCHAR szName[1]; /* variable length asciiz name */
750: } DENA1;
751: typedef DENA1 FAR *PDENA1;
752:
753: /* Infolevels for DosEnumAttribute */
754: #define ENUMEA_LEVEL_NO_VALUE 1L /* FEA without value */
755: /* Reference types for DosEnumAttribute */
756: #define ENUMEA_REFTYPE_FHANDLE 0 /* file handle */
757: #define ENUMEA_REFTYPE_PATH 1 /* path name */
758: #define ENUMEA_REFTYPE_MAX ENUMEA_REFTYPE_PATH
759:
760: #endif /* common INCL_DOSFILEMGR */
761:
762: #if (defined(INCL_DOSMEMMGR) || !defined(INCL_NOCOMMON))
763: /*** Memory management */
764:
765: APIRET APIENTRY DosAllocMem(PPVOID ppb, ULONG cb, ULONG flag);
766:
767: APIRET APIENTRY DosFreeMem(PVOID pb);
768:
769: APIRET APIENTRY DosSetMem(PVOID pb, ULONG cb, ULONG flag);
770:
771: APIRET APIENTRY DosGiveSharedMem(PVOID pb, PID pid, ULONG flag);
772:
773: APIRET APIENTRY DosGetSharedMem(PVOID pb, ULONG flag);
774:
775: APIRET APIENTRY DosGetNamedSharedMem(PPVOID ppb, PSZ pszName, ULONG flag);
776:
777: APIRET APIENTRY DosAllocSharedMem(PPVOID ppb, PSZ pszName, ULONG cb, ULONG flag);
778:
779: APIRET APIENTRY DosQueryMem(PVOID pb, PULONG pcb, PULONG pFlag);
780:
781: APIRET APIENTRY DosSubAlloc(PVOID pbBase, PPVOID ppb, ULONG cb);
782:
783: APIRET APIENTRY DosSubFree(PVOID pbBase, PVOID pb, ULONG cb);
784:
785: APIRET APIENTRY DosSubSet(PVOID pbBase, ULONG flag, ULONG cb);
786:
787: APIRET APIENTRY DosSubUnset(PVOID pbBase);
788:
789: #include <bsememf.h> /* get flags for API */
790:
791: #endif /* INCL_DOSMEMMGR */
792:
793: #if (defined(INCL_DOSSEMAPHORES) || !defined(INCL_NOCOMMON))
794:
795: /*
796: * 32-bit Semaphore Support
797: */
798:
799: /* Semaphore Attributes */
800:
801: #define DC_SEM_SHARED 0x01 /* DosCreateMutex, DosCreateEvent, and */
802: /* DosCreateMuxWait use it to indicate */
803: /* whether the semaphore is shared or */
804: /* private when the PSZ is null */
805: #define DCMW_WAIT_ANY 0x02 /* DosCreateMuxWait option for wait on any */
806: /* event/mutex to occur */
807: #define DCMW_WAIT_ALL 0x04 /* DosCreateMuxWait option for wait on all */
808: /* events/mutexs to occur */
809:
810: #define SEM_INDEFINITE_WAIT -1L
811: #define SEM_IMMEDIATE_RETURN 0L
812:
813: typedef struct _PSEMRECORD { /* psr */
814: HSEM hsemCur;
815: ULONG ulUser;
816: } SEMRECORD;
817: typedef SEMRECORD *PSEMRECORD;
818:
819: #endif /* common INCL_DOSSEMAPHORES */
820:
821: #ifdef INCL_DOSSEMAPHORES
822:
823: typedef ULONG HMTX; /* hmtx */
824: typedef HMTX *PHMTX;
825: typedef ULONG HEV; /* hev */
826: typedef HEV *PHEV;
827: typedef ULONG HMUX; /* hmux */
828: typedef HMUX *PHMUX;
829: typedef VOID FAR *HSEM; /* hsem */
830: typedef HSEM FAR *PHSEM;
831:
832: APIRET APIENTRY DosCreateEventSem (PSZ pszName, PHEV phev, ULONG flAttr, BOOL32 fState);
833: APIRET APIENTRY DosOpenEventSem (PSZ pszName, PHEV phev);
834: APIRET APIENTRY DosCloseEventSem (HEV hev);
835: APIRET APIENTRY DosResetEventSem (HEV hev, PULONG pulPostCt);
836: APIRET APIENTRY DosPostEventSem (HEV hev);
837: APIRET APIENTRY DosWaitEventSem (HEV hev, ULONG ulTimeout);
838: APIRET APIENTRY DosQueryEventSem (HEV hev, PULONG pulPostCt);
839:
840: APIRET APIENTRY DosCreateMutexSem (PSZ pszName, PHMTX phmtx, ULONG flAttr, BOOL32 fState);
841: APIRET APIENTRY DosOpenMutexSem (PSZ pszName, PHMTX phmtx);
842: APIRET APIENTRY DosCloseMutexSem (HMTX hmtx);
843: APIRET APIENTRY DosRequestMutexSem (HMTX hmtx, ULONG ulTimeout);
844: APIRET APIENTRY DosReleaseMutexSem (HMTX hmtx);
845: APIRET APIENTRY DosQueryMutexSem (HMTX hmtx, PID *ppid, TID *ptid, PULONG pulCount);
846:
847: APIRET APIENTRY DosCreateMuxWaitSem (PSZ pszName, PHMUX phmux, ULONG cSemRec, PSEMRECORD pSemRec, ULONG flAttr);
848: APIRET APIENTRY DosOpenMuxWaitSem (PSZ pszName, PHMUX phmux);
849: APIRET APIENTRY DosCloseMuxWaitSem (HMUX hmux);
850: APIRET APIENTRY DosWaitMuxWaitSem (HMUX hmux, ULONG ulTimeout, PULONG pulUser);
851: APIRET APIENTRY DosAddMuxWaitSem (HMUX hmux, PSEMRECORD pSemRec);
852: APIRET APIENTRY DosDeleteMuxWaitSem (HMUX hmux, HSEM hSem);
853: APIRET APIENTRY DosQueryMuxWaitSem (HMUX hmux, PULONG pcSemRec, PSEMRECORD pSemRec, PULONG pflAttr);
854:
855: #endif /* INCL_DOSSEMAPHORES */
856:
857: #if (defined(INCL_DOSDATETIME) || !defined(INCL_NOCOMMON))
858:
859: /*** Time support */
860:
861: typedef struct _DATETIME { /* date */
862: UCHAR hours;
863: UCHAR minutes;
864: UCHAR seconds;
865: UCHAR hundredths;
866: UCHAR day;
867: UCHAR month;
868: USHORT year;
869: SHORT timezone;
870: UCHAR weekday;
871: } DATETIME;
872: typedef DATETIME *PDATETIME;
873:
874: APIRET APIENTRY DosGetDateTime(PDATETIME pdt);
875:
876: APIRET APIENTRY DosSetDateTime(PDATETIME pdt);
877:
878: #endif /* common INCL_DOSDATETIME */
879:
880: #ifdef INCL_DOSDATETIME
881:
882: /* XLATOFF */
883: #define DosTimerAsync DosAsyncTimer
884: #define DosTimerStart DosStartTimer
885: #define DosTimerStop DosStopTimer
886: /* XLATON */
887:
888: typedef SHANDLE HTIMER;
889: typedef HTIMER *PHTIMER;
890:
891: APIRET APIENTRY DosAsyncTimer(ULONG msec, HSEM hsem, PHTIMER phtimer);
892:
893: APIRET APIENTRY DosStartTimer(ULONG msec, HSEM hsem, PHTIMER phtimer);
894:
895: APIRET APIENTRY DosStopTimer(HTIMER htimer);
896:
897: #endif /* INCL_DOSDATETIME */
898:
899:
900: /*** Module manager */
901:
902: #ifdef INCL_DOSMODULEMGR
903:
904: /* XLATOFF */
905: #define DosGetProcAddr DosQueryProcAddr
906: #define DosGetModHandle DosQueryModuleHandle
907: #define DosGetModName DosQueryModuleName
908: /* XLATON */
909:
910: APIRET APIENTRY DosLoadModule(PSZ pszName, ULONG cbName, PSZ pszModname, PHMODULE phmod);
911:
912: APIRET APIENTRY DosFreeModule(HMODULE hmod);
913:
914: APIRET APIENTRY DosQueryProcAddr(HMODULE hmod, ULONG ordinal, PSZ pszName,PFN* ppfn);
915:
916: APIRET APIENTRY DosQueryModuleHandle(PSZ pszModname, PHMODULE phmod);
917:
918: APIRET APIENTRY DosQueryModuleName(HMODULE hmod, ULONG cbName, PCHAR pch);
919:
920: #define PT_16BIT 0
921: #define PT_32BIT 1
922:
923: APIRET APIENTRY DosQueryProcType(HMODULE hmod, ULONG ordinal, PSZ pszName, PULONG pulproctype);
924:
925: #endif /* INCL_DOSMODULEMGR */
926:
927: #if (defined(INCL_DOSRESOURCES) || !defined(INCL_NOCOMMON))
928:
929: /*** Resource support */
930:
931: /* Predefined resource types */
932:
933: #define RT_POINTER 1 /* mouse pointer shape */
934: #define RT_BITMAP 2 /* bitmap */
935: #define RT_MENU 3 /* menu template */
936: #define RT_DIALOG 4 /* dialog template */
937: #define RT_STRING 5 /* string tables */
938: #define RT_FONTDIR 6 /* font directory */
939: #define RT_FONT 7 /* font */
940: #define RT_ACCELTABLE 8 /* accelerator tables */
941: #define RT_RCDATA 9 /* binary data */
942: #define RT_MESSAGE 10 /* error msg tables */
943: #define RT_DLGINCLUDE 11 /* dialog include file name */
944: #define RT_VKEYTBL 12 /* key to vkey tables */
945: #define RT_KEYTBL 13 /* key to UGL tables */
946: #define RT_CHARTBL 14 /* glyph to character tables */
947: #define RT_DISPLAYINFO 15 /* screen display information */
948:
949: #define RT_FKASHORT 16 /* function key area short form */
950: #define RT_FKALONG 17 /* function key area long form */
951:
952: #define RT_HELPTABLE 18 /* Help table for Cary Help manager */
953: #define RT_HELPSUBTABLE 19 /* Help subtable for Cary Help manager */
954:
955: #define RT_FDDIR 20 /* DBCS uniq/font driver directory */
956: #define RT_FD 21 /* DBCS uniq/font driver */
957:
958: #define RT_MAX 22 /* 1st unused Resource Type */
959:
960:
961: #define RF_ORDINALID 0x80000000L /* ordinal id flag in resource table */
962:
963: #endif /* common INCL_DOSRESOURCES */
964:
965: #ifdef INCL_DOSRESOURCES
966:
967: /* XLATOFF */
968: #define DosGetResource2 DosGetResource
969: /* XLATON */
970:
971: APIRET APIENTRY DosGetResource(HMODULE hmod, ULONG idType, ULONG idName, PPVOID ppb);
972:
973: APIRET APIENTRY DosFreeResource(PVOID pb);
974:
975: APIRET APIENTRY DosQueryResourceSize(HMODULE hmod, ULONG idt, ULONG idn, PULONG pulsize);
976:
977: #endif /* INCL_DOSRESOURCES */
978:
979:
980: /*** NLS Support */
981:
982: #ifdef INCL_DOSNLS
983:
984: typedef struct _COUNTRYCODE { /* ctryc */
985: ULONG country;
986: ULONG codepage;
987: } COUNTRYCODE;
988: typedef COUNTRYCODE *PCOUNTRYCODE;
989:
990: typedef struct _COUNTRYINFO { /* ctryi */
991: ULONG country;
992: ULONG codepage;
993: ULONG fsDateFmt;
994: CHAR szCurrency[5];
995: CHAR szThousandsSeparator[2];
996: CHAR szDecimal[2];
997: CHAR szDateSeparator[2];
998: CHAR szTimeSeparator[2];
999: UCHAR fsCurrencyFmt;
1000: UCHAR cDecimalPlace;
1001: UCHAR fsTimeFmt;
1002: USHORT abReserved1[2];
1003: CHAR szDataSeparator[2];
1004: USHORT abReserved2[5];
1005: } COUNTRYINFO;
1006: typedef COUNTRYINFO *PCOUNTRYINFO;
1007:
1008: /* XLATOFF */
1009: #define DosGetCtryInfo DosQueryCtryInfo
1010: #define DosGetDBCSEv DosQueryDBCSEnv
1011: #define DosCaseMap DosMapCase
1012: #define DosGetCollate DosQueryCollate
1013: #define DosGetCp DosQueryCp
1014: #define DosSetProcCp DosSetProcessCp
1015: /* XLATON */
1016:
1017: APIRET APIENTRY DosQueryCtryInfo(ULONG cb, PCOUNTRYCODE pcc, PCOUNTRYINFO pci, PULONG pcbActual);
1018:
1019: APIRET APIENTRY DosQueryDBCSEnv(ULONG cb, PCOUNTRYCODE pcc, PCHAR pBuf);
1020:
1021: APIRET APIENTRY DosMapCase(ULONG cb, PCOUNTRYCODE pcc, PCHAR pch);
1022:
1023: APIRET APIENTRY DosQueryCollate(ULONG cb, PCOUNTRYCODE pcc, PCHAR pch, PULONG pcch);
1024:
1025: APIRET APIENTRY DosQueryCp(ULONG cb, PULONG arCP, PULONG pcCP);
1026:
1027: APIRET APIENTRY DosSetProcessCp(ULONG cp);
1028:
1029: #endif /* INCL_DOSNLS */
1030:
1031:
1032: /*** Signal support */
1033:
1034: #ifdef INCL_DOSSIGNALS
1035:
1036: /* DosSetSigExceptionFocus codes */
1037:
1038: #define SIG_UNSETFOCUS 0
1039: #define SIG_SETFOCUS 1
1040:
1041: #include <bsexcpt.h>
1042:
1043: APIRET APIENTRY DosSetExceptionHandler(PEHS phandler);
1044:
1045: APIRET APIENTRY DosUnsetExceptionHandler(PEHS phandler);
1046:
1047: APIRET APIENTRY DosRaiseException(PXCPT pexcept);
1048:
1049: APIRET APIENTRY DosSendSignalException(PID pid, ULONG exception);
1050:
1051: APIRET APIENTRY DosUnwindException(PEHS phandler);
1052:
1053: APIRET APIENTRY DosSetSignalExceptionFocus(BOOL32 flag, PULONG pulTimes);
1054:
1055: APIRET APIENTRY DosEnterMustComplete(PULONG pulNesting);
1056:
1057: APIRET APIENTRY DosExitMustComplete(PULONG pulNesting);
1058:
1059: #endif /* INCL_DOSSIGNALS */
1060:
1061:
1062: /*** Pipe and queue support */
1063:
1064: #ifdef INCL_DOSQUEUES
1065: #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
1066:
1067: typedef SHANDLE HQUEUE; /* hq */
1068: typedef HQUEUE *PHQUEUE;
1069: typedef struct _REQUESTDATA { /* reqqdata */
1070: PID pid;
1071: ULONG ulData;
1072: } REQUESTDATA;
1073: typedef REQUESTDATA *PREQUESTDATA;
1074:
1075: #define QUE_FIFO 0L
1076: #define QUE_LIFO 1L
1077: #define QUE_PRIORITY 2L
1078:
1079: /* XLATOFF */
1080: #define DosMakePipe DosCreatePipe
1081: /* XLATON */
1082:
1083: APIRET APIENTRY DosCreatePipe(PHFILE phfRead, PHFILE phfWrite, ULONG cb);
1084:
1085: APIRET APIENTRY DosCloseQueue(HQUEUE hq);
1086:
1087: APIRET APIENTRY DosCreateQueue(PHQUEUE phq, ULONG priority, PSZ pszName);
1088:
1089: APIRET APIENTRY DosOpenQueue(PPID ppid, PHQUEUE phq, PSZ pszName);
1090:
1091: APIRET APIENTRY DosPeekQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, PULONG element, BOOL32 nowait, PBYTE ppriority, HSEM hsem);
1092:
1093: APIRET APIENTRY DosPurgeQueue(HQUEUE hq);
1094:
1095: APIRET APIENTRY DosQueryQueue(HQUEUE hq, PULONG pcbEntries);
1096:
1097: APIRET APIENTRY DosReadQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, ULONG element, BOOL32 wait, PBYTE ppriority, HSEM hsem);
1098:
1099: APIRET APIENTRY DosWriteQueue(HQUEUE hq, ULONG request, ULONG cbData, PVOID pbData, ULONG priority);
1100:
1101: #else /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
1102: #error PHFILE not defined - define INCL_DOSFILEMGR or undefine INCL_NOCOMMON
1103: #endif /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
1104: #endif /* INCL_DOSQUEUES */
1105:
1106: #ifdef INCL_DOSMISC
1107:
1108: /* definitions for DosSearchPath control word */
1109: #define DSP_IMPLIEDCUR 1 /* current dir will be searched first */
1110: #define DSP_PATHREF 2 /* from env.variable */
1111: #define DSP_IGNORENETERR 4 /* ignore net errs & continue search */
1112:
1113: /* indices for DosQuerySysInfo */
1114: #define QSV_MAX_PATH_LENGTH 1
1115: #define Q_MAX_PATH_LENGTH QSV_MAX_PATH_LENGTH
1116: #define QSV_MAX_TEXT_SESSIONS 2
1117: #define QSV_MAX_PM_SESSIONS 3
1118: #define QSV_MAX_VDM_SESSIONS 4
1119: #define QSV_BOOT_DRIVE 5 /* 1=A, 2=B, etc. */
1120: #define QSV_DYN_PRI_VARIATION 6 /* 0=Absolute, 1=Dynamic */
1121: #define QSV_MAX_WAIT 7 /* seconds */
1122: #define QSV_MIN_SLICE 8 /* milli seconds */
1123: #define QSV_MAX_SLICE 9 /* milli seconds */
1124: #define QSV_PAGE_SIZE 10
1125: #define QSV_VERSION_MAJOR 11
1126: #define QSV_VERSION_MINOR 12
1127: #define QSV_VERSION_REVISION 13 /* Revision letter */
1128: #define QSV_MS_COUNT 14 /* Free running millisecond counter */
1129: #define QSV_TIME_LOW 15 /* Low dword of time in seconds */
1130: #define QSV_TIME_HIGH 16 /* High dword of time in seconds */
1131: #define QSV_TOTPHYSMEM 17 /* Physical memory on system */
1132: #define QSV_TOTRESMEM 18 /* Resident memory on system */
1133: #define QSV_TOTAVAILMEM 19 /* Available memory for all processes */
1134: #define QSV_MAXPRMEM 20 /* Avail private mem for calling proc */
1135: #define QSV_MAXSHMEM 21 /* Avail shared mem for calling proc */
1136: #define QSV_TIMER_INTERVAL 22 /* Timer interval in tenths of ms */
1137: #define QSV_MAX QSV_TIMER_INTERVAL
1138:
1139: /* definitions for DosError - combine with | */
1140: #define FERR_DISABLEHARDERR 0x00000000L /* disable hard error popups */
1141: #define FERR_ENABLEHARDERR 0x00000001L /* enable hard error popups */
1142: #define FERR_ENABLEEXCEPTION 0x00000000L /* enable exception popups */
1143: #define FERR_DISABLEEXCEPTION 0x00000002L /* disable exception popups */
1144:
1145: /* XLATOFF */
1146: #define DosInsMessage DosInsertMessage
1147: #define DosQSysInfo DosQuerySysInfo
1148: /* XLATON */
1149:
1150: APIRET APIENTRY DosError(ULONG error);
1151:
1152: APIRET APIENTRY DosGetMessage(PCHAR* pTable, ULONG cTable, PCHAR pBuf, ULONG cbBuf, ULONG msgnumber, PSZ pszFile, PULONG pcbMsg);
1153:
1154: APIRET APIENTRY DosErrClass(ULONG code, PULONG pClass, PULONG pAction, PULONG pLocus);
1155:
1156: APIRET APIENTRY DosInsertMessage(PCHAR* pTable, ULONG cTable, PSZ pszMsg, ULONG cbMsg, PCHAR pBuf, ULONG cbBuf, PULONG pcbMsg);
1157:
1158: APIRET APIENTRY DosPutMessage(HFILE hfile, ULONG cbMsg, PCHAR pBuf);
1159:
1160: APIRET APIENTRY DosQuerySysInfo(ULONG iStart, ULONG iLast, PVOID pBuf, ULONG cbBuf);
1161:
1162: APIRET APIENTRY DosScanEnv(PSZ pszName, PSZ *ppszValue);
1163:
1164: APIRET APIENTRY DosSearchPath(ULONG flag, PSZ pszPathOrName, PSZ pszFilename, PBYTE pBuf, ULONG cbBuf);
1165:
1166: APIRET APIENTRY DosQueryMessageCP(PCHAR pb, ULONG cb, PSZ pszFilename, PULONG cbBuf);
1167:
1168: APIRET APIENTRY DosDynamicTrace(ULONG lCmd, PBYTE preqUser, PBYTE presUser);
1169:
1170: #endif /* INCL_DOSMISC */
1171:
1172:
1173: /*** Session manager support */
1174:
1175: #ifdef INCL_DOSSESMGR
1176:
1177: typedef struct _STARTDATA { /* stdata */
1178: USHORT Length;
1179: USHORT Related;
1180: USHORT FgBg;
1181: USHORT TraceOpt;
1182: PSZ PgmTitle;
1183: PSZ PgmName;
1184: PBYTE PgmInputs;
1185: PBYTE TermQ;
1186: PBYTE Environment;
1187: USHORT InheritOpt;
1188: USHORT SessionType;
1189: PSZ IconFile;
1190: ULONG PgmHandle;
1191: USHORT PgmControl;
1192: USHORT InitXPos;
1193: USHORT InitYPos;
1194: USHORT InitXSize;
1195: USHORT InitYSize;
1196: USHORT Reserved;
1197: PSZ ObjectBuffer;
1198: ULONG ObjectBuffLen;
1199: } STARTDATA;
1200: typedef STARTDATA *PSTARTDATA;
1201:
1202: #define SSF_RELATED_INDEPENDENT 0
1203: #define SSF_RELATED_CHILD 1
1204:
1205: #define SSF_FGBG_FORE 0
1206: #define SSF_FGBG_BACK 1
1207:
1208: #define SSF_TRACEOPT_NONE 0
1209: #define SSF_TRACEOPT_TRACE 1
1210: #define SSF_TRACEOPT_TRACEALL 2
1211:
1212: #define SSF_INHERTOPT_SHELL 0
1213: #define SSF_INHERTOPT_PARENT 1
1214:
1215: /* note that these types are identical to those in pmshl.h for PROG_* */
1216: #define SSF_TYPE_DEFAULT 0
1217: #define SSF_TYPE_FULLSCREEN 1
1218: #define SSF_TYPE_WINDOWABLEVIO 2
1219: #define SSF_TYPE_PM 3
1220: #define SSF_TYPE_VDM 4
1221: #define SSF_TYPE_GROUP 5
1222: #define SSF_TYPE_DLL 6
1223: #define SSF_TYPE_WINDOWEDVDM 7
1224: #define SSF_TYPE_PDD 8
1225: #define SSF_TYPE_VDD 9
1226:
1227: /* note that these flags are identical to those in pmshl.h for SHE_* */
1228: #define SSF_CONTROL_VISIBLE 0x0000
1229: #define SSF_CONTROL_INVISIBLE 0x0001
1230: #define SSF_CONTROL_MAXIMIZE 0x0002
1231: #define SSF_CONTROL_MINIMIZE 0x0004
1232: #define SSF_CONTROL_NOAUTOCLOSE 0x0008
1233: #define SSF_CONTROL_SETPOS 0x8000
1234:
1235: typedef struct _STATUSDATA { /* stsdata */
1236: USHORT Length;
1237: USHORT SelectInd;
1238: USHORT BondInd;
1239: } STATUSDATA;
1240: typedef STATUSDATA *PSTATUSDATA;
1241:
1242: /* XLATOFF */
1243: #define DosQAppType DosQueryAppType
1244: /* XLATON */
1245:
1246: APIRET APIENTRY DosStartSession(PSTARTDATA psd, PULONG pidSession, PPID ppid);
1247:
1248: APIRET APIENTRY DosSetSession(ULONG idSession, PSTATUSDATA psd);
1249:
1250: APIRET APIENTRY DosSelectSession(ULONG idSession);
1251:
1252: APIRET APIENTRY DosStopSession(ULONG scope, ULONG idSession);
1253:
1254: APIRET APIENTRY DosQueryAppType(PSZ pszName, PULONG pFlags);
1255:
1256: #endif /* INCL_DOSSESMGR */
1257:
1258: #if (defined(INCL_DOSSESMGR) || defined(INCL_DOSFILEMGR))
1259:
1260: /* AppType returned in by DosQueryAppType in pFlags as follows */
1261: #define FAPPTYP_NOTSPEC 0x0000
1262: #define FAPPTYP_NOTWINDOWCOMPAT 0x0001
1263: #define FAPPTYP_WINDOWCOMPAT 0x0002
1264: #define FAPPTYP_WINDOWAPI 0x0003
1265: #define FAPPTYP_BOUND 0x0008
1266: #define FAPPTYP_DLL 0x0010
1267: #define FAPPTYP_DOS 0x0020
1268: #define FAPPTYP_PHYSDRV 0x0040 /* physical device driver */
1269: #define FAPPTYP_VIRTDRV 0x0080 /* virtual device driver */
1270: #define FAPPTYP_PROTDLL 0x0100 /* 'protected memory' dll */
1271: #define FAPPTYP_32BIT 0x4000
1272: #define FAPPTYP_EXETYPE FAPPTYP_WINDOWAPI
1273:
1274: #define FAPPTYP_RESERVED ~(FAPPTYP_WINDOWAPI | FAPPTYP_BOUND | FAPPTYP_DLL | FAPPTYP_DOS | FAPPTYP_PHYSDRV | FAPPTYP_VIRTDRV | FAPPTYP_PROTDLL | FAPPTYP_32BIT)
1275:
1276: #ifdef INCL_DOSFILEMGR
1277:
1278: #define EAT_APPTYP_PMAPI 0x00 /* Uses PM API */
1279: #define EAT_APPTYP_DOS 0x01 /* DOS APP */
1280: #define EAT_APPTYP_PMW 0x02 /* Window compatible */
1281: #define EAT_APPTYP_NOPMW 0x03 /* Not Window compatible */
1282: #define EAT_APPTYP_EXETYPE 0x03 /* EXE type mask */
1283: #define EAT_APPTYP_RESERVED ~(EAT_APPTYP_EXETYPE)
1284:
1285: #endif /* INCL_DOSFILEMGR */
1286:
1287: #endif /* INCL_DOSSESMGR || INCL_DOSFILEMGR */
1288:
1289:
1290: /*** Device support */
1291:
1292: #ifdef INCL_DOSDEVICES
1293:
1294: /* XLATOFF */
1295: #define DosDevIOCtl2 DosDevIOCtl
1296: /* XLATON */
1297:
1298: APIRET APIENTRY DosDevConfig(PVOID pdevinfo, ULONG item);
1299: #define DEVINFO_PRINTER 0 /* Number of printers attached */
1300: #define DEVINFO_RS232 1 /* Number of RS232 ports */
1301: #define DEVINFO_FLOPPY 2 /* Number of diskette drives */
1302: #define DEVINFO_COPROCESSOR 3 /* Presence of math coprocessor */
1303: #define DEVINFO_SUBMODEL 4 /* PC Submodel Type */
1304: #define DEVINFO_MODEL 5 /* PC Model Type */
1305: #define DEVINFO_ADAPTER 6 /* Primary display adapter type */
1306: #define DEVINFO_COPROCESSORTYPE 7 /* Type of coprocessor functionality */
1307:
1308: APIRET APIENTRY DosDevIOCtl(HFILE hDevice, ULONG category, ULONG function, PVOID pParams, ULONG cbParmLenMax, PULONG pcbParmLen, PVOID pData, ULONG cbDataLenMax, PULONG pcbDataLen);
1309:
1310:
1311: APIRET APIENTRY DosPhysicalDisk(ULONG function, PVOID pBuf, ULONG cbBuf, PVOID pParams, ULONG cbParams);
1312: #define INFO_COUNT_PARTITIONABLE_DISKS 1 /* # of partitionable disks */
1313: #define INFO_GETIOCTLHANDLE 2 /* Obtain handle */
1314: #define INFO_FREEIOCTLHANDLE 3 /* Release handle */
1315:
1316: #endif /* INCL_DOSDEVICES */
1317:
1318:
1319: /*** DosNamedPipes API Support */
1320:
1321: #ifdef INCL_DOSNMPIPES
1322:
1323: /*** Data structures used with named pipes ***/
1324:
1325: typedef SHANDLE HPIPE; /* hp */
1326: typedef HPIPE *PHPIPE;
1327:
1328: typedef struct _AVAILDATA { /* AVAILDATA */
1329: USHORT cbpipe; /* bytes left in the pipe */
1330: USHORT cbmessage; /* bytes left in the current message */
1331: } AVAILDATA;
1332: typedef AVAILDATA FAR *PAVAILDATA;
1333:
1334: typedef struct _PIPEINFO { /* nmpinf */
1335: USHORT cbOut; /* length of outgoing I/O buffer */
1336: USHORT cbIn; /* length of incoming I/O buffer */
1337: BYTE cbMaxInst; /* maximum number of instances */
1338: BYTE cbCurInst; /* current number of instances */
1339: BYTE cbName; /* length of pipe name */
1340: CHAR szName[1]; /* start of name */
1341: } PIPEINFO;
1342: typedef PIPEINFO FAR *PPIPEINFO;
1343:
1344: typedef struct _PIPESEMSTATE { /* nmpsmst */
1345: BYTE fStatus; /* type of record, 0 = EOI, 1 = read ok, */
1346: /* 2 = write ok, 3 = pipe closed */
1347: BYTE fFlag; /* additional info, 01 = waiting thread */
1348: USHORT usKey; /* user's key value */
1349: USHORT usAvail; /* available data/space if status = 1/2 */
1350: } PIPESEMSTATE;
1351: typedef PIPESEMSTATE FAR *PPIPESEMSTATE;
1352:
1353: #define NP_INDEFINITE_WAIT -1
1354: #define NP_DEFAULT_WAIT 0L
1355:
1356: /* DosPeekNmPipe() pipe states */
1357:
1358: #define NP_STATE_DISCONNECTED 0x0001
1359: #define NP_STATE_LISTENING 0x0002
1360: #define NP_STATE_CONNECTED 0x0003
1361: #define NP_STATE_CLOSING 0x0004
1362:
1363: /* DosCreateNPipe open modes */
1364:
1365: #define NP_ACCESS_INBOUND 0x0000
1366: #define NP_ACCESS_OUTBOUND 0x0001
1367: #define NP_ACCESS_DUPLEX 0x0002
1368: #define NP_INHERIT 0x0000
1369: #define NP_NOINHERIT 0x0080
1370: #define NP_WRITEBEHIND 0x0000
1371: #define NP_NOWRITEBEHIND 0x4000
1372:
1373: /* DosCreateNPipe and DosQueryNPHState state */
1374:
1375: #define NP_READMODE_BYTE 0x0000
1376: #define NP_READMODE_MESSAGE 0x0100
1377: #define NP_TYPE_BYTE 0x0000
1378: #define NP_TYPE_MESSAGE 0x0400
1379: #define NP_END_CLIENT 0x0000
1380: #define NP_END_SERVER 0x4000
1381: #define NP_WAIT 0x0000
1382: #define NP_NOWAIT 0x8000
1383: #define NP_UNLIMITED_INSTANCES 0x00FF
1384:
1385: /* XLATOFF */
1386: #define DosCallNmPipe DosCallNPipe
1387: #define DosConnectNmPipe DosConnectNPipe
1388: #define DosDisConnectNmPipe DosDisConnectNPipe
1389: #define DosMakeNmPipe DosCreateNPipe
1390: #define DosPeekNmPipe DosPeekNPipe
1391: #define DosQNmPHandState DosQueryNPHState
1392: #define DosQNmPipeInfo DosQueryNPipeInfo
1393: #define DosQNmPipeSemState DosQueryNPipeSemState
1394: #define DosRawReadNmPipe DosRawReadNPipe
1395: #define DosRawWriteNmPipe DosRawWriteNPipe
1396: #define DosSetNmPHandState DosSetNPHState
1397: #define DosSetNmPipeSem DosSetNPipeSem
1398: #define DosTransactNmPipe DosTransactNPipe
1399: #define DosWaitNmPipe DosWaitNPipe
1400: /* XLATON */
1401:
1402: APIRET APIENTRY DosCallNPipe(PSZ pszName, PVOID pInbuf, ULONG cbIn, PVOID pOutbuf, ULONG cbOut, PULONG pcbActual, ULONG msec);
1403:
1404: APIRET APIENTRY DosConnectNPipe(HPIPE hpipe);
1405:
1406: APIRET APIENTRY DosDisConnectNPipe(HPIPE hpipe);
1407:
1408: APIRET APIENTRY DosCreateNPipe(PSZ pszName, PHPIPE pHpipe, ULONG openmode, ULONG pipemode, ULONG cbInbuf, ULONG cbOutbuf, ULONG msec);
1409:
1410: APIRET APIENTRY DosPeekNPipe(HPIPE hpipe, PVOID pBuf, ULONG cbBuf, PULONG pcbActual, PAVAILDATA pAvail, PULONG pState);
1411:
1412: APIRET APIENTRY DosQueryNPHState(HPIPE hpipe, PULONG pState);
1413:
1414: APIRET APIENTRY DosQueryNPipeInfo(HPIPE hpipe, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
1415:
1416: APIRET APIENTRY DosQueryNPipeSemState(HSEM hsem, PPIPESEMSTATE pnpss, ULONG cbBuf);
1417:
1418: APIRET APIENTRY DosRawReadNPipe(PSZ pszName, ULONG cb, PULONG pLen, PVOID pBuf);
1419:
1420: APIRET APIENTRY DosRawWriteNPipe(PSZ pszName, ULONG cb);
1421:
1422: APIRET APIENTRY DosSetNPHState(HPIPE hpipe, ULONG state);
1423:
1424: APIRET APIENTRY DosSetNPipeSem(HPIPE hpipe, HSEM hsem, ULONG key);
1425:
1426: APIRET APIENTRY DosTransactNPipe(HPIPE hpipe, PVOID pOutbuf, ULONG cbOut, PVOID pInbuf, ULONG cbIn, PULONG pcbRead);
1427:
1428: APIRET APIENTRY DosWaitNPipe(PSZ pszName, ULONG msec);
1429:
1430: /* values in fStatus */
1431: #define NPSS_EOI 0 /* End Of Information */
1432: #define NPSS_RDATA 1 /* read data available */
1433: #define NPSS_WSPACE 2 /* write space available */
1434: #define NPSS_CLOSE 3 /* pipe in CLOSING state */
1435:
1436: /* values in npss_flag */
1437: #define NPSS_WAIT 0x01 /* waiting thread on end of pipe */
1438:
1439: /* defined bits in pipe mode */
1440: #define NP_NBLK 0x8000 /* non-blocking read/write */
1441: #define NP_SERVER 0x4000 /* set if server end */
1442: #define NP_WMESG 0x0400 /* write messages */
1443: #define NP_RMESG 0x0100 /* read as messages */
1444: #define NP_ICOUNT 0x00FF /* instance count field */
1445:
1446:
1447: /* Named pipes may be in one of several states depending on the actions
1448: * that have been taken on it by the server end and client end. The
1449: * following state/action table summarizes the valid state transitions:
1450: *
1451: * Current state Action Next state
1452: *
1453: * <none> server DosMakeNmPipe DISCONNECTED
1454: * DISCONNECTED server connect LISTENING
1455: * LISTENING client open CONNECTED
1456: * CONNECTED server disconn DISCONNECTED
1457: * CONNECTED client close CLOSING
1458: * CLOSING server disconn DISCONNECTED
1459: * CONNECTED server close CLOSING
1460: * <any other> server close <pipe deallocated>
1461: *
1462: * If a server disconnects his end of the pipe, the client end will enter a
1463: * special state in which any future operations (except close) on the file
1464: * descriptor associated with the pipe will return an error.
1465: */
1466:
1467: /*
1468: * Values for named pipe state
1469: */
1470:
1471: #define NP_DISCONNECTED 1 /* after pipe creation or Disconnect */
1472: #define NP_LISTENING 2 /* after DosNmPipeConnect */
1473: #define NP_CONNECTED 3 /* after Client open */
1474: #define NP_CLOSING 4 /* after Client or Server close */
1475:
1476:
1477: #endif /* INCL_DOSNMPIPES */
1478:
1479: /*** DosProfile API support */
1480:
1481: #ifdef INCL_DOSPROFILE
1482:
1483: /* DosProfile ordinal number */
1484:
1485: #define PROF_ORDINAL 133
1486:
1487: /* DosProfile usType */
1488:
1489: #define PROF_SYSTEM 0
1490: #define PROF_USER 1
1491: #define PROF_USEDD 2
1492: #define PROF_KERNEL 4
1493: #define PROF_VERBOSE 8
1494: #define PROF_ENABLE 16
1495:
1496: /* DosProfile usFunc */
1497:
1498: #define PROF_ALLOC 0
1499: #define PROF_CLEAR 1
1500: #define PROF_ON 2
1501: #define PROF_OFF 3
1502: #define PROF_DUMP 4
1503: #define PROF_FREE 5
1504:
1505: /* DosProfile tic count granularity (DWORD) */
1506:
1507: #define PROF_SHIFT 2
1508:
1509: /* DosProfile module name string length */
1510:
1511: #define PROF_MOD_NAME_SIZE 10
1512:
1513: /* DosProfile error code for end of data */
1514:
1515: #define PROF_END_OF_DATA 13
1516:
1517: #endif /* INCL_DOSPROFILE */
1518:
1519:
1520: /*** Virtual DOS Machine API support */
1521:
1522: #ifdef INCL_DOSMVDM
1523:
1524: typedef LHANDLE HVDD; /* hvdd */
1525: typedef HVDD FAR *PHVDD; /* phvdd */
1526:
1527: APIRET APIENTRY DosOpenVDD(PSZ pszVDD, PHVDD phvdd);
1528:
1529: APIRET APIENTRY DosRequestVDD(HVDD hvdd, SGID sgid, ULONG cmd,
1530: ULONG cbInput, PVOID pInput,
1531: ULONG cbOutput, PVOID pOutput);
1532:
1533: APIRET APIENTRY DosCloseVDD(HVDD hvdd);
1534:
1535: APIRET APIENTRY DosQueryDOSProperty(SGID sgid, PSZ pszName,
1536: ULONG cb, PSZ pch);
1537:
1538: APIRET APIENTRY DosSetDOSProperty(SGID sgid, PSZ pszName,
1539: ULONG cb, PSZ pch);
1540: #endif /* INCL_DOSMVDM */
1541:
1542:
1543: /* The following #else/#endif corresponds to a #if near the top of this */
1544: /* file. The next three lines include the 16-bit version of this file, */
1545: /* hence these lines MUST be the last lines in this include file. */
1546: #else /* not INCL_32 */
1547:
1548: #ifdef INCL_16
1549: #include <bsedos16.h>
1550: #endif /* INCL_16 */
1551:
1552: #endif /* INCL_32 */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.