home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Pier Shareware 6
/
The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso
/
035
/
cenvi29.zip
/
DOSCALLS.LIB
< prev
next >
Wrap
Text File
|
1994-03-08
|
4KB
|
97 lines
/*******************************************************************************
*** DosCalls.lib - This library contains wrappers functions and definitions ***
*** ver.1 used in making calls into the DosCalls dll. This ***
*** file may be #include'ed into your source file, or you ***
*** may want to improve speed and memory use by copying just ***
*** the relevant sections into your source code. ***
*******************************************************************************/
#define NO_ERROR 0 // return code from most successful DosCalls
DosSetDefaultDisk(DriveNumber) // set new drive number; 1=A, 2=B, etc...
{
#define ORD_DOS32SETDEFAULTDISK 220
return DynamicLink("doscalls",ORD_DOS32SETDEFAULTDISK,BIT32,CDECL,DriveNumber)
}
DosSleep(MilliSeconds) // suspend process for the specified milliseconds
{
#define ORD_DOS32SLEEP 229
return DynamicLink("doscalls",ORD_DOS32SLEEP,BIT32,CDECL,MilliSeconds)
}
DosGetDateTime(DateTime) // set up the DateTime blob containing the OS/2 DateTime structure
{
#define ORD_DOS32GETDATETIME 230
#define SIZEOF_DATETIME 12
undefine(DateTime)
BLObPut(DateTime,SIZEOF_DATETIME-1,0,UWORD8); // create SIZEOF_DATETIME blob
return DynamicLink("doscalls",ORD_DOS32GETDATETIME,BIT32,CDECL,DateTime)
}
DosKillProcess(ActionCode,ProcessID)
// kill specified ProcessID using action code DKP_PRECESSTREE or DKP_PROCESS
{
#define DKP_PROCESSTREE 0 // kill process and all descendents, if created by this process
#define DKP_PROCESS 1 // kill any process even if not created by this process
#define ORD_DOS32KILLPROCESS 235
return DynamicLink("doscalls",ORD_DOS32KILLPROCESS,BIT32,CDECL,ActionCode,ProcessID)
}
DosSetPriority(Scope,PriorityClass,PriorityDelta,id)
// alter the priority of a specified process and/or thread(s)
{
// Scope - The extent of the priority change:
#define PRTYS_PROCESS 0 // All the threads of any process.
#define PRTYS_PROCESSTREE 1 // All the threads of a process and any descendants. The indicated process must be
// the current process or a process created by the current process. Detached processes may not be
// specified. The indicated process may possibly have terminated.
#define PRTYS_THREAD 2 // A single thread of the current process.
// PriorityClass - Priority class of a process:
#define PRTYC_NOCHANGE 0 // No change, leave as is
#define PRTYC_IDLETIME 1 // Idle-time
#define PRTYC_REGULAR 2 // Regular
#define PRTYC_TIMECRITICAL 3 // Time-critical
#define PRTYC_FOREGROUNDSERVER 4 // Server
// PriorityDelta - Change to apply to the current base priority level of the process.
// This value must range between:
#define PRTYD_MINIMUM -31
#define PRTYD_MAXIMUM +31
// id - process or thread identifier. If zero then current process or thread
// assuming all input values are valid, call the system function
#define ORD_DOS32SETPRIORITY 236
return DynamicLink("doscalls",ORD_DOS32SETPRIORITY,BIT32,CDECL,
Scope,PriorityClass,PriorityDelta,id)
}
DosSetCurrentDir(DirName) // change current directory to DirName
{
#define ORD_DOS32SETCURRENTDIR 255
return DynamicLink("doscalls",ORD_DOS32SETCURRENTDIR,BIT32,CDECL,DirName)
}
DosBeep(Frequency,Duration) // play specified Frequency, in Hz, for specified
{ // duration, in milliseconds
#define ORD_DOS32BEEP 286
return DynamicLink("doscalls",ORD_DOS32BEEP,BIT32,CDECL,Frequency,Duration)
}
DosGetInfoBlocks(ThreadInfoBlock,ProcessInfoBlock)
// set ThreadInfoBlock and ProcessInfoBlock to point to their respective
// structures in memory. If you know these structures, then you can use
// peek() calls to get the values.
{
undefine(ThreadInfoBlock), undefine(ProcessInfoBlock);
#define ORD_DOS32GETINFOBLOCKS 312
return DynamicLink("doscalls",ORD_DOS32GETINFOBLOCKS,BIT32,CDECL,
ThreadInfoBlock,ProcessInfoBlock)
}
DosShutdown()
{
#define ORD_DOS32SHUTDOWN 415
return DynamicLink("doscalls",ORD_DOS32SHUTDOWN,BIT32,CDECL,0)
}