ReactOS  0.4.15-dev-3428-g0609db5
misc.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Serial mouse driver
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: drivers/input/sermouse/fdo.c
5  * PURPOSE: Miscellaneous operations
6  * PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
7  */
8 
9 #include "sermouse.h"
10 
11 #include <debug.h>
12 
13 static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion;
14 
15 static NTSTATUS NTAPI
18  IN PIRP Irp,
20 {
21  if (Irp->PendingReturned)
24 }
25 
29  IN PIRP Irp)
30 {
31  PDEVICE_OBJECT LowerDevice = ((PSERMOUSE_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
32  KEVENT Event;
34 
37 
38  TRACE_(SERMOUSE, "Calling lower device %p\n", LowerDevice);
40 
41  Status = IoCallDriver(LowerDevice, Irp);
42  if (Status == STATUS_PENDING)
43  {
45  if (NT_SUCCESS(Status))
46  Status = Irp->IoStatus.Status;
47  }
48 
49  return Status;
50 }
51 
55  IN PIRP Irp)
56 {
57  PDEVICE_OBJECT LowerDevice = ((PSERMOUSE_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
58 
60  return IoCallDriver(LowerDevice, Irp);
61 }
#define IN
Definition: typedefs.h:39
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion
Definition: misc.c:13
struct _SERMOUSE_DEVICE_EXTENSION * PSERMOUSE_DEVICE_EXTENSION
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
NTSTATUS NTAPI ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: misc.c:33
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:498
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext(_Inout_ PIRP Irp)
Definition: iofuncs.h:2868
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:467
Status
Definition: gdiplustypes.h:24
#define TRACE_(x)
Definition: compat.h:76
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTSTATUS NTAPI ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: misc.c:59
#define NULL
Definition: types.h:112
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IO_NO_INCREMENT
Definition: iotypes.h:598