Author: janderwald
Date: Sun Mar 22 11:27:52 2015
New Revision: 66853
URL:
http://svn.reactos.org/svn/reactos?rev=66853&view=rev
Log:
[SYSAUDIO][KMIXER]
- convert to pnp software device
Modified:
trunk/reactos/drivers/wdm/audio/filters/kmixer/kmixer.c
trunk/reactos/drivers/wdm/audio/sysaudio/main.c
trunk/reactos/media/inf/wdmaudio.inf
Modified: trunk/reactos/drivers/wdm/audio/filters/kmixer/kmixer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/filters/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/filters/kmixer/kmixer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/filters/kmixer/kmixer.c [iso-8859-1] Sun Mar 22
11:27:52 2015
@@ -40,13 +40,15 @@
NTSTATUS
NTAPI
-KMix_InstallDevice(
- IN PDRIVER_OBJECT DriverObject)
+KMix_AddDevice(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT PhysicalDeviceObject)
{
NTSTATUS Status;
UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\kmixer");
PDEVICE_OBJECT DeviceObject;
PKMIXER_DEVICE_EXT DeviceExtension;
+ PDEVICE_OBJECT NextDeviceObject;
DPRINT1("KMix_InstallDevice called\n");
@@ -80,8 +82,12 @@
/* set io flags */
DeviceObject->Flags |= DO_DIRECT_IO | DO_POWER_PAGABLE;
+
/* clear initializing flag */
DeviceObject->Flags &= ~ DO_DEVICE_INITIALIZING;
+
+ NextDeviceObject = IoAttachDeviceToDeviceStack(DeviceObject, PhysicalDeviceObject);
+ KsSetDevicePnpAndBaseObject(DeviceExtension->KsDeviceHeader, NextDeviceObject,
DeviceObject);
DPRINT("KMix_InstallDevice result %x\n", Status);
return STATUS_SUCCESS;
@@ -110,6 +116,7 @@
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = KsDefaultForwardIrp;
DriverObject->MajorFunction[IRP_MJ_PNP] = KMix_Pnp;
DriverObject->DriverUnload = KMix_Unload;
+ DriverObject->DriverExtension->AddDevice = KMix_AddDevice;
- return KMix_InstallDevice(DriverObject);
+ return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/wdm/audio/sysaudio/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] Sun Mar 22 11:27:52 2015
@@ -131,17 +131,17 @@
NTSTATUS
NTAPI
-SysAudio_InstallDevice(
- IN PDRIVER_OBJECT DriverObject)
+SysAudio_AddDevice(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT PhysicalDeviceObject)
{
NTSTATUS Status;
UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\sysaudio");
UNICODE_STRING SymlinkName =
RTL_CONSTANT_STRING(L"\\DosDevices\\sysaudio");
- PDEVICE_OBJECT DeviceObject;
+ PDEVICE_OBJECT DeviceObject, NextDeviceObject;
SYSAUDIODEVEXT *DeviceExtension;
-
- DPRINT("SysAudio_InstallDevice called\n");
+ DPRINT("SysAudio_AddDevice called\n");
/* Create the device */
Status = IoCreateDevice(DriverObject,
@@ -160,7 +160,7 @@
}
/* Register device interfaces */
- Status = SysAudioRegisterDeviceInterfaces(DeviceObject);
+ Status = SysAudioRegisterDeviceInterfaces(PhysicalDeviceObject);
if (!NT_SUCCESS(Status))
{
/* Failed to register
@@ -215,6 +215,10 @@
/* clear initializing flag */
DeviceObject->Flags &= ~ DO_DEVICE_INITIALIZING;
+ /* atttach to device stack */
+ NextDeviceObject = IoAttachDeviceToDeviceStack(DeviceObject, PhysicalDeviceObject);
+ KsSetDevicePnpAndBaseObject(DeviceExtension->KsDeviceHeader, NextDeviceObject,
DeviceObject);
+
/* register shutdown notfication */
IoRegisterShutdownNotification(DeviceObject);
@@ -259,7 +263,8 @@
/* Sysaudio needs to do work on pnp, so handle it */
DriverObject->MajorFunction[IRP_MJ_PNP] = SysAudio_Pnp;
DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = SysAudio_Shutdown;
-
- /* Call our initialization function */
- return SysAudio_InstallDevice(DriverObject);
-}
+ DriverObject->DriverExtension->AddDevice = SysAudio_AddDevice;
+
+ /* done */
+ return STATUS_SUCCESS;
+}
Modified: trunk/reactos/media/inf/wdmaudio.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/wdmaudio.inf?rev…
==============================================================================
--- trunk/reactos/media/inf/wdmaudio.inf [iso-8859-1] (original)
+++ trunk/reactos/media/inf/wdmaudio.inf [iso-8859-1] Sun Mar 22 11:27:52 2015
@@ -25,8 +25,8 @@
ExcludeFromSelect = WDMAUDIO_CopyFilesOnlyId
[GenericMfg]
-;%WDM_KMIXER.DeviceDesc% = WDM_KMIXER, SW\{B7EAFDC0-A680-11D0-96D8-00AA0051E51D}
-;%WDM_SYSAUDIO.DeviceDesc% = WDM_SYSAUDIO, SW\{A7C7A5B0-5AF3-11D1-9CED-00A024BF0407}
+%WDM_KMIXER.DeviceDesc% = WDM_KMIXER, SW\{B7EAFDC0-A680-11D0-96D8-00AA0051E51D}
+%WDM_SYSAUDIO.DeviceDesc% = WDM_SYSAUDIO, SW\{A7C7A5B0-5AF3-11D1-9CED-00A024BF0407}
%WDM_WDMAUD.DeviceDesc% = WDM_WDMAUD, SW\{CD171DE3-69E5-11D2-B56D-0000F8754380}
;%WDM_DRMKAUD.DeviceDesc% = WDM_DRMKAUD, SW\{EEC12DB6-AD9C-4168-8658-B03DAEF417FE}
@@ -51,11 +51,11 @@
[DeviceRegistration]
; Kmixer swenum install
-;HKLM,%RunOnce%,"WDM_KMIXER0",,"rundll32.exe
streamci.dll,StreamingDeviceSetup
%WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_MIXER%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"
-;HKLM,%RunOnce%,"WDM_KMIXER1",,"rundll32.exe
streamci.dll,StreamingDeviceSetup
%WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_AUDIO%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"
+HKLM,%RunOnce%,"WDM_KMIXER0",,"rundll32.exe
streamci.dll,StreamingDeviceSetup
%WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_MIXER%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"
+HKLM,%RunOnce%,"WDM_KMIXER1",,"rundll32.exe
streamci.dll,StreamingDeviceSetup
%WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_AUDIO%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"
; Sysaudio swenum install
-;HKLM,%RunOnce%,"WDM_SYSAUDIO",,"rundll32.exe
streamci.dll,StreamingDeviceSetup
%WDM_SYSAUDIO.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_SYSAUDIO%,%17%\WDMAUDIO.inf,WDM_SYSAUDIO.Interface.Install"
+HKLM,%RunOnce%,"WDM_SYSAUDIO",,"rundll32.exe
streamci.dll,StreamingDeviceSetup
%WDM_SYSAUDIO.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_SYSAUDIO%,%17%\WDMAUDIO.inf,WDM_SYSAUDIO.Interface.Install"
; WDMAud install
HKLM,%RunOnce%,"WDM_WDMAUD",,"rundll32.exe
streamci.dll,StreamingDeviceSetup
%WDM_WDMAUD.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_WDMAUD%,%17%\WDMAUDIO.inf,WDM_WDMAUD.Interface.Install"