ReactOS 0.4.15-dev-7098-ge0c17c3
kmixer.c File Reference
#include "kmixer.h"
#include <debug.h>
Include dependency graph for kmixer.c:

Go to the source code of this file.

Functions

NTSTATUS NTAPI KMix_Pnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
VOID NTAPI KMix_Unload (IN PDRIVER_OBJECT DriverObject)
 
NTSTATUS NTAPI KMix_AddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
 
NTSTATUS NTAPI DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPathName)
 

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( PDRIVER_OBJECT  DriverObject,
PUNICODE_STRING  RegistryPathName 
)

Definition at line 102 of file kmixer.c.

105{
106 DPRINT1("KMixer.sys loaded\n");
107
112
115 DriverObject->MajorFunction[IRP_MJ_PNP] = KMix_Pnp;
116 DriverObject->DriverUnload = KMix_Unload;
117 DriverObject->DriverExtension->AddDevice = KMix_AddDevice;
118
119 return STATUS_SUCCESS;
120}
#define DPRINT1
Definition: precomp.h:8
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
KSDDKAPI NTSTATUS NTAPI KsDefaultForwardIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:227
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:166
KSDDKAPI NTSTATUS NTAPI KsSetMajorFunctionHandler(IN PDRIVER_OBJECT DriverObject, IN ULONG MajorFunction)
Definition: irp.c:2050
VOID NTAPI KMix_Unload(IN PDRIVER_OBJECT DriverObject)
Definition: kmixer.c:36
NTSTATUS NTAPI KMix_Pnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: kmixer.c:16
NTSTATUS NTAPI KMix_AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: kmixer.c:43
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define STATUS_SUCCESS
Definition: shellext.h:65
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MJ_POWER

◆ KMix_AddDevice()

NTSTATUS NTAPI KMix_AddDevice ( IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  PhysicalDeviceObject 
)

Definition at line 43 of file kmixer.c.

46{
50 PKMIXER_DEVICE_EXT DeviceExtension;
52
53 DPRINT1("KMix_InstallDevice called\n");
54
55 /* create the device */
57 sizeof(KMIXER_DEVICE_EXT),
60 0,
61 FALSE,
63
64 /* check for success */
65 if (!NT_SUCCESS(Status))
66 {
67 DPRINT("Failed to create \\Device\\kmixer !\n");
68 return Status;
69 }
70
71 DeviceExtension = (PKMIXER_DEVICE_EXT)DeviceObject->DeviceExtension;
72 /* initialize device extension */
73 RtlZeroMemory(DeviceExtension, sizeof(KMIXER_DEVICE_EXT));
74
75 Status = KMixAllocateDeviceHeader(DeviceExtension);
76 if (!NT_SUCCESS(Status))
77 {
78 DPRINT1("KMixAllocateDeviceHeader failed with %x\n", Status);
79 goto cleanup;
80 }
81
82 /* set io flags */
84
85 /* clear initializing flag */
86 DeviceObject->Flags &= ~ DO_DEVICE_INITIALIZING;
87
90
91 DPRINT("KMix_InstallDevice result %x\n", Status);
92 return STATUS_SUCCESS;
93
95
97 return Status;
98}
LONG NTSTATUS
Definition: precomp.h:26
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static void cleanup(void)
Definition: main.c:1335
KSDDKAPI VOID NTAPI KsSetDevicePnpAndBaseObject(IN KSDEVICE_HEADER Header, IN PDEVICE_OBJECT PnpDeviceObject, IN PDEVICE_OBJECT BaseDevice)
Definition: api.c:257
NTSTATUS NTAPI KMixAllocateDeviceHeader(IN PKMIXER_DEVICE_EXT DeviceExtension)
Definition: filter.c:179
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
Status
Definition: gdiplustypes.h:25
struct KMIXER_DEVICE_EXT * PKMIXER_DEVICE_EXT
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT * NextDeviceObject
Definition: ndis.h:4642
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define L(x)
Definition: ntvdm.h:50
#define FILE_DEVICE_KS
Definition: winioctl.h:153
#define DPRINT
Definition: sndvol32.h:71
KSDEVICE_HEADER KsDeviceHeader
Definition: kmixer.h:9
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
#define DO_POWER_PAGABLE

Referenced by DriverEntry().

◆ KMix_Pnp()

NTSTATUS NTAPI KMix_Pnp ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 16 of file kmixer.c.

19{
20 PIO_STACK_LOCATION IrpStack;
21
23
24 DPRINT("KMix_Pnp called for func %x\n", IrpStack->MinorFunction);
25
27 {
28 Irp->IoStatus.Information |= PNP_DEVICE_NOT_DISABLEABLE;
29 }
30
32}
_In_ PIRP Irp
Definition: csq.h:116
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:110
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define PNP_DEVICE_NOT_DISABLEABLE
Definition: iotypes.h:1006

Referenced by DriverEntry().

◆ KMix_Unload()

VOID NTAPI KMix_Unload ( IN PDRIVER_OBJECT  DriverObject)

Definition at line 36 of file kmixer.c.

37{
38 DPRINT1("SysAudio_Unload called\n");
39}

Referenced by DriverEntry().