Author: janderwald
Date: Thu Feb 26 22:15:35 2009
New Revision: 39776
URL:
http://svn.reactos.org/svn/reactos?rev=39776&view=rev
Log:
- Change service type of RosAudioSrv to automatically start when an audio adapter is
installed
- Also start RosAudioSrv
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] Thu Feb 26 22:15:35 2009
@@ -165,6 +165,7 @@
HINF hInf;
PVOID Context;
BOOL Result;
+ SC_HANDLE hSCManager, hService;
if (!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_SOUND)
&&
!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_MEDIA))
@@ -222,6 +223,25 @@
SetupTermDefaultQueueCallback(Context);
SetupCloseInfFile(hInf);
+
+
+
+ hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
+ if (!hSCManager)
+ {
+ return ERROR_DI_DO_DEFAULT;
+ }
+
+ hService = OpenService(hSCManager, L"RosAudioSrv", SERVICE_ALL_ACCESS);
+ if (hService)
+ {
+ /* make RosAudioSrv start automatically */
+ ChangeServiceConfig(hService, SERVICE_NO_CHANGE, SERVICE_AUTO_START,
SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+ StartService(hService, 0, NULL);
+ CloseServiceHandle(hService);
+ }
+ CloseServiceHandle(hSCManager);
return ERROR_DI_DO_DEFAULT;