janderwald@svn.reactos.org
26 Feb
2009
26 Feb
'09
6:29 p.m.
Author: janderwald
Date: Thu Feb 26 21:29:15 2009
New Revision: 39775
URL:
http://svn.reactos.org/svn/reactos?rev=39775&view=rev
Log:
- Start automatically sysaudio / wdmaud when audiosrv is started
Added:
trunk/reactos/base/services/audiosrv/services.c (with props)
Modified:
trunk/reactos/base/services/audiosrv/audiosrv.h
trunk/reactos/base/services/audiosrv/audiosrv.rbuild
trunk/reactos/base/services/audiosrv/main.c
Modified: trunk/reactos/base/services/audiosrv/audiosrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
==============================================================================
--- trunk/reactos/base/services/audiosrv/audiosrv.h [iso-8859-1] (original)
+++ trunk/reactos/base/services/audiosrv/audiosrv.h [iso-8859-1] Thu Feb 26 21:29:15 2009
@@ -51,6 +51,8 @@
DWORD dwEventType,
LPVOID lpEventData);
+BOOL
+StartSystemAudioServices();
/* Debugging */
Modified: trunk/reactos/base/services/audiosrv/audiosrv.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
==============================================================================
--- trunk/reactos/base/services/audiosrv/audiosrv.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/services/audiosrv/audiosrv.rbuild [iso-8859-1] Thu Feb 26 21:29:15
2009
@@ -10,6 +10,7 @@
<file>pnp_list_manager.c</file>
<file>pnp_list_lock.c</file>
<file>pnp.c</file>
+ <file>services.c</file>
<file>debug.c</file>
<file>audiosrv.rc</file>
</module>
Modified: trunk/reactos/base/services/audiosrv/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/mai…
==============================================================================
--- trunk/reactos/base/services/audiosrv/main.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/audiosrv/main.c [iso-8859-1] Thu Feb 26 21:29:15 2009
@@ -132,6 +132,9 @@
return;
*/
}
+ /* start system audio services */
+ StartSystemAudioServices();
+
InitializeFakeDevice();
Added: trunk/reactos/base/services/audiosrv/services.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/ser…
==============================================================================
--- trunk/reactos/base/services/audiosrv/services.c (added)
+++ trunk/reactos/base/services/audiosrv/services.c [iso-8859-1] Thu Feb 26 21:29:15 2009
@@ -1,0 +1,79 @@
+/*
+ * PROJECT: ReactOS
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: base/services/audiosrv/services.c
+ * PURPOSE: Audio Service Plug and Play
+ * COPYRIGHT: Copyright 2009 Johannes Anderwald
+ */
+
+#include <windows.h>
+#include <winuser.h>
+#include <dbt.h>
+#include <setupapi.h>
+
+#include <ks.h>
+#include <ksmedia.h>
+
+#include <audiosrv/audiosrv.h>
+#include "audiosrv.h"
+
+
+BOOL
+StartSystemAudioServices()
+{
+ SC_HANDLE hSCManager, hService;
+
+ logmsg("Starting system audio services\n");
+
+ hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
+ if (!hSCManager)
+ {
+ logmsg("Failed to open service manager\n");
+ return FALSE;
+ }
+
+ hService = OpenService(hSCManager, L"sysaudio", SERVICE_ALL_ACCESS);
+ if (hService)
+ {
+ if (!StartService(hService, 0, NULL))
+ {
+ logmsg("Failed to start sysaudio service\n");
+ CloseServiceHandle(hService);
+ CloseServiceHandle(hSCManager);
+ return FALSE;
+ }
+ CloseServiceHandle(hService);
+ logmsg("Sysaudio service started\n");
+ // FIXME
+ // wait untill service is started
+ }
+
+ hService = OpenService(hSCManager, L"wdmaud", SERVICE_ALL_ACCESS);
+ if (hService)
+ {
+ if (!StartService(hService, 0, NULL))
+ {
+ logmsg("Failed to start sysaudio service\n");
+ CloseServiceHandle(hService);
+ CloseServiceHandle(hSCManager);
+ return FALSE;
+ }
+ CloseServiceHandle(hService);
+ logmsg("Wdmaud service started\n");
+ }
+
+
+ CloseServiceHandle(hSCManager);
+ return TRUE;
+}
+
+
+
+
+
+
+
+
+
+
+
Propchange: trunk/reactos/base/services/audiosrv/services.c
------------------------------------------------------------------------------
svn:eol-style = native