mmioDetermineSSIOProc
Appearance
The mmioDetermineSSIOProc function determines the storage system I/O procedure (SSIOProc) required for a media data object. It identifies the storage system based on the provided file name or information in the MMIOINFO structure.
Syntax
#define INCL_MMIOOS2 #include <os2.h> ULONG mmioDetermineSSIOProc(PSZ pszFileName, PMMIOINFO pmmioinfo, PFOURCC pfccStorageSystem, PSZ pszParsedRemainder);
Parameters
- pszFileName (PSZ) - input
- The file name of the media object to be evaluated. This parameter can be NULL if the information is provided in the `pmmioinfo` structure.
- pmmioinfo (PMMIOINFO) - input
- A pointer to an MMIOINFO structure. This structure may contain additional data needed to identify the storage system, particularly for compound-file elements that are not fully valid.
- pfccStorageSystem (PFOURCC) - in/out
- A pointer to a FOURCC variable. Upon successful completion, this field is filled with the FOURCC of the identified storage system.
- pszParsedRemainder (PSZ) - in/out
- A pointer to a buffer where the function returns the "parsed" portion of the file name. This typically includes the characters following a separator (like a compound-file delimiter).
Return Values
- rc (ULONG)
- Returns a code indicating success or failure:
- MMIO_SUCCESS: The function succeeded (0).
- MMIO_ERROR: Unable to determine the storage system FOURCC.
- MMIOERR_INVALID_PARAMETER: An invalid parameter was passed.
Detailed DOS file errors may be found in the `ulErrorRet` field of the MMIOINFO structure.
Remarks
The function follows a specific logic to identify the storage system:
- MMIOINFO Check: It first checks the `fccChildIOProc` field of the `pmmioinfo` structure. If it is not NULL, that value is returned as the storage system FOURCC.
- Filename Parsing: If no I/O procedure is specified in the structure, the function parses `pszFileName` from left to right, looking for a separator character (e.g., `+`).
- Conversion: If a separator is found, the file extension before the separator is converted to a FOURCC, and the remainder of the string (following the separator) is returned in `pszParsedRemainder`.
Example Code
The following example demonstrates how to determine the storage system and sub-element name from a compound file path string:
MMIOINFO mmioinfo;
FOURCC fccStorage;
char szRemainder[CCHMAXPATH];
ULONG rc;
/* Example path: A bundle file containing a wave element */
rc = mmioDetermineSSIOProc("DAN.BND+SUE.WAV",
&mmioinfo,
&fccStorage,
szRemainder);
if (rc == MMIO_SUCCESS) {
/* fccStorage now contains FOURCC_BND ('BND ') */
/* szRemainder now contains "SUE.WAV" */
} else {
/* Handle error */
}