Skip to content

Commit 77c6705

Browse files
committed
- Make sure that no duplicate wdmaud.drv audio drivers exists as winmm currently not recognizes duplicate audio driver entries
svn path=/trunk/; revision=43748
1 parent acd8b06 commit 77c6705

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

reactos/dll/cpl/mmsys/mmsys.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,26 @@ MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
435435
swprintf(WaveName, L"wave%u", Index);
436436
if (RegQueryValueExW(hKey, WaveName, 0, NULL, NULL, &BufferSize) != ERROR_MORE_DATA)
437437
{
438+
/* Store new audio driver entry */
438439
RegSetValueExW(hKey, WaveName, 0, REG_SZ, (LPBYTE)szBuffer, (wcslen(szBuffer)+1) * sizeof(WCHAR));
440+
break;
441+
}
442+
else
443+
{
444+
WCHAR Buffer[MAX_PATH];
445+
BufferSize = sizeof(Buffer);
446+
447+
if (RegQueryValueExW(hKey, WaveName, 0, NULL, (LPBYTE)Buffer, &BufferSize) == ERROR_SUCCESS)
448+
{
449+
/* Make sure the buffer is zero terminated */
450+
Buffer[MAX_PATH-1] = L'\0';
451+
452+
if (!wcsicmp(Buffer, szBuffer))
453+
{
454+
/* an entry already exists */
455+
break;
456+
}
457+
}
439458
}
440459
}
441460
RegCloseKey(hKey);

0 commit comments

Comments
 (0)