IOProc callback function
The IOProc function accesses a unique storage system, such as a database or file archive. You can install or remove this callback function by using the mmioInstallIOProc function.
IOProc is a placeholder for the application-defined function name. The actual name must be exported by including it in an EXPORTS statement in the application's module-definition file.
Syntax
LRESULT CALLBACK IOProc(
LPSTR lpmmioinfo,
UINT wMsg,
LPARAM lParam1,
LPARAM lParam2
);
Parameters
lpmmioinfo
Pointer to an MMIOINFO structure containing information about the open file. The I/O procedure must maintain the lDiskOffset member in this structure to indicate the file offset to the next read or write location. The I/O procedure can use the adwInfo member to store state information. The I/O procedure should not modify any other members of the MMIOINFO structure.wMsg
Message indicating the requested I/O operation. Messages that can be received include MMIOM_OPEN, MMIOM_CLOSE, MMIOM_READ, MMIOM_WRITE, and MMIOM_SEEK.lParam1
Parameter for the message.lParam2
Parameter for the message.
Return value
Returns a value that corresponds to the message specified by wMsg. If the I/O procedure does not recognize a message, it should return zero.
Remarks
The four-character code specified by the fccIOProc member of the MMIOINFO structure associated with a file identifies a file name extension for a custom storage system. When an application calls the mmioOpen function with a file name such as EXAMPLE.XYZ+ABC, the I/O procedure associated with the four-character code "XYZ" is called to open the ABC element of the file EXAMPLE.XYZ.
The mmioInstallIOProc function maintains a separate list of installed I/O procedures for each Windows application. Therefore, different applications can use the same I/O procedure identifier for different I/O procedures without conflict.
If an application calls mmioInstallIOProc more than once to register the same I/O procedure, it must call this function to remove the procedure once for each time it installed the procedure.
The mmioInstallIOProc function does not prevent an application from installing two different I/O procedures with the same identifier, or installing an I/O procedure with one of the predefined identifiers (DOS or MEM). The most recently installed procedure takes precedence, and the most recently installed procedure is the first one to be removed.
When searching for a specified I/O procedure, local procedures are searched first, then global procedures.
Requirements
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
Minimum supported server |
Windows 2000 Server [desktop apps only] |
Header |
Mmsystem.h (include Windows.h) |