BUG: Unexpected Exceptions Occur in Wave Device Drivers (290098)



The information in this article applies to:

  • Microsoft Windows CE Operating System, Versions 3.0
  • Microsoft Windows CE Operating System, Versions 2.12
  • Microsoft Windows CE Operating System, Versions 2.11
  • Microsoft Windows CE Platform Builder 2.11
  • Microsoft Windows CE Platform Builder 2.12
  • Microsoft Windows CE Platform Builder 3.0

This article was previously published under Q290098

SYMPTOMS

Exceptions or erratic behavior may occur in wave device drivers.

CAUSE

The operating system may incorrectly send a WAVEFORMAT structure instead of a WAVEFORMATEX structure to the device driver.

RESOLUTION

If the wFormatTag field of the WAVEFORMATEX structure is set to WAVE_FORMAT_PCM (1), do not use the cbSize field.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

NOTES:
  • This article is intended primarily for wave device driver developers.
  • The symptoms described in this article can also be caused by other factors.
In certain situations, the Wave API will send a WODM_OPEN message to the device driver with an invalid WAVEOPENDESC structure. In particular, the lpFormat field will point to a WAVEFORMAT structure instead of a WAVEFORMATEX structure. The only difference between these two structures is that WAVEFORMATEX has an extra WORD field (cbSize) at the end that details how many extra bytes of information are appended to the structure. If the driver attempts to dereference the lpFormat pointer and examine the cbSize field for a WAVEFORMAT object, it will cause an exception if the memory following the WAVEFORMAT base structure is not committed, or it will receive invalid data.

Drivers should never examine the cbSize field without first looking at the wFormatTag field. The cbSize field is only meaningful if wFormatTag is not set to WAVE_FORMAT_PCM (1).

Modification Type:MinorLast Reviewed:8/18/2005
Keywords:kbbug kbpending KB290098