ReactOS  0.4.15-dev-1018-g0695ecb
hardware.c
Go to the documentation of this file.
1 /*
2  ReactOS Sound System
3  Hardware interaction helper
4 
5  Author:
6  Andrew Greenwood (silverblade@reactos.org)
7 
8  History:
9  25 May 2008 - Created
10 
11  Notes:
12  This uses some obsolete calls (eg: HalGetInterruptVector).
13  Might be worth updating this in future to use some of the
14  recommended functions like IoReportDetectedDevice and
15  IoReportResourceForDetection...
16 */
17 
18 #include <ntddk.h>
19 #include <ntddsnd.h>
20 #include <debug.h>
21 
22 /* NOTE: Disconnect using IoDisconnectInterrupt */
23 
27  IN UCHAR Irq,
30 {
32  ULONG Vector;
33  KIRQL IrqLevel;
35 
36  DPRINT("Obtaining interrupt vector");
37 
39  0,
40  Irq,
41  Irq,
42  &IrqLevel,
43  &Affinity);
44 
45  DPRINT("Vector %d", Vector);
46  DPRINT("Connecting IRQ %d", Irq);
47 
51  NULL,
52  Vector,
53  IrqLevel,
54  IrqLevel,
55  Latched,
56  FALSE,
57  Affinity,
58  FALSE);
59 
61  {
63  }
64 
65  return Status;
66 }
#define IN
Definition: typedefs.h:39
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS LegacyAttachInterrupt(IN PDEVICE_OBJECT DeviceObject, IN UCHAR Irq, IN PKSERVICE_ROUTINE ServiceRoutine, OUT PKINTERRUPT *InterruptObject)
Definition: hardware.c:25
KSERVICE_ROUTINE * PKSERVICE_ROUTINE
Definition: ketypes.h:500
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, IN PKSERVICE_ROUTINE ServiceRoutine, IN PVOID ServiceContext, IN PKSPIN_LOCK SpinLock, IN ULONG Vector, IN KIRQL Irql, IN KIRQL SynchronizeIrql, IN KINTERRUPT_MODE InterruptMode, IN BOOLEAN ShareVector, IN KAFFINITY ProcessorEnableMask, IN BOOLEAN FloatingSave)
Definition: irq.c:22
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170
unsigned char UCHAR
Definition: xmlstorage.h:181
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
ULONG_PTR KAFFINITY
Definition: compat.h:85
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG Vector
Definition: iofuncs.h:798
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_DEVICE_CONFIGURATION_ERROR
Definition: ntstatus.h:619
_In_ PKSERVICE_ROUTINE ServiceRoutine
Definition: iofuncs.h:798