MMIOM_IDENTIFYFILE
Appearance
The MMIOM_IDENTIFYFILE message is sent to a Multimedia I/O (MMIO) procedure to determine if it can process and support a given file or media element. The I/O procedure inspects the file's internal layout or signature to verify compatibility rather than relying solely on the file extension.
Syntax
rc = mmioSendMessage(hmmio, MMIOM_IDENTIFYFILE, (LONG)pszFileName, (LONG)hmmio);
Parameters
- pmmioinfo (PMMIOINFO)
- A pointer to an MMIOINFO data structure maintaining the current state of the open file. This block is optional and is normally set to `NULL` unless handling structural validation exceptions.
- usMsg (USHORT)
- The message identifier, set to `MMIOM_IDENTIFYFILE`.
- lParam1 (LONG)
- An optional pointer to a null-terminated string (`pszFileName`) specifying the name of the file to be evaluated. The syntax should match the conventions defined by the mmioOpen function.
- lParam2 (LONG)
- A valid `hmmio` file handle provided by the MMIO Manager. The I/O procedure uses this handle to read and verify the file content directly instead of issuing a redundant open command.
Return Value
- rc (ULONG)
- Return codes indicating format compatibility:
- MMIO_SUCCESS: The file structure matches the format expected and supported by this I/O procedure.
- MMIO_ERROR: The file layout is not recognized or supported by this I/O procedure.
Remarks
- **Deep Inspection**: When implementing this message, an I/O procedure should inspect the file contents—such as magic numbers, standard headers, or format signatures (e.g., checking for a "RIFF" or "WAVE" chunk ID)—instead of trusting the file extension alone.
- **Pre-Open State**: Unlike typical runtime transactions, MMIOM_IDENTIFYFILE does not require that the file be formally opened via MMIOM_OPEN. The MMIO Manager dispatches this message as a probe while scanning the system's installed I/O procedures to discover which driver is the correct match for an unidentified file stream.