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

helper.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:       See COPYING in the top level directory
00003  * PROJECT:         ReactOS Kernel Streaming
00004  * FILE:            drivers/wdm/audio/legacy/stream/helper.c
00005  * PURPOSE:         irp helper routines
00006  * PROGRAMMER:      Johannes Anderwald
00007  */
00008 
00009 
00010 #include "stream.h"
00011 
00012 NTSTATUS
00013 NTAPI
00014 CompletionRoutine(
00015     IN PDEVICE_OBJECT  DeviceObject,
00016     IN PIRP  Irp,
00017     IN PVOID  Context)
00018 {
00019     if (Irp->PendingReturned == TRUE)
00020     {
00021         KeSetEvent ((PKEVENT) Context, IO_NO_INCREMENT, FALSE);
00022     }
00023     return STATUS_MORE_PROCESSING_REQUIRED;
00024 }
00025 
00026 
00027 NTSTATUS
00028 NTAPI
00029 ForwardIrpSynchronous(
00030     IN  PDEVICE_OBJECT DeviceObject,
00031     IN  PIRP Irp)
00032 {
00033     KEVENT Event;
00034     PSTREAM_DEVICE_EXTENSION DeviceExt;
00035     NTSTATUS Status;
00036 
00037     DeviceExt = (PSTREAM_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
00038 
00039     /* initialize the notification event */
00040     KeInitializeEvent(&Event, NotificationEvent, FALSE);
00041 
00042     IoCopyCurrentIrpStackLocationToNext(Irp);
00043 
00044     IoSetCompletionRoutine(Irp, CompletionRoutine, (PVOID)&Event, TRUE, TRUE, TRUE);
00045 
00046     /* now call the driver */
00047     Status = IoCallDriver(DeviceExt->LowerDeviceObject, Irp);
00048     /* did the request complete yet */
00049     if (Status == STATUS_PENDING)
00050     {
00051         /* not yet, lets wait a bit */
00052         KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
00053         Status = Irp->IoStatus.Status;
00054     }
00055     return Status;
00056 }

Generated on Sat May 26 2012 04:27:14 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.