Author: janderwald
Date: Sun Oct 25 19:22:03 2009
New Revision: 43748
URL:
http://svn.reactos.org/svn/reactos?rev=43748&view=rev
Log:
- Make sure that no duplicate wdmaud.drv audio drivers exists as winmm currently not
recognizes duplicate audio driver entries
Modified:
trunk/reactos/dll/cpl/mmsys/mmsys.c
Modified: trunk/reactos/dll/cpl/mmsys/mmsys.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/mmsys.c?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/mmsys.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/mmsys.c [iso-8859-1] Sun Oct 25 19:22:03 2009
@@ -435,7 +435,26 @@
swprintf(WaveName, L"wave%u", Index);
if (RegQueryValueExW(hKey, WaveName, 0, NULL, NULL, &BufferSize) !=
ERROR_MORE_DATA)
{
+ /* Store new audio driver entry */
RegSetValueExW(hKey, WaveName, 0, REG_SZ, (LPBYTE)szBuffer,
(wcslen(szBuffer)+1) * sizeof(WCHAR));
+ break;
+ }
+ else
+ {
+ WCHAR Buffer[MAX_PATH];
+ BufferSize = sizeof(Buffer);
+
+ if (RegQueryValueExW(hKey, WaveName, 0, NULL, (LPBYTE)Buffer,
&BufferSize) == ERROR_SUCCESS)
+ {
+ /* Make sure the buffer is zero terminated */
+ Buffer[MAX_PATH-1] = L'\0';
+
+ if (!wcsicmp(Buffer, szBuffer))
+ {
+ /* an entry already exists */
+ break;
+ }
+ }
}
}
RegCloseKey(hKey);