To install an I/O procedure, an IOProc entry is added to the MMPMMMIO.INI file. This is accomplished by either writing an INI change control file or writing a program using the mmioIniFileHandler function. The IOProc is installed in the IOProc table ahead of the system-provided storage system IOProcs (DOS, MEM, and CF).
The mmioInstall structure shown in the following example allows you to install an IOProc in the system. The MMPMMMIO.INI file is modified with the latest mmioInstall data when the MINSTALL program is executed.
mmioInstall = ( mmioFourCC = "fourcc" mmioDllName = "full path" mmioDllEntryPoint = "entry name" mmioFlags = "flags" mmioExtendLen = "extend length" mmioMediaType = "media type" mmioIOProcType = "file format" mmioDefExt = "default extension" )
fourcc
For example, to install the AVC audio I/O procedure, create an INI change control specifying the mmioInstall structure.
mmioInstall = ( mmioFourCC = "AVCA" mmioDllName = "$(DEST)AVCAPROC.DLL" mmioDllEntryPoint = "AVCAIOProc" mmioFlags = 0L mmioExtendLen = 16L mmioMediaType = 2L mmioIOProcType = 2L mmioDefExt = "" )
Specify the name of your INI change control file using the SSINICH keyword in the master control file (CONTROL.SCR). See CONTROL.SCR Subsystem Definition for an example of a CONTROL.SCR file and a description of the keywords. For example:
SSINICH="BASE1.SCR"
BASE1.SCR, located in the \MMOS2\INSTALL subdirectory, contains mmioInstall structure examples. You can also install an IOProc in your system by identifying the IOProc in the initialization file (MMPMMMIO.INI) using the mmioIniFileHandler function.
The following shows an example of how an application uses the mmioIniFileHandler function to install the OS/2 1.3 PM bitmap image IOProc.
#define FOURCC_OS13 mmioFOURCC( 'O', 'S', '1', '3' ) #pragma linkage( mmioIniFileHandler, system ) void main () { ULONG rc; MMINIFILEINFO mminifileinfo; mminifileinfo.fccIOProc = FOURCC_OS13; strcpy (mminifileinfo.szDLLName, "OS13PROC"); strcpy (mminifileinfo.szProcName, "OS13BITMAPIOPROC"); mminifileinfo.ulExtendLen = 16L; mminifileinfo.ulFlags = 0L; mminifileinfo.ulMediaType = MMIO_MEDIA_IMAGE; mminifileinfo.ulIOProcType = MMIO_IOPROC_FILEFORMAT; strcpy (mminifileinfo.szDefExt, ""); printf ("Installing OS/2 PM Bitmap (V1.3) IOProc\n"); rc = mmioIniFileHandler (&mminifileinfo, MMIO_INSTALLPROC); switch (rc) { case MMIO_SUCCESS: printf ("Installing Complete\n"); break; case MMIOERR_INVALID_PARAMETER: printf ("Error in this install program\n"); break; case MMIOERR_INTERNAL_SYSTEM: printf ("OS/2 MPM System Error\n"); break; case MMIOERR_NO_CORE: printf ("Memory unavailable for this IOProc\n"); break; case MMIOERR_INI_OPEN: printf ("Unable to access the OS/2 MMPMMMIO.INI file\n"); break; case MMIOERR_INVALID_FILENAME: printf ("Cannot find the file : OS13PROC.DLL\n"); break; default: printf ("Unknown error attempting to install OS/2 Bitmap V(1.3)\n"); break; } }
The advantage of installing I/O procedures in the MMPMMMIO.INI file is to achieve application transparency; I/O procedures become built-in as soon as you restart your OS/2 multimedia application. Note that the IOProc must reside in a DLL file, although more than one IOProc can reside in the DLL if necessary.