WinMM/MMSystem & registry

Eric Pouech Eric.Pouech at
Fri Mar 2 15:03:08 CST 2001

I'm currently investigating moving all multimedia setup into the registry
as current WINMM/MMSYSTEM implementation is rather close to the WIN3.x/9x model, I started looking at their native implementation.
The main goal is to use no longer the hard coded drivers name, but rather get them from the registry

basically, it goes like this:
 * The Windows registry settings are as follows:
 *	- the drivers are defined by sets, each set has an index
 *	- the sets are loaded in the set index increasing order
 *	- a set is divided by classes (wave, midi...), and several drivers can be
 *	  defined in each class
 *	- the keys are spread into two locations:
 * HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\MEDIA\%idx%\Drivers\%class%\%name%
 *		where	%idx% is the set index, 
 *			%class% is the class (midi, wave...)
 *			%name% is the name of the device (which can be different from
 *				the actual name of a the driver's filename (even if, 
 *				in lots of cases it's the same))
 *	  these keys mainly describe what to load, and in which order
 *	  This key shall also contain some configuration options for the driver (if
 *	  needed...)
 *	- each entry under the Services\Class has a corresponding entry in another part
 *	  of the registry
 * HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\MediaResources\%class%\%namen%<%idx%>
 *	  Under this location is stored information regarding how to load the
 *	  driver (like if it's enabled, PnP information...)
there are some other keys (like the PnP devices enumeration) which use the index to
refer to the driver

implementing this under Wine is not too difficult. The hairy part is the configuration (setting up the keys in the registry)
since the first step of the configuration (for this scheme) is to get the first unused index, this can be a bit tricky (especially
when a registry exists, and has been copied from a native one)

the possible solutions are:
A/ implement this mechanism and provide an ad hoc tool for this purpose. The hard part is, in some cases, that the data to add to
the registry have to be determined at installation time: the number of DSP available for the wave output, or the list of MIDI
playback devices (synthesizer, midi out...) - current WineOSS implementation gets its name from the kernel -.
	A1/ create a specific (winelib) tool to take care of it
	A2/ make use of Windows installation capabilities (setup API) and provide a .INF file for each. I'm not quite sure that's feasible
with the semantics of the API (mainly for the naming issue described above)
B/ do not implement this mechanism
	B1/ provide a Wine specific easy set of keys
	B2/ same as above, but upon startup, Wine (or winmm/mmsystem) partially recreates the native keys as needed

I'd rather go the A1 or B1. As of today, the only drawback of B1 is that some native DLLs (multimedia control panel, the midi
mapper) will not work. I haven't (yet) run against a program using this poorly undocumented set of features (which, of course, will
not work on Win2k with WDM in place).

any comment is welcome.

Eric Pouech (
"The future will be better tomorrow", Vice President Dan Quayle

More information about the wine-devel mailing list