PRB: MCI Fails to Read a File Using a Custom mmio Procedure

Last reviewed: January 11, 1997
Article ID: Q155703
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 4.0
  • Microsoft Visual C++ version 4.10

SYMPTOMS

On the Windows 95 platform, the Media Control Interface (MCI) returns MMSYSTEM348 error when using a custom mmio procedure to read a wave or an avi file (device element). The text description for MMSYSTEM348 is "Cannot read this file. Make sure the file hasn't been deleted, or check your disk or network connection."

CAUSE

The value in the adwInfo[2] member of the MMIOINFO structure is used by MCIWAVE and MCIAVI drivers. Therefore, its content cannot be trusted when the custom mmio procedure is invoked to read the custom device element. The stated problem occurs when a custom mmio procedure uses adwInfo[2] to store the pointer to the data to be read.

RESOLUTION

A simple workaround is to use a static local variable to retain information between invocations of the custom procedure. For instance:

   static DWORD dwMyLocalVar;

MORE INFORMATION

MCI allows the use of a custom mmio procedure to open a wave or an avi device. When the custom procedure is invoked, the first argument is a pointer to MMIOINFO structure. One field in MMIOINFO is adwInfo. In general, a custom mmio procedure can use adwInfo for state information. However, if the custom procedure is to be used by MCI drivers, it should use other local variables to store information. Please note that this problem only occurs for 32-bit applications running on Windows 95 operating system.

REFERENCES


KBCategory: kbmm kbprg kbprb
KBSubcategory: mmio mmaudio mmvideo
Additional reference words: 4.00 kbdsd wave audio avi video
mmioInstallIOProc



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.