reactos/lib/drivers/sound/legacy/hardware.c
Cameron Gutman 29fa274d6d - Create another branch for networking fixes
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers)
 - If someone wants to delete aicom-network-fixes, they are welcome to
 - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea

svn path=/branches/aicom-network-branch/; revision=44353
2009-12-02 03:23:19 +00:00

67 lines
1.7 KiB
C

/*
ReactOS Sound System
Hardware interaction helper
Author:
Andrew Greenwood (silverblade@reactos.org)
History:
25 May 2008 - Created
Notes:
This uses some obsolete calls (eg: HalGetInterruptVector).
Might be worth updating this in future to use some of the
recommended functions like IoReportDetectedDevice and
IoReportResourceForDetection...
*/
#include <ntddk.h>
#include <ntddsnd.h>
#include <debug.h>
/* NOTE: Disconnect using IoDisconnectInterrupt */
NTSTATUS
LegacyAttachInterrupt(
IN PDEVICE_OBJECT DeviceObject,
IN UCHAR Irq,
IN PKSERVICE_ROUTINE ServiceRoutine,
OUT PKINTERRUPT* InterruptObject)
{
NTSTATUS Status;
ULONG Vector;
KIRQL IrqLevel;
KAFFINITY Affinity;
DPRINT("Obtaining interrupt vector");
Vector = HalGetInterruptVector(Isa,
0,
Irq,
Irq,
&IrqLevel,
&Affinity);
DPRINT("Vector %d", Vector);
DPRINT("Connecting IRQ %d", Irq);
Status = IoConnectInterrupt(InterruptObject,
ServiceRoutine,
DeviceObject,
NULL,
Vector,
IrqLevel,
IrqLevel,
Latched,
FALSE,
Affinity,
FALSE);
if ( Status == STATUS_INVALID_PARAMETER )
{
Status = STATUS_DEVICE_CONFIGURATION_ERROR;
}
return Status;
}