mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
- Change service type of RosAudioSrv to automatically start when an audio adapter is installed
- Also start RosAudioSrv svn path=/trunk/; revision=39776
This commit is contained in:
parent
586e8ccb95
commit
be75d0f7aa
1 changed files with 20 additions and 0 deletions
|
@ -165,6 +165,7 @@ MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
|
|||
HINF hInf;
|
||||
PVOID Context;
|
||||
BOOL Result;
|
||||
SC_HANDLE hSCManager, hService;
|
||||
|
||||
if (!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_SOUND) &&
|
||||
!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_MEDIA))
|
||||
|
@ -223,6 +224,25 @@ MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
|
|||
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;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue