--- pmsdk/include/bsedos.h 2018/08/09 12:28:13 1.1 +++ pmsdk/include/bsedos.h 2018/08/09 12:28:35 1.1.1.2 @@ -1,11 +1,10 @@ /***************************************************************************\ * -* Module Name: OS2DOS.H +* Module Name: BSEDOS.H * * OS/2 Base Include File * -* Copyright (c) 1987 Microsoft Corporation -* Copyright (c) 1987 IBM Corporation +* Copyright (c) 1987,1989 Microsoft Corporation * ***************************************************************************** * @@ -27,7 +26,10 @@ * INCL_DOSQUEUES Queues * INCL_DOSSESMGR Session Manager Support * INCL_DOSDEVICES Device specific, ring 2 support +* INCL_DOSNMPIPES Named Pipes Support * INCL_DOSPROFILE DosProfile API +* INCL_DOSTRACE Trace support +* INCL_DOSMISC Miscellanious functions * \***************************************************************************/ @@ -49,7 +51,10 @@ #define INCL_DOSQUEUES #define INCL_DOSSESMGR #define INCL_DOSDEVICES +#define INCL_DOSNMPIPES #define INCL_DOSPROFILE +#define INCL_DOSTRACE +#define INCL_DOSMISC #endif /* INCL_DOS */ @@ -57,7 +62,7 @@ #define INCL_DOSERRORS #endif /* INCL_ERRORS */ -#if (defined(INCL_DOSPROCESS) | !defined(INCL_NOCOMMON)) +#if (defined(INCL_DOSPROCESS) || !defined(INCL_NOCOMMON)) /*** General services */ @@ -83,18 +88,18 @@ typedef struct _PIDINFO { /* pid } PIDINFO; typedef PIDINFO FAR *PPIDINFO; -typedef VOID (PASCAL FAR *PFNTHREAD)(VOID); +typedef VOID (FAR *PFNTHREAD)(VOID); USHORT APIENTRY DosCreateThread(PFNTHREAD, PTID, PBYTE); USHORT APIENTRY DosResumeThread(TID); USHORT APIENTRY DosSuspendThread(TID); -/* Action code values */ +/* DosCWait fScope code values */ #define DCWA_PROCESS 0 #define DCWA_PROCESSTREE 1 -/* Wait option values */ +/* DosCWait wait option values */ #define DCWW_WAIT 0 #define DCWW_NOWAIT 1 @@ -108,7 +113,7 @@ typedef RESULTCODES FAR *PRESULTCODES; USHORT APIENTRY DosCwait(USHORT, USHORT, PRESULTCODES, PPID, PID); USHORT APIENTRY DosSleep(ULONG); -/* codeTerminate values (also passed to ExitList routines) */ +/* DosExitList codeTerminate values (also passed to ExitList routines) */ #define TC_EXIT 0 #define TC_HARDERROR 1 @@ -117,8 +122,8 @@ USHORT APIENTRY DosSleep(ULONG); typedef VOID (PASCAL FAR *PFNEXITLIST)(USHORT); -VOID APIENTRY DosEnterCritSec(VOID); -VOID APIENTRY DosExitCritSec(VOID); +USHORT APIENTRY DosEnterCritSec(VOID); +USHORT APIENTRY DosExitCritSec(VOID); USHORT APIENTRY DosExitList(USHORT, PFNEXITLIST); /* DosExitList functions */ @@ -136,10 +141,9 @@ USHORT APIENTRY DosExecPgm(PCHAR, SHORT, #define EXEC_ASYNCRESULT 2 #define EXEC_TRACE 3 #define EXEC_BACKGROUND 4 -#define EXEC_LOAD 5 -USHORT APIENTRY DosGetPid(PPIDINFO); -USHORT APIENTRY DosGetPPid(USHORT, PUSHORT); +USHORT APIENTRY DosGetPID(PPIDINFO); +USHORT APIENTRY DosGetPPID(USHORT, PUSHORT); USHORT APIENTRY DosGetPrty(USHORT, PUSHORT, USHORT); USHORT APIENTRY DosSetPrty(USHORT, USHORT, SHORT, USHORT); @@ -157,10 +161,15 @@ USHORT APIENTRY DosSetPrty(USHORT, USHOR #define PRTYC_REGULAR 2 #define PRTYC_TIMECRITICAL 3 +/* Priority deltas */ + +#define PRTYD_MINIMUM -31 +#define PRTYD_MAXIMUM 31 + USHORT APIENTRY DosKillProcess(USHORT, PID); -#define DKP_PROCESS 0 -#define DKP_PROCESSTREE 1 +#define DKP_PROCESSTREE 0 +#define DKP_PROCESS 1 #endif /* INCL_DOSPROCESS */ @@ -248,10 +257,62 @@ USHORT APIENTRY DosGetInfoSeg(PSEL, PSEL #endif /* INCL_DOSINFOSEG */ -#if (defined(INCL_DOSFILEMGR) | !defined(INCL_NOCOMMON)) +#if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON)) /*** File manager */ +/* DosChgFilePtr() file position codes */ + +#define FILE_BEGIN 0x0000 +#define FILE_CURRENT 0x0001 +#define FILE_END 0x0002 + +/* Directory handle types */ + +#define HDIR_SYSTEM 0x0001 +#define HDIR_CREATE 0xFFFF + +/* Dosopen/DosQFHandState file attributes */ + +#define FILE_NORMAL 0x0000 +#define FILE_READONLY 0x0001 +#define FILE_HIDDEN 0x0002 +#define FILE_SYSTEM 0x0004 +#define FILE_DIRECTORY 0x0010 +#define FILE_ARCHIVED 0x0020 + +/* DosOpen() actions */ + +#define FILE_EXISTED 0x0001 +#define FILE_CREATED 0x0002 +#define FILE_TRUNCATED 0x0003 + +/* DosOpen() open flags */ + +#define FILE_OPEN 0x0001 +#define FILE_TRUNCATE 0x0002 +#define FILE_CREATE 0x0010 + +/* DosOpen/DosSetFHandState flags */ + +#define OPEN_ACCESS_READONLY 0x0000 +#define OPEN_ACCESS_WRITEONLY 0x0001 +#define OPEN_ACCESS_READWRITE 0x0002 +#define OPEN_SHARE_DENYREADWRITE 0x0010 +#define OPEN_SHARE_DENYWRITE 0x0020 +#define OPEN_SHARE_DENYREAD 0x0030 +#define OPEN_SHARE_DENYNONE 0x0040 +#define OPEN_FLAGS_NOINHERIT 0x0080 +#define OPEN_FLAGS_FAIL_ON_ERROR 0x2000 +#define OPEN_FLAGS_WRITE_THROUGH 0x4000 +#define OPEN_FLAGS_DASD 0x8000 + +/* DosSearchPath() constants */ + +#define SEARCH_PATH 0x0000 +#define SEARCH_CUR_DIRECTORY 0x0001 +#define SEARCH_ENVIRONMENT 0x0002 + typedef SHANDLE HFILE; /* hf */ typedef HFILE FAR *PHFILE; @@ -284,6 +345,32 @@ typedef struct _FSALLOCATE { /* fsall } FSALLOCATE; typedef FSALLOCATE FAR *PFSALLOCATE; +typedef struct _VOLUMELABEL { /* vol */ + BYTE cch; + CHAR szVolLabel[12]; +} VOLUMELABEL; +typedef VOLUMELABEL FAR *PVOLUMELABEL; + +typedef struct _FSINFO { /* fsinf */ + FDATE fdateCreation; + FTIME ftimeCreation; + VOLUMELABEL vol; +} FSINFO; +typedef FSINFO FAR *PFSINFO; + +/* HANDTYPE values */ + +#define HANDTYPE_FILE 0x00 +#define HANDTYPE_DEVICE 0x01 +#define HANDTYPE_PIPE 0x02 +#define HANDTYPE_NETWORK 0x80 + +typedef struct _FILELOCK { /* flock */ + LONG lOffset; + LONG lRange; +} FILELOCK; +typedef FILELOCK FAR *PFILELOCK; + typedef SHANDLE HDIR; /* hdir */ typedef HDIR FAR *PHDIR; @@ -300,13 +387,14 @@ USHORT APIENTRY DosWriteAsync(HFILE, PUL USHORT APIENTRY DosFindFirst(PSZ, PHDIR, USHORT, PFILEFINDBUF, USHORT, PUSHORT, ULONG); USHORT APIENTRY DosFindNext(HDIR, PFILEFINDBUF, USHORT, PUSHORT); USHORT APIENTRY DosFindClose(HDIR); +USHORT APIENTRY DosSearchPath(USHORT, PSZ, PSZ, PBYTE, USHORT); USHORT APIENTRY DosNewSize(HFILE, ULONG); USHORT APIENTRY DosBufReset(HFILE); USHORT APIENTRY DosChgFilePtr(HFILE, LONG, USHORT, PULONG); -USHORT APIENTRY DosFileLocks(HFILE, PLONG, PLONG); +USHORT APIENTRY DosFileLocks(HFILE, PFILELOCK, PFILELOCK); USHORT APIENTRY DosMove(PSZ, PSZ, ULONG); USHORT APIENTRY DosMkDir(PSZ, ULONG); @@ -319,12 +407,12 @@ USHORT APIENTRY DosQCurDir(USHORT, PBYTE USHORT APIENTRY DosQFSInfo(USHORT, USHORT, PBYTE, USHORT); USHORT APIENTRY DosSetFSInfo(USHORT, USHORT, PBYTE, USHORT); -USHORT APIENTRY DosQVerify(PUSHORT); +USHORT APIENTRY DosQVerify(PBOOL); USHORT APIENTRY DosSetVerify(USHORT); USHORT APIENTRY DosSetMaxFH(USHORT); -USHORT APIENTRY DosQFileInfo(HFILE, USHORT, PBYTE, USHORT); -USHORT APIENTRY DosSetFileInfo(HFILE, USHORT, PBYTE, USHORT); +USHORT APIENTRY DosQFileInfo(HFILE, USHORT, PFILESTATUS, USHORT); +USHORT APIENTRY DosSetFileInfo(HFILE, USHORT, PFILESTATUS, USHORT); USHORT APIENTRY DosQFileMode(PSZ, PUSHORT, ULONG); USHORT APIENTRY DosSetFileMode(PSZ, USHORT, ULONG); @@ -357,7 +445,7 @@ USHORT APIENTRY DosSetFileMode(PSZ, USHO #endif /* common INCL_DOSFILEMAN */ -#if (defined(INCL_DOSMEMMGR) | !defined(INCL_NOCOMMON)) +#if (defined(INCL_DOSMEMMGR) || !defined(INCL_NOCOMMON)) /*** Memory management */ USHORT APIENTRY DosAllocSeg(USHORT, PSEL, USHORT); @@ -369,6 +457,7 @@ USHORT APIENTRY DosSizeSeg(SEL, PULONG); /* Segment attribute flags (used with DosAllocSeg) */ +#define SEG_NONSHARED 0x0000 #define SEG_GIVEABLE 0x0001 #define SEG_GETTABLE 0x0002 #define SEG_DISCARDABLE 0x0004 @@ -397,10 +486,13 @@ USHORT APIENTRY DosSubSet(SEL, USHORT, U #endif /* INCL_DOSMEMMGR */ -#if (defined(INCL_DOSSEMAPHORES) | !defined(INCL_NOCOMMON)) +#if (defined(INCL_DOSSEMAPHORES) || !defined(INCL_NOCOMMON)) /*** Semaphore support */ +#define SEM_INDEFINITE_WAIT -1L +#define SEM_IMMEDIATE_RETURN 0L + USHORT APIENTRY DosSemClear(HSEM); USHORT APIENTRY DosSemSet(HSEM); USHORT APIENTRY DosSemWait(HSEM, LONG); @@ -470,7 +562,7 @@ USHORT APIENTRY DosFSRamSemClear(PDOSFSR #endif /* INCL_DOSSEMAPHORES */ -#if (defined(INCL_DOSDATETIME) | !defined(INCL_NOCOMMON)) +#if (defined(INCL_DOSDATETIME) || !defined(INCL_NOCOMMON)) /*** Time support */ @@ -497,8 +589,6 @@ USHORT APIENTRY DosSetDateTime(PDATETIME typedef SHANDLE HTIMER; typedef HTIMER FAR *PHTIMER; -USHORT APIENTRY DosGetTimerInt(PUSHORT); - USHORT APIENTRY DosTimerAsync(ULONG, HSEM, PHTIMER); USHORT APIENTRY DosTimerStart(ULONG, HSEM, PHTIMER); USHORT APIENTRY DosTimerStop(HTIMER); @@ -512,13 +602,13 @@ USHORT APIENTRY DosTimerStop(HTIMER); USHORT APIENTRY DosLoadModule(PSZ, USHORT, PSZ, PHMODULE); USHORT APIENTRY DosFreeModule(HMODULE); -USHORT APIENTRY DosGetProcAddr(HMODULE, PSZ, PFN FAR *); +USHORT APIENTRY DosGetProcAddr(HMODULE, PSZ, PPFN); USHORT APIENTRY DosGetModHandle(PSZ, PHMODULE); USHORT APIENTRY DosGetModName(HMODULE, USHORT, PCHAR); #endif /* INCL_DOSMODULEMGR */ -#if (defined(INCL_DOSRESOURCES) | !defined(INCL_NOCOMMON)) +#if (defined(INCL_DOSRESOURCES) || !defined(INCL_NOCOMMON)) /*** Resource support */ @@ -538,6 +628,7 @@ USHORT APIENTRY DosGetModName(HMODULE, U #define RT_VKEYTBL 12 /* key to vkey tables */ #define RT_KEYTBL 13 /* key to UGL tables */ #define RT_CHARTBL 14 /* glyph to character tables */ +#define RT_DISPLAYINFO 15 /* screen display information */ #endif /* common INCL_DOSRESOURCES */ @@ -558,6 +649,18 @@ typedef struct _COUNTRYCODE { /* ctryc * } COUNTRYCODE; typedef COUNTRYCODE FAR *PCOUNTRYCODE; +/* fsDateFmt */ + +#define DATEFMT_MM_DD_YY 0x0000 +#define DATEFMT_DD_MM_YY 0x0001 +#define DATEFMT_YY_MM_DD 0x0002 + +/* fsCurrencyFmt */ + +#define CURRENCY_FOLLOW 0x0001 +#define CURRENCY_SPACE 0x0002 +#define CURRENCY_DECIMAL 0x0004 + typedef struct _COUNTRYINFO { /* ctryi */ USHORT country; USHORT codepage; @@ -582,6 +685,7 @@ USHORT APIENTRY DosCaseMap(USHORT, PCOUN USHORT APIENTRY DosGetCollate(USHORT, PCOUNTRYCODE, PCHAR, PUSHORT); USHORT APIENTRY DosGetCp(USHORT, PUSHORT, PUSHORT); USHORT APIENTRY DosSetCp(USHORT, USHORT); +USHORT APIENTRY DosSetProcCp(USHORT, USHORT); #endif /* INCL_DOSNLS */ @@ -590,7 +694,7 @@ USHORT APIENTRY DosSetCp(USHORT, USHORT) #ifdef INCL_DOSSIGNALS -/* Signal Numbers for DosSetSigHandler */ +/* DosSetSigHandler signal numbers */ #define SIG_CTRLC 1 /* Control C */ #define SIG_BROKENPIPE 2 /* Broken Pipe */ @@ -601,11 +705,11 @@ USHORT APIENTRY DosSetCp(USHORT, USHORT) #define SIG_PFLG_C 7 /* Process Flag C */ #define SIG_CSIGNALS 8 /* number of signals plus one */ -/* Flag Numbers for DosFlagProcess */ +/* DosFlagProcess flag numbers */ -#define PFLG_A 0 /* Process Flag A */ -#define PFLG_B 1 /* Process Flag B */ -#define PFLG_C 2 /* Process Flag C */ +#define PFLG_A 0 /* Process Flag A */ +#define PFLG_B 1 /* Process Flag B */ +#define PFLG_C 2 /* Process Flag C */ /* Signal actions */ @@ -625,7 +729,7 @@ USHORT APIENTRY DosSetCp(USHORT, USHORT) #define FLGP_SUBTREE 0 #define FLGP_PID 1 -typedef VOID (FAR PASCAL *PFNSIGHANDLER)(USHORT, USHORT); +typedef VOID (PASCAL FAR *PFNSIGHANDLER)(USHORT, USHORT); USHORT APIENTRY DosSetSigHandler(PFNSIGHANDLER, PFNSIGHANDLER FAR *, PUSHORT, USHORT, USHORT); USHORT APIENTRY DosFlagProcess(PID, USHORT, USHORT, USHORT); @@ -639,9 +743,27 @@ USHORT APIENTRY DosSendSignal(USHORT, US #ifdef INCL_DOSMONITORS +#define MONITOR_DEFAULT 0x0000 +#define MONITOR_BEGIN 0x0001 +#define MONITOR_END 0x0002 + typedef SHANDLE HMONITOR; /* hmon */ typedef HMONITOR FAR *PHMONITOR; +typedef struct _MONIN { /* mnin */ + USHORT cb; + BYTE abReserved[18]; + BYTE abBuffer[108]; +} MONIN; +typedef MONIN FAR *PMONIN; + +typedef struct _MONOUT { /* mnout */ + USHORT cb; + UCHAR buffer[18]; + BYTE abBuf[108]; +} MONOUT; +typedef MONOUT FAR *PMONOUT; + USHORT APIENTRY DosMonOpen(PSZ, PHMONITOR); USHORT APIENTRY DosMonClose(HMONITOR); USHORT APIENTRY DosMonReg(HMONITOR, PBYTE, PBYTE, USHORT, USHORT); @@ -655,6 +777,41 @@ USHORT APIENTRY DosMonWrite(PBYTE, PBYTE #ifdef INCL_DOSQUEUES +/* DosCreateQueue() priority */ + +#define QUE_FIFO 0x0000 +#define QUE_LIFO 0x0001 +#define QUE_PRIORITY 0x0002 + +/* DosMakeNmPipe open modes */ + +#define PIPE_ACCESS_INBOUND 0x0000 +#define PIPE_ACCESS_OUTBOUND 0x0001 +#define PIPE_ACCESS_DUPLEX 0x0002 +#define PIPE_INHERIT 0x0000 +#define PIPE_NOINHERIT 0x0080 +#define PIPE_WRITEBEHIND 0x0000 +#define PIPE_NOWRITEBEHIND 0x4000 + +/* DosMakeNmPipe and DosQNmPHandState state */ + +#define PIPE_READMODE_BYTE 0x0000 +#define PIPE_READMODE_MESSAGE 0x0100 +#define PIPE_TYPE_BYTE 0x0000 +#define PIPE_TYPE_MESSAGE 0x0400 +#define PIPE_END_CLIENT 0x0000 +#define PIPE_END_SERVER 0x4000 +#define PIPE_WAIT 0x0000 +#define PIPE_NOWAIT 0x8000 +#define PIPE_UNLIMITED_INSTANCES 0x00FF + + +typedef struct _QUEUERESULT { /* qresc */ + PID pidProcess; + USHORT usEventCode; +} QUEUERESULT; +typedef QUEUERESULT FAR *PQUEUERESULT; + typedef SHANDLE HQUEUE; /* hq */ typedef HQUEUE FAR *PHQUEUE; @@ -662,34 +819,67 @@ USHORT APIENTRY DosMakePipe(PHFILE, PHFI USHORT APIENTRY DosCloseQueue(HQUEUE); USHORT APIENTRY DosCreateQueue(PHQUEUE, USHORT, PSZ); USHORT APIENTRY DosOpenQueue(PUSHORT, PHQUEUE, PSZ); -USHORT APIENTRY DosPeekQueue(HQUEUE, PULONG, PUSHORT, PULONG, PUSHORT, UCHAR, PBYTE, ULONG); +USHORT APIENTRY DosPeekQueue(HQUEUE, PQUEUERESULT, PUSHORT, PVOID FAR *, PUSHORT, UCHAR, PBYTE, ULONG); USHORT APIENTRY DosPurgeQueue(HQUEUE); USHORT APIENTRY DosQueryQueue(HQUEUE, PUSHORT); -USHORT APIENTRY DosReadQueue(HQUEUE, PULONG, PUSHORT, PULONG, USHORT, UCHAR, PBYTE, HSEM); +USHORT APIENTRY DosReadQueue(HQUEUE, PQUEUERESULT, PUSHORT, PVOID FAR *, USHORT, UCHAR, PBYTE, HSEM); USHORT APIENTRY DosWriteQueue(HQUEUE, USHORT, USHORT, PBYTE, UCHAR); -USHORT APIENTRY DosError(USHORT); -USHORT APIENTRY DosSetVec(USHORT, PFN, PFN); USHORT APIENTRY DosGetMessage(PCHAR FAR *, USHORT, PCHAR, USHORT, USHORT, PSZ, PUSHORT); -USHORT APIENTRY DosErrClass(USHORT, PUSHORT, PUSHORT, PUSHORT); USHORT APIENTRY DosInsMessage(PCHAR FAR *, USHORT, PSZ, USHORT, PCHAR, USHORT, PUSHORT); -USHORT APIENTRY DosPutMessage(USHORT, USHORT, PCHAR); -USHORT APIENTRY DosSysTrace(USHORT, USHORT, USHORT, PCHAR); -USHORT APIENTRY DosGetEnv(PUSHORT, PUSHORT); -USHORT APIENTRY DosScanEnv(PSZ, PSZ FAR *); -USHORT APIENTRY DosSearchPath(USHORT, PSZ, PSZ, PBYTE, USHORT); -USHORT APIENTRY DosGetVersion(PUSHORT); -USHORT APIENTRY DosGetMachineMode(PBYTE); +USHORT APIENTRY DosPutMessage(HFILE, USHORT, PCHAR); #endif /* INCL_DOSQUEUES */ +/*** Trace support */ + +#ifdef INCL_DOSTRACE + +typedef struct PTRACEBUF { /* ptrcbf */ + PID pid; + TID tid; + USHORT cmd; + USHORT value; + USHORT offv; + USHORT segv; + USHORT mte; + USHORT rAX; + USHORT rBX; + USHORT rCX; + USHORT rDX; + USHORT rSI; + USHORT rDI; + USHORT rBP; + USHORT rDS; + USHORT rES; + USHORT rIP; + USHORT rCS; + USHORT rF; + USHORT rSP; + USHORT rSS; +} PTRACEBUF; +typedef PTRACEBUF FAR *PPTRACEBUF; + +USHORT APIENTRY DosPTrace(PBYTE); + +#endif /* INCL_DOSTRACE */ /*** Session manager support */ #ifdef INCL_DOSSESMGR +/* DosQAppType() application types */ + +#define NOTSPECIFIED 0x0000 +#define NOTWINDOCOMPAT 0x0001 +#define WINDOWCOMPAT 0x0002 +#define WINDOWAPI 0x0003 +#define BOUND 0x0004 +#define DYNAMICLINK 0x0008 +#define DOSFORMAT 0x0010 + typedef struct _STARTDATA { /* stdata */ - USHORT cb; + USHORT Length; USHORT Related; USHORT FgBg; USHORT TraceOpt; @@ -710,10 +900,22 @@ typedef struct _STARTDATA { /* stdata } STARTDATA; typedef STARTDATA FAR *PSTARTDATA; +/* STATUSDATA.SelectInd constants */ + +#define TARGET_UNCHANGED 0x0000 +#define TARGET_SELECTABLE 0x0001 +#define TARGET_NOT_SELECTABLE 0x0002 + +/* STATUSDATA.BindInd constants */ + +#define BIND_UNCHANGED 0x0000 +#define BIND_CHILD 0x0001 +#define BIND_NONE 0x0002 + typedef struct _STATUSDATA { /* stsdata */ - USHORT cb; + USHORT Length; USHORT SelectInd; - USHORT BindInd; + USHORT BondInd; } STATUSDATA; typedef STATUSDATA FAR *PSTATUSDATA; @@ -722,9 +924,6 @@ USHORT APIENTRY DosSetSession(USHORT, PS USHORT APIENTRY DosSelectSession(USHORT, ULONG); USHORT APIENTRY DosStopSession(USHORT, USHORT, ULONG); USHORT APIENTRY DosQAppType(PSZ, PUSHORT); -USHORT APIENTRY DosSGNum(PUSHORT); -USHORT APIENTRY DosSGSwitch(USHORT); -USHORT APIENTRY DosSGSwitchMe(USHORT); #endif /* INCL_DOSSESMGR */ @@ -733,11 +932,27 @@ USHORT APIENTRY DosSGSwitchMe(USHORT); #ifdef INCL_DOSDEVICES +/* DosPhysicalDisk() physical disk information */ + +#define INFO_COUNT_PARTITIONABLE_DISKS 0x0001 +#define INFO_GETIOCTLHANDLE 0x0002 +#define INFO_FREEIOCTLHANDLE 0x0003 + +/* DosDevConfig information requests */ + +#define DEVINFO_PRINTER 0x0000 +#define DEVINFO_RS232 0x0001 +#define DEVINFO_FLOPPY 0x0002 +#define DEVINFO_COPROCESSOR 0x0003 +#define DEVINFO_SUBMODEL 0x0004 +#define DEVINFO_MODEL 0x0005 +#define DEVINFO_ADAPTER 0x0006 + + USHORT APIENTRY DosDevConfig(PVOID, USHORT, USHORT); USHORT APIENTRY DosDevIOCtl(PVOID, PVOID, USHORT, USHORT, HFILE); USHORT APIENTRY DosCLIAccess(VOID); -USHORT APIENTRY DosIOAccess(USHORT, USHORT, USHORT, USHORT); USHORT APIENTRY DosPortAccess(USHORT, USHORT, USHORT, USHORT); USHORT APIENTRY DosPhysicalDisk(USHORT, PBYTE, USHORT, PBYTE, USHORT); @@ -747,6 +962,55 @@ VOID APIENTRY DosCallback(PFN); #endif /* INCL_DOSDEVICES */ +/*** DosNamedPipes API Support */ + +#ifdef INCL_DOSNMPIPES + +/* DosPeekNmPipe() pipe states */ + +#define PIPE_STATE_DISCONNECTED 0x0001 +#define PIPE_STATE_LISTENING 0x0002 +#define PIPE_STATE_CONNECTED 0x0003 +#define PIPE_STATE_CLOSING 0x0004 + +/* DosMakeNmPipe constants */ + +#define PIPE_ACCESS_INBOUND 0x0000 +#define PIPE_ACCESS_OUTBOUND 0x0001 +#define PIPE_ACCESS_DUPLEX 0x0002 +#define PIPE_INHERIT 0x0000 +#define PIPE_NOINHERIT 0x0080 +#define PIPE_WRITEBEHIND 0x0000 +#define PIPE_NOWRITEBEHIND 0x4000 + +typedef struct _PIPEINFO { /* nmpinf */ + USHORT cbOut; + USHORT cbIn; + BYTE cbMaxInst; + BYTE cbCurInst; + BYTE cbName; + CHAR szName[1]; +} PIPEINFO; +typedef PIPEINFO FAR *PPIPEINFO; + +typedef SHANDLE HPIPE; /* hp */ +typedef HPIPE FAR *PHPIPE; + +USHORT APIENTRY DosCallNmPipe(PSZ, PBYTE, USHORT, PBYTE, USHORT, PUSHORT, ULONG); +USHORT APIENTRY DosConnectNmPipe(HPIPE); +USHORT APIENTRY DosDisConnectNmPipe(HPIPE); +USHORT APIENTRY DosMakeNmPipe(PSZ, PHPIPE, USHORT, USHORT, USHORT, USHORT, ULONG); +USHORT APIENTRY DosPeekNmPipe(HPIPE, PBYTE, USHORT, PUSHORT, PUSHORT, PUSHORT); +USHORT APIENTRY DosQNmPHandState(HPIPE, PUSHORT); +USHORT APIENTRY DosQNmPipeInfo(HPIPE, USHORT, PBYTE, USHORT); +USHORT APIENTRY DosQNmPipeSemState(HSEM, PBYTE, USHORT); +USHORT APIENTRY DosSetNmPHandState(HPIPE, USHORT); +USHORT APIENTRY DosSetNmPipeSem(HPIPE, HSEM, USHORT); +USHORT APIENTRY DosTransactNmPipe(HPIPE, PBYTE, USHORT, PBYTE, USHORT, PUSHORT); +USHORT APIENTRY DosWaitNmPipe(PSZ, ULONG); + +#endif /* INCL_DOSNMPIPES */ + /*** DosProfile API support */ #ifdef INCL_DOSPROFILE @@ -786,3 +1050,40 @@ VOID APIENTRY DosCallback(PFN); #define PROF_END_OF_DATA 13 #endif /* INCL_DOSPROFILE */ + +#ifdef INCL_DOSMISC + +/*** Miscelanious functions ***/ + +/* DosError() error-handling types */ + +#define HARDERROR_ENABLE 0x0001 +#define HARDERROR_DISABLE 0x0000 +#define EXCEPTION_ENABLE 0x0000 +#define EXCEPTION_DISABLE 0x0002 + +/* DosGetMachineMode() machine modes */ + +#define MODE_REAL 0x0000 +#define MODE_PROTECTED 0x0001 + +/* DosSetVec vectors */ + +#define VECTOR_DIVIDE_BY_ZERO 0x0000 +#define VECTOR_OVERFLOW 0x0004 +#define VECTOR_OUTOFBOUNDS 0x0005 +#define VECTOR_INVALIDOPCODE 0x0006 +#define VECTOR_NO_EXTENSION 0x0007 +#define VECTOR_EXTENSION_ERROR 0x0010 + + +USHORT APIENTRY DosError(USHORT); +USHORT APIENTRY DosErrClass(USHORT, PUSHORT, PUSHORT, PUSHORT); +USHORT APIENTRY DosSetVec(USHORT, PFN, PPFN); +USHORT APIENTRY DosQSysInfo(USHORT, PBYTE, USHORT); +USHORT APIENTRY DosGetEnv(PUSHORT, PUSHORT); +USHORT APIENTRY DosScanEnv(PSZ, PSZ FAR *); +USHORT APIENTRY DosGetVersion(PUSHORT); +USHORT APIENTRY DosGetMachineMode(PBYTE); + +#endif /* INCL_DOSMISC */