Jump to content

mmioQueryFormatCount

From EDM2

The mmioQueryFormatCount function provides the number of I/O procedures that match the specified data format.

Syntax

#define INCL_MMIOOS2
#include <os2.h>

ULONG mmioQueryFormatCount(PMMFORMATINFO pmmformatinfo, PLONG plNumFormats, ULONG ulReserved, ULONG ulFlags);

Parameters

pmmformatinfo (PMMFORMATINFO) - input
Indicates a specific IOProc that is to be queried on the basis of whether the fccIOProc field or the ulMediaType field or both are specified in the structure. If neither is set, all I/O procedures are counted (queried).
plNumFormats (PLONG) - output
Pointer to a LONG. Returns the number of formats supported.
ulReserved (ULONG) - input
Reserved for future use and must be set to zero.
ulFlags (ULONG) - input
Reserved for future use and must be set to zero.

Return Value

rc (ULONG) - returns
Return codes indicating success or type of failure:
  • MMIO_SUCCESS: If the function succeeds, 0 is returned.
  • MMIO_ERROR: The function failed for a reason different from any of the following returns in this list.
  • MMIOERR_INVALID_PARAMETER: An invalid parameter was passed.
  • MMIOERR_INTERNAL_SYSTEM: An internal system error occurred.

Remarks

An application can use this function to query the number of formats supported, and then call mmioGetFormats with the correct size of pFormatInfoList to obtain descriptive information in MMFORMATINFO structures.

Example Code

The following code illustrates how to obtain the number of IOProcs matching the specified format data.

   MMFORMATINFO mmformatinfo;
   LONG lNumFormats;
   ULONG  ulReserved = 0L;
   ULONG  ulFlags = 0L;
   ULONG  rc;
    ...

   memset( &mmformatinfo, '\0', sizeof(MMFORMATINFO) );
   mmformatinfo.ulMediaType |= MMIO_MEDIATYPE_AUDIO;
   mmformatinfo.ulStructLen = sizeof(MMFORMATINFO);

   rc = mmioQueryFormatCount( &mmformatinfo,
                              &lNumFormats,
                              ulReserved,
                              ulFlags);
   if (rc)
     /* error */
   else
    ...

Related Functions