From ab3175b141f4de2a916e1d2f378405b52a6a0498 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Thu, 5 Mar 2009 14:40:14 +0000 Subject: [PATCH] - Setup winmm entries for wdmaud.drv if they dont exist yet svn path=/trunk/; revision=39886 --- reactos/dll/cpl/mmsys/mmsys.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/reactos/dll/cpl/mmsys/mmsys.c b/reactos/dll/cpl/mmsys/mmsys.c index 5ec70a4aaaf..5e1bfabca1a 100644 --- a/reactos/dll/cpl/mmsys/mmsys.c +++ b/reactos/dll/cpl/mmsys/mmsys.c @@ -166,6 +166,10 @@ MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData) PVOID Context; BOOL Result; SC_HANDLE hSCManager, hService; + WCHAR WaveName[20]; + HKEY hKey; + DWORD BufferSize; + ULONG Index; if (!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_SOUND) && !IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_MEDIA)) @@ -243,6 +247,23 @@ MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData) } CloseServiceHandle(hSCManager); + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32", 0, GENERIC_READ | GENERIC_WRITE, &hKey) == ERROR_SUCCESS) + { + szBuffer[Length] = '\0'; + pBuffer = PathAddBackslashW(szBuffer); + wcscpy(pBuffer, L"system32\\wdmaud.drv"); + + for(Index = 1; Index <= 4; Index++) + { + swprintf(WaveName, L"wave%u", Index); + if (RegQueryValueExW(hKey, WaveName, 0, NULL, NULL, &BufferSize) != ERROR_MORE_DATA) + { + RegSetValueExW(hKey, WaveName, 0, REG_SZ, (LPBYTE)szBuffer, (wcslen(szBuffer)+1) * sizeof(WCHAR)); + } + } + RegCloseKey(hKey); + } + return ERROR_DI_DO_DEFAULT; }