Microsoft KB Archive/290098

= BUG: Unexpected Exceptions Occur in Wave Device Drivers =

Article ID: 290098

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Windows CE 3.0 for the Handheld PC
 * Microsoft Windows CE 2.12 for the Handheld PC
 * Microsoft Windows CE 2.11 for the Handheld PC
 * Microsoft Windows CE Platform Builder 2.11
 * Microsoft Windows CE Platform Builder 2.12
 * Microsoft Encarta Reference Suite 2001

-



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).

Keywords: kbbug kbpending KB290098

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.