ReactOS  0.4.12-dev-918-g6c6e7b8
kmixer.c File Reference
#include "kmixer.h"
#include <debug.h>
Include dependency graph for kmixer.c:

Go to the source code of this file.

Macros

#define YDEBUG
 

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)
 

Macro Definition Documentation

◆ YDEBUG

#define YDEBUG

Definition at line 11 of file kmixer.c.

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( PDRIVER_OBJECT  DriverObject,
PUNICODE_STRING  RegistryPathName 
)

Definition at line 104 of file kmixer.c.

107 {
108  DPRINT1("KMixer.sys loaded\n");
109 
114 
120 
121  return STATUS_SUCCESS;
122 }
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:166
NTSTATUS NTAPI KMix_AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: kmixer.c:43
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
KSDDKAPI NTSTATUS NTAPI KsSetMajorFunctionHandler(IN PDRIVER_OBJECT DriverObject, IN ULONG MajorFunction)
Definition: irp.c:2017
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2173
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
VOID NTAPI KMix_Unload(IN PDRIVER_OBJECT DriverObject)
Definition: kmixer.c:36
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2179
#define IRP_MJ_SYSTEM_CONTROL
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2111
KSDDKAPI NTSTATUS NTAPI KsDefaultForwardIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:227
NTSTATUS NTAPI KMix_Pnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: kmixer.c:16
#define DPRINT1
Definition: precomp.h:8
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2180
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
return STATUS_SUCCESS
Definition: btrfs.c:2725
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

◆ KMix_AddDevice()

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

Definition at line 43 of file kmixer.c.

46 {
48  UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\kmixer");
50  PKMIXER_DEVICE_EXT DeviceExtension;
52 
53  DPRINT1("KMix_InstallDevice called\n");
54 
55  /* create the device */
57  sizeof(KMIXER_DEVICE_EXT),
58  &DeviceName,
60  0,
61  FALSE,
62  &DeviceObject);
63 
64  /* check for success */
65  if (!NT_SUCCESS(Status))
66  {
67  DPRINT("Failed to create \\Device\\kmixer !\n");
68  return Status;
69  }
70 
72  /* initialize device extension */
73  RtlZeroMemory(DeviceExtension, sizeof(KMIXER_DEVICE_EXT));
74 
75 
76  Status = KMixAllocateDeviceHeader(DeviceExtension);
77  if (!NT_SUCCESS(Status))
78  {
79  DPRINT1("KMixAllocateDeviceHeader failed with %x\n", Status);
80  goto cleanup;
81  }
82 
83  /* set io flags */
85 
86  /* clear initializing flag */
88 
91 
92  DPRINT("KMix_InstallDevice result %x\n", Status);
93  return STATUS_SUCCESS;
94 
95 cleanup:
96 
98  return Status;
99 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define DO_POWER_PAGABLE
KSDDKAPI VOID NTAPI KsSetDevicePnpAndBaseObject(IN KSDEVICE_HEADER Header, IN PDEVICE_OBJECT PnpDeviceObject, IN PDEVICE_OBJECT BaseDevice)
Definition: api.c:257
LONG NTSTATUS
Definition: precomp.h:26
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
struct KMIXER_DEVICE_EXT * PKMIXER_DEVICE_EXT
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
PVOID DeviceExtension
Definition: env_spec_w32.h:418
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI KMixAllocateDeviceHeader(IN PKMIXER_DEVICE_EXT DeviceExtension)
Definition: filter.c:179
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT * NextDeviceObject
Definition: ndis.h:4622
static const WCHAR L[]
Definition: oid.c:1250
KSDEVICE_HEADER KsDeviceHeader
Definition: kmixer.h:9
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1250
#define FILE_DEVICE_KS
Definition: winioctl.h:152
#define DPRINT1
Definition: precomp.h:8
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
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
char * cleanup(char *str)
Definition: wpickclick.c:99
return STATUS_SUCCESS
Definition: btrfs.c:2725
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

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 }
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:110
_In_ PIRP Irp
Definition: csq.h:116
void DPRINT(...)
Definition: polytest.cpp:61
#define PNP_DEVICE_NOT_DISABLEABLE
Definition: iotypes.h:968
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define IRP_MN_QUERY_PNP_DEVICE_STATE

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 }
#define DPRINT1
Definition: precomp.h:8

Referenced by DriverEntry().