Using Exclusion Routines

Drivers using soundlib.lib must define an exclusion routine that accepts input messages. The exclusion routine is called under the following circumstances:

The exclusion routine is specified as the ExclusionRoutine member of a SOUND_DEVICE_INIT structure. Exclusion messages are defined in devices.h. In sndblst.sys, the exclusion routine is called SoundExcludeRoutine and is contained in the file \src\mmedia\sndblst\driver\init.c. The function’s purpose is to implement mutual exclusion during write operations. For sndblst.sys, SoundExcludeRoutine does this by calling KeWaitForSingleObject when it receives the SoundExcludeEnter message and KeReleaseMutex when it receives SoundExcludeLeave.

For information on mutexes, see the Kernel-Mode Drivers Design Guide.