Share via


IOProc

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.

LRESULT PASCAL 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 Values

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

**  Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
**  Windows 95/98/Me:** Included in Windows 95 and later.
**  Header:** Declared in Mmsystem.h; include Windows.h.

See Also

mmioInstallIOProc, MMIOINFO, MMIOM_OPEN, MMIOM_CLOSE, MMIOM_READ, MMIOM_WRITE, MMIOM_SEEK, mmioOpen