mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
- Make sure that no duplicate wdmaud.drv audio drivers exists as winmm currently not recognizes duplicate audio driver entries
svn path=/trunk/; revision=43748
This commit is contained in:
parent
acd8b06824
commit
77c67054c7
1 changed files with 19 additions and 0 deletions
|
@ -435,7 +435,26 @@ MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue