ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

hardware.c
Go to the documentation of this file.
00001 /*
00002     ReactOS Sound System
00003     Hardware interaction helper
00004 
00005     Author:
00006         Andrew Greenwood (silverblade@reactos.org)
00007 
00008     History:
00009         25 May 2008 - Created
00010 
00011     Notes:
00012         This uses some obsolete calls (eg: HalGetInterruptVector).
00013         Might be worth updating this in future to use some of the
00014         recommended functions like IoReportDetectedDevice and
00015         IoReportResourceForDetection...
00016 */
00017 
00018 #include <ntddk.h>
00019 #include <ntddsnd.h>
00020 #include <debug.h>
00021 
00022 /* NOTE: Disconnect using IoDisconnectInterrupt */
00023 
00024 NTSTATUS
00025 LegacyAttachInterrupt(
00026     IN  PDEVICE_OBJECT DeviceObject,
00027     IN  UCHAR Irq,
00028     IN  PKSERVICE_ROUTINE ServiceRoutine,
00029     OUT PKINTERRUPT* InterruptObject)
00030 {
00031     NTSTATUS Status;
00032     ULONG Vector;
00033     KIRQL IrqLevel;
00034     KAFFINITY Affinity;
00035 
00036     DPRINT("Obtaining interrupt vector");
00037 
00038     Vector = HalGetInterruptVector(Isa,
00039                                    0,
00040                                    Irq,
00041                                    Irq,
00042                                    &IrqLevel,
00043                                    &Affinity);
00044 
00045     DPRINT("Vector %d", Vector);
00046     DPRINT("Connecting IRQ %d", Irq);
00047 
00048     Status = IoConnectInterrupt(InterruptObject,
00049                                 ServiceRoutine,
00050                                 DeviceObject,
00051                                 NULL,
00052                                 Vector,
00053                                 IrqLevel,
00054                                 IrqLevel,
00055                                 Latched,
00056                                 FALSE,
00057                                 Affinity,
00058                                 FALSE);
00059 
00060     if ( Status == STATUS_INVALID_PARAMETER )
00061     {
00062         Status = STATUS_DEVICE_CONFIGURATION_ERROR;
00063     }
00064 
00065     return Status;
00066 }

Generated on Sat May 26 2012 04:17:52 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.