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");
/* 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;
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;
}
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,
}
/* Register device interfaces */
- Status = SysAudioRegisterDeviceInterfaces(DeviceObject);
+ Status = SysAudioRegisterDeviceInterfaces(PhysicalDeviceObject);
if (!NT_SUCCESS(Status))
{
/* Failed to register
/* 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);
/* Sysaudio needs to do work on pnp, so handle it */
DriverObject->MajorFunction[IRP_MJ_PNP] = SysAudio_Pnp;
DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = SysAudio_Shutdown;
+ DriverObject->DriverExtension->AddDevice = SysAudio_AddDevice;
- /* Call our initialization function */
- return SysAudio_InstallDevice(DriverObject);
+ /* done */
+ return STATUS_SUCCESS;
}
ExcludeFromSelect = WDMAUDIO_CopyFilesOnlyId\r
\r
[GenericMfg]\r
-;%WDM_KMIXER.DeviceDesc% = WDM_KMIXER, SW\{B7EAFDC0-A680-11D0-96D8-00AA0051E51D}\r
-;%WDM_SYSAUDIO.DeviceDesc% = WDM_SYSAUDIO, SW\{A7C7A5B0-5AF3-11D1-9CED-00A024BF0407}\r
+%WDM_KMIXER.DeviceDesc% = WDM_KMIXER, SW\{B7EAFDC0-A680-11D0-96D8-00AA0051E51D}\r
+%WDM_SYSAUDIO.DeviceDesc% = WDM_SYSAUDIO, SW\{A7C7A5B0-5AF3-11D1-9CED-00A024BF0407}\r
%WDM_WDMAUD.DeviceDesc% = WDM_WDMAUD, SW\{CD171DE3-69E5-11D2-B56D-0000F8754380}\r
;%WDM_DRMKAUD.DeviceDesc% = WDM_DRMKAUD, SW\{EEC12DB6-AD9C-4168-8658-B03DAEF417FE}\r
\r
\r
[DeviceRegistration]\r
; Kmixer swenum install\r
-;HKLM,%RunOnce%,"WDM_KMIXER0",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_MIXER%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"\r
-;HKLM,%RunOnce%,"WDM_KMIXER1",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_AUDIO%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"\r
+HKLM,%RunOnce%,"WDM_KMIXER0",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_MIXER%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"\r
+HKLM,%RunOnce%,"WDM_KMIXER1",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_KMIXER.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_AUDIO%,%17%\WDMAUDIO.inf,WDM_KMIXER.Interface.Install"\r
\r
; Sysaudio swenum install\r
-;HKLM,%RunOnce%,"WDM_SYSAUDIO",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_SYSAUDIO.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_SYSAUDIO%,%17%\WDMAUDIO.inf,WDM_SYSAUDIO.Interface.Install"\r
+HKLM,%RunOnce%,"WDM_SYSAUDIO",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_SYSAUDIO.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_SYSAUDIO%,%17%\WDMAUDIO.inf,WDM_SYSAUDIO.Interface.Install"\r
\r
; WDMAud install\r
HKLM,%RunOnce%,"WDM_WDMAUD",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_WDMAUD.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_WDMAUD%,%17%\WDMAUDIO.inf,WDM_WDMAUD.Interface.Install"\r