Author: janderwald
Date: Thu Feb 12 11:45:14 2009
New Revision: 39570
URL:
http://svn.reactos.org/svn/reactos?rev=39570&view=rev
Log:
- Implement MediaClassInstaller for GUID_DEVCLASS_SOUND (install wdmaud / sysaudio service
from audio.inf)
Modified:
trunk/reactos/dll/cpl/mmsys/mmsys.c
trunk/reactos/dll/cpl/mmsys/mmsys.rbuild
trunk/reactos/media/inf/audio.inf
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] Thu Feb 12 11:45:14 2009
@@ -18,6 +18,7 @@
#include <cpl.h>
#include <tchar.h>
#include <debug.h>
+#include <shlwapi.h>
#include "mmsys.h"
#include "resource.h"
@@ -158,7 +159,71 @@
DWORD
MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
{
- return ERROR_DI_DO_DEFAULT;
+ UINT Length;
+ LPWSTR pBuffer;
+ WCHAR szBuffer[MAX_PATH];
+ HINF hInf;
+ PVOID Context;
+ BOOL Result;
+
+ if (!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_SOUND))
+ return ERROR_DI_DO_DEFAULT;
+
+ Length = GetWindowsDirectoryW(szBuffer, MAX_PATH);
+ if (!Length || Length >= MAX_PATH - 14)
+ {
+ return ERROR_GEN_FAILURE;
+ }
+
+ pBuffer = PathAddBackslashW(szBuffer);
+ if (!pBuffer)
+ {
+ return ERROR_GEN_FAILURE;
+ }
+
+ wcscpy(pBuffer, L"inf\\audio.inf");
+
+ hInf = SetupOpenInfFileW(szBuffer,
+ NULL,
+ INF_STYLE_WIN4,
+ NULL);
+
+ if (hInf == INVALID_HANDLE_VALUE)
+ {
+ return ERROR_GEN_FAILURE;
+ }
+
+ Context = SetupInitDefaultQueueCallback(NULL);
+ if (Context == NULL)
+ {
+ SetupCloseInfFile(hInf);
+ return ERROR_GEN_FAILURE;
+ }
+
+ Result = SetupInstallFromInfSectionW(NULL,
+ hInf,
+ L"AUDIO_Inst.NT",
+ SPINST_ALL,
+ NULL,
+ NULL,
+ SP_COPY_NEWER,
+ SetupDefaultQueueCallbackW,
+ Context,
+ NULL,
+ NULL);
+
+ if (Result)
+ {
+ Result = SetupInstallServicesFromInfSectionW(hInf,
+
L"Audio_Inst.NT.Services",
+ 0);
+ }
+
+ SetupTermDefaultQueueCallback(Context);
+ SetupCloseInfFile(hInf);
+
+ return ERROR_DI_DO_DEFAULT;
+
}
DWORD
Modified: trunk/reactos/dll/cpl/mmsys/mmsys.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/mmsys.rbuild…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/mmsys.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/mmsys.rbuild [iso-8859-1] Thu Feb 12 11:45:14 2009
@@ -12,6 +12,7 @@
<library>advapi32</library>
<library>shell32</library>
<library>setupapi</library>
+ <library>shlwapi</library>
<file>mmsys.c</file>
<file>sounds.c</file>
<file>volume.c</file>
Modified: trunk/reactos/media/inf/audio.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/audio.inf?rev=39…
==============================================================================
--- trunk/reactos/media/inf/audio.inf [iso-8859-1] (original)
+++ trunk/reactos/media/inf/audio.inf [iso-8859-1] Thu Feb 12 11:45:14 2009
@@ -22,6 +22,7 @@
HKR, , , 0, %AUDIOClassName%
HKR, , EnumPropPages32,0, "MmSys.Cpl,MediaPropPageProvider"
HKR, , Icon, 0, "-51"
+HKR, , Installer32, 0, "MmSys.Cpl,MediaClassInstaller"
;-------------------------------- Audio installation
----------------------------------------