Control Program Functions
From EDM2
Some general information is available at Control Program page.
File Management
File Functions
- DosClose - Closes a file handle
- DosCopy - Copies a file or subdirectory
- DosDelete - Deletes a file
- DosEditName - Transforms a file name
- DosMove - Moves a file or subdirectory
- DosOpen - Gets a handle to a file, pipe, or device
- DosRead - Reads from a file, pipe, or device
- DosSetFileInfo - Sets information for an open file
- DosSetFileLocks - Locks and unlocks a range in a file
- DosSetFilePtr - Moves the position of the file pointer
- DosSetFileSize - Changes the size of a file
- DosSetPathInfo - Sets information for a file or subdirectory
- DosSetVerify - Enables write verification
- DosWrite - Writes data to a file, pipe, or device
File Handle Functions
- DosDupHandle - Duplicates a file handle
- DosQueryFHState - Gets the file handle state
- DosQueryHType - Gets the handle type
- DosSetFHState - Sets the file handle state
- DosSetMaxFH - Sets the maximum number of file handles
File Query Functions
- DosEnumAttribute - Gets the name and size of a file object's extended attributes
- DosQueryFileInfo - Gets information for an open file
- DosQueryPathInfo - Gets information for a file or subdirectory
- DosQuerySysInfo - Gets values of system variables
- DosQueryVerify - Determines whether or not write verification is enabled
Directory Search (FileFind) Functions
- DosFindClose - Ends a search for matching file objects
- DosFindFirst - Begins a search for matching file objects
- DosFindNext - Continues a search for matching file objects
Directory and Disk Functions
- DosCreateDir - Creates a subdirectory
- DosDeleteDir - Deletes an empty subdirectory
- DosQueryCurrentDir - Gets the current directory
- DosQueryCurrentDisk - Gets the current drive
- DosSetCurrentDir - Sets the current directory
- DosSetDefaultDisk - Sets the default drive
Environment and Search Path Functions
- DosScanEnv - Gets information for a file or subdirectory
- DosSearchPath - Scans environment variable
- DosQueryPathInfo - Searches along a specified path
- DosSetPathInfo - Sets information for a file or subdirectory
Extended LIBPATH Search Path Functions
- DosQueryExtLIBPATH - Queries the search path for Dynamic Link Library, which is either before or after LIBPATH search
- DosSetExtLIBPATH - Sets a search path for Dynamic Link Library, either before or after LIBPATH search
Memory Management
Memory Functions
- DosAllocMem - Allocates a private memory object within the virtual address space
- DosFreeMem - Frees a private or shared memory object from the virtual address space of the process
- DosQueryMem - Obtains information about a range of pages within the virtual address space of the subject process
- DosSetMem - Commits or decommits a range of pages within a memory object, or alters their protection
Memory Suballocation Functions
- DosSubAllocMem - Suballocates a block of memory from a heap that was previously initialized
- DosSubFreeMem - Frees a block of memory that was previously suballocated
- DosSubSetMem - Initializes a heap for suballocation, or increases the size of a previously initialized heap
- DosSubUnsetMem - Terminates the use of a heap
- DosAllocSharedMem - Allocates a shared memory object within the virtual address space
- DosGetNamedSharedMem - Obtains access to an existing named shared memory object
- DosGetSharedMem - Obtains access to an existing shared memory object
- DosGiveSharedMem - Gives a target process access to an existing shared memory object
Thread Local Memory Functions
- DosAllocThreadLocalMemory - Allocates a block of memory that is unique, or local, to a thread
- DosFreeThreadLocalMemory - Frees a block of thread-local memory
Program Execution Control
Thread Control Functions
- DosCreateThread
- DosEnterCritSec
- DosExit - Terminates thread execution in the current process
- DosExitCritSec - Enables thread switching for the current process
- DosGetInfoBlocks
- DosKillThread
- DosResumeThread
- DosSetPriority
- DosSuspendThread
- DosWaitThread
Process Control Functions
- DosExecPgm - Executes another program as a child process
- DosExitList - Defines a list of routines to be executed when the current process ends
- DosKillProcess
- DosWaitChild - Waits for a child process to end
Session Control Functions
- DosSelectSession
- DosSetSession - Sets the status of a child session
- DosStartSession - Starts an unrelated or child session
- DosStopSession - Terminates one or all child sessions
Semaphore Functions
Event Semaphore Functions
- DosCloseEventSem - Closes an event semaphore
- DosCreateEventSem - Creates an event semaphore
- DosOpenEventSem - Opens an event semaphore for use
- DosPostEventSem - Posts an event semaphore
- DosQueryEventSem
- DosResetEventSem - Resets an event semaphore
- DosWaitEventSem
Mutex Semaphore Functions
- DosCloseMutexSem
- DosCreateMutexSem
- DosOpenMutexSem
- DosQueryMutexSem
- DosReleaseMutexSem
- DosRequestMutexSem
Muxwait Semaphore Functions
- DosAddMuxWaitSem
- DosCloseMuxWaitSem
- DosCreateMuxWaitSem
- DosDeleteMuxWaitSem
- DosOpenMuxWaitSem
- DosQueryMuxWaitSem
- DosWaitMuxWaitSem - Waits for a muxwait semaphore to clear
Pipe Functions
Named-Pipe Functions
- DosCallNPipe
- DosConnectNPipe
- DosCreateNPipe - Creates a named pipe
- DosDisConnectNPipe
- DosPeekNPipe
- DosQueryNPHState
- DosQueryNPipeInfo
- DosQueryNPipeSemState
- DosSetNPHState - Resets the blocking mode and the read mode of a named pipe
- DosSetNPipeSem - Attaches a shared event semaphore to a local named pipe
- DosTransactNPipe - Writes to a duplex message pipe, then reads from it
- DosWaitNPipe - Waits for an instance of a named pipe to become available
Unnamed-Pipe Functions
- DosClose - Closes a file or pipe
- DosCreatePipe - Creates an unnamed (anonymous) pipe
- DosDupHandle, DosOpen, DosRead, DosWrite
Queue Functions
- DosCloseQueue - Closes a queue
- DosCreateQueue - Creates a queue
- DosOpenQueue - Opens a queue
- DosPeekQueue
- DosPurgeQueue
- DosQueryQueue - Returns the number of elements in a queue
- DosReadQueue
- DosWriteQueue - Writes an element to a queue
Timer Functions
- DosAsyncTimer
- DosSleep - Suspends the current thread for a specified time interval
- DosStartTimer
- DosStopTimer
Error Management Functions
- DosErrClass
- DosError - Disables and enables hard-error and exception pop-up messages
Exception Handling Functions
- DosRaiseException - Raises an exception
- DosSetExceptionHandler - Registers an exception handler
- DosUnsetExceptionHandler
- DosUnwindException
Signal Exception Functions
- DosAcknowledgeSignalException
- DosSendSignalException
- DosSetSignalExceptionFocus - Sets keyboard signal focus
Must-Complete Functions
- DosEnterMustComplete - Enters a must-complete section of code
- DosExitMustComplete - Exits a must-complete section of code
Device I/O Functions
File System Functions Used to Perform I/O to Devices:
- DosClose
- DosOpen
- DosRead
- DosWrite
Message Management Functions
- DosGetMessage
- DosInsertMessage
- DosPutMessage - Sends a message to an output file or device
- DosQueryMessageCP - Retrieves a message file list of code pages and language identifiers
Code Page Management Functions
Code Page Functions
- DosQueryCp
- DosSetProcessCp - Sets the code page of a process
Country Dependent Functions
- DosMapCase
- DosQueryCollate
- DosQueryCtryInfo
- DosQueryDBCSEnv
- DosQueryMessageCP
Debugging Functions
- DosDebug - Used by one process to control another for debugging purposes
Dynamic Linking Functions
- DosFreeModule - Frees the reference to the dynamic link module for the process
- DosLoadModule - Loads a dynamic link module, and returns a handle for the module
- DosQueryModuleHandle
- DosQueryModuleName
- DosQueryProcAddr - Returns the address of the specified procedure within a dynamic link module
Dos...
Large File System
- DosCancelLockRequestL
- DosListIOL - Performs the specified number of seek/read or seek/write operations
- DosOpenL - Opens a file
- DosProtectOpenL - Opens a file returning a protected file handle
- DosProtectSetFileLocksL - Locks and unlocks a range of an open file
- DosProtectSetFilePtrL - Moves the read or write pointer
- DosProtectSetFileSizeL - Changes the size of a file
- DosSetFileLocksL - Locks and unlocks a range of an open file
- DosSetFilePtrL - Moves the read or write pointer
- DosSetFileSizeL - Changes the size of a file
Unsorted
Date/Time
Error Management
Exception Management
File Systems/File Management
File Manipulation
- DosCancelLockRequest
- DosProtectClose
- DosForceDelete
- DosProtectOpen
- DosReplaceModule
- DosProtectRead
- DosProtectSetFileInfo
- DosProtectSetFileLocks
- DosProtectSetFilePtr
- DosProtectSetFileSize
- DosProtectWrite
File Handle Manipulation
File Querying
- DosProtectEnumAttribute
- DosQueryFileMode
- DosProtectQueryFileInfo
- DosQuerySysState
- DosPerfSysCall
- DosGetProcessorStatus
- DosSetProcessorStatus
- DosQueryABIOSSupport
File System Functions
Resource Management
Threads
VDD
Kbd, Mou, Vio
Keyboard functions
- KbdCharIn
- KbdGetConsole
- KbdPeek
- KbdStringIn
- KbdFlushBuffer
- KbdSetStatus
- KbdGetStatus
- KbdSetCp
- KbdGetCp
- KbdGetLayout
- KbdGetLayoutUni
- KbdSetLayout
- KbdSetLayoutUni
- KbdGetHWID
- KbdXlate
Mouse functions
- MouFlushQue
- MouGetPtrPos
- MouSetPtrPos
- MouSetPtrShape
- MouGetPtrShape
- MouGetDevStatus
- MouGetNumButtons
- MouGetNumMickeys
- MouReadEventQue
- MouGetNumQueEl
- MouGetEventMask
- MouSetEventMask
- MouGetScaleFact
- MouSetScaleFact
- MouRemovePtr
- MouDrawPtr
- MouSetDevStatus
- MouGetThreshold
- MouSetThreshold
Video I/O functions
- VioGetBuf
- VioGetCurPos
- VioSetCurPos
- VioGetCurType
- VioSetCurType
- VioGetMode
- VioSetMode
- VioReadCellStr
- VioReadCharStr
- VioWrtCellStr
- VioWrtCharStr
- VioScrollUp
- VioScrollDown
- VioScrollLeft
- VioScrollRight
- VioWrtNAttr
- VioWrtNCell
- VioWrtNChar
- VioWrtTTY
- VioWrtCharStrAtt
- VioShowBuf
- VioSetAnsi
- VioGetAnsi
- VioSavRedrawWait
- VioSavRedrawUndo
- VioModeWait
- VioModeUndo
- VioScrLock
- VioScrUnLock
- VioPopUp
- VioEndPopUp
- VioGetConfig
- VioGetCp
- VioSetCp
- VioGetOrigin
- VioSetOrigin
- VioGetState
- VioSetState
Advanced VIO
- VioAssociate
- VioCreateLogFont
- VioCreatePS
- VioDeleteSetId
- VioDestroyPS
- VioGetDeviceCellSize
- VioQueryFonts
- VioQuerySetIds
- VioSetDeviceCellSize
- VioShowPS
Icon Legend
- : It seems that these functions were not implemented on the OS/2 4.5 Toolkit.
- : These functions were documented on the Addendum of the OS/2 4.5 Toolkit.
- : More information is required on this function.
Legacy Functions
This are the legacy functions of the Control Program Interface API. This functions are supposed to be replaced by the newer ones, but some of these are still required for older programs to work or because some newer functions weren't implemented correctly.
Date / Time
Device I/O
Dynamic Linking Library
Monitor functions
Dynamic Link Library
Error Management
OS/2 2.0 and 1.3 only:
Exception Management
File Systems/File Management
Directory Searching
Directory
Disk
Enviroment/Path
File Manipulation
- DosChgFilePtr
- DosClose
- DosCopy
- DosDelete
- DosEditName
- DosFileLocks
- DosMove
- DosOpen
- DosOpen2
- DosRead
- DosSetFileInfo
- DosSetPathInfo
- DosSetVerify
- DosWrite
- DosNewSize
- DosSetFileMode
File Handle Manipulation
File Querying
File System Functions
Memory Management
- DosSubAlloc
- DosAllocSeg
- DosAllocShrSeg
- DosAllocHuge
- DosFreeSeg
- DosGetSeg
- DosGiveSeg
- DosLockSeg
- DosMemAvail
- DosSizeSeg
- DosUnlockSeg
- DosReallocHuge
- DosReallocSeg
Heap Memory
Message Management
National Language/Code Page
Pipes
Named Pipes
- DosCallNmPipe
- DosConnectNmPipe
- DosDisConnectNmPipe
- DosMakeNmPipe
- DosMakePipe
- DosPeekNmPipe
- DosQNmPipeInfo
- DosQNmPipeSemState
- DosSetNmPipeSem
- DosTransactNmPipe
- DosWaitNmPipe
- DosQNmPHandState
- DosSetNmPHandState
Resource Management
Semaphores
- DosCloseSem
- DosCreateSem
- DosFSRamSemClear
- DosFSRamSemRequest
- DosOpenSem
- DosSemClear
- DosSemRequest
- DosSemSet
- DosSemSetWait
- DosSemWait
- DosPMSemWait
MuxWait Semaphores
Processes/Threading
Processes
- DosEnterCritSec
- DosExecPgm
- DosExitCritSec
- DosExitList
- DosKillProcess
- DosCWait
- DosGetPID
- DosGetPPID
- DosGetInfoSeg
Session Management
Screen Group
- DosSMSwitch
- DosSMServeAppReq
- DosGetTimes
- DosSMSetTitle
- DosScrUnlock
- DosSMDoAppReq
- DosScrLock
- DosSavRedrawWait
- DosSavRedrawUndo
- DosSetMNLockTime
- DosModeUndo
- DosSMGetStatus
- DosModeWait
- DosSMTerminate
- DosSMGetAppReq
- DosSMRealPrtSc
- DosSMInitialize
- DosSMStart
- DosSMParentSwitch
- DosSMPause
- DosSMHDEInit
- DosSMPMPresent
- DosSMRegisterDD
- DosSMSysInit
- DosSMNotifyDD
- DosSMNotifyDD2
- DosSMOpenDD
- DosSMSetSessionType
- DosRegisterNotification
Quickhelp
Timer
Addressing
Spool
Not found on OS2TK45
To SORT
- DosCallback
- DosCLIAccess
- DosCreateCSAlias
- DosFileIO
- DosFindClose
- DosFlagProcess
- DosGetEnv
- DosGetHugeShift
- DosGetMachineMode
- DosSetSigHandler
- DosSetVec
- DosSMRegisterDD
- DosWriteAsync
- DosSysCtl
- DosQueryRASInfo
- DosRawReadNPipe
- DosRawWriteNPipe
Keyboard functions
- KbdCharIn
- KbdFlushBuffer
- KbdGetCp
- KbdSetCp
- KbdPeek
- KbdRegister
- KbdDeRegister
- KbdOpen
- KbdClose
- KbdGetFocus
- KbdFreeFocus
- KbdSynch
- KbdSetFgnd
- KbdGetHWId
- KbdSetHWID
- KbdSetCustXt
- KbdGetStatus
- KbdSetStatus
- KbdStringIn
- KbdXlate
- KbdInit
Mouse functions
- MouRegister
- MouDeRegister
- MouOpen
- MouClose
- MouInitReal
- MouSynch
- MouDrawPtr
- MouFlushQue
- MouGetDevStatus
- MouGetEventMask
- MouGetNumButtons
- MouGetNumMickeys
- MouGetNumQueEl
- MouGetPtrPos
- MouGetPtrShape
- MouGetScaleFact
- MouReadEventQue
- MouRemovePtr
- MouSetDevStatus
- MouSetEventMask
- MouSetPtrPos
- MouSetPtrShape
- MouSetScaleFact
- MouShellInit
- MouGetHotKey
- MouSetHotKey
- MouFree
Video I/O functions
- VioRegister
- VioGlobalReg
- VioDeRegister
- VioGetPhysBuf
- VioScrollDn
- VioScrollLf
- VioScrollRt
- VioCheckCharType
- VioPrtSc
- VioPrtScToggle
- VioRedrawSize
- VioGetFont
- VioSetFont
- VioEndPopUp
- VioGetAnsi
- VioGetBuf
- VioGetConfig
- VioGetCp
- VioGetCurPos
- VioGetCurType
- VioGetMode
- VioGetState
- VioModeUndo
- VioModeWait
- VioPopUp
- VioReadCellStr
- VioReadCharStr
- VioSavRedrawUndo
- VioSavRedrawWait
- VioScrLock
- VioScrollUp
- VioScrUnLock
- VioSetAnsi
- VioSetCp
- VioSetCurPos
- VioSetCurType
- VioSetMode
- VioSetState
- VioShowBuf
- VioWrtCellStr
- VioWrtCharStr
- VioWrtCharStrAtt
- VioWrtNAttr
- VioWrtNCell
- VioWrtNChar
- VioWrtTTY
- VioQueryConsole
Advanced VIO
Legend
- : More information is required on this function. Information was not available on CP1 or PRCP books.
References
Title | Author | Year | Document Ref. | Links |
---|---|---|---|---|
Control Program Programming Guide and Reference | IBM | 1996 | CP1.INF, CP2.INF, CP3.INF | PDF, INF 1 INF 2 INF 3 |
API Addendum Volume 1 (PowerPC Edition) | IBM | APIBAS.INF | ||
Legacy OS/2 Programming Reference | IBM | PRCP.INF |