ReactOS 0.4.15-dev-7931-gfd331f1
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{
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,
58 FALSE);
59
61 {
63 }
64
65 return Status;
66}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
ULONG_PTR KAFFINITY
Definition: compat.h:85
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
UCHAR KIRQL
Definition: env_spec_w32.h:591
Status
Definition: gdiplustypes.h:25
@ Isa
Definition: hwresource.cpp:138
@ InterruptObject
Definition: ketypes.h:428
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
#define STATUS_DEVICE_CONFIGURATION_ERROR
Definition: ntstatus.h:619
@ Latched
Definition: miniport.h:81
NTSTATUS LegacyAttachInterrupt(IN PDEVICE_OBJECT DeviceObject, IN UCHAR Irq, IN PKSERVICE_ROUTINE ServiceRoutine, OUT PKINTERRUPT *InterruptObject)
Definition: hardware.c:25
#define DPRINT
Definition: sndvol32.h:71
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:174
_In_ PKSERVICE_ROUTINE ServiceRoutine
Definition: iofuncs.h:800
KSERVICE_ROUTINE * PKSERVICE_ROUTINE
Definition: ketypes.h:512
unsigned char UCHAR
Definition: xmlstorage.h:181