ReactOS  0.4.14-dev-552-g2fad488
csqrtns.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for csqrtns.c:

Go to the source code of this file.

Functions

VOID NTAPI CsqRemoveIrp (PIO_CSQ UnusedCsq, PIRP Irp)
 
PIRP NTAPI CsqPeekNextIrp (PIO_CSQ UnusedCsq, PIRP Irp, PVOID PeekContext)
 
VOID NTAPI CsqAcquireLock (PIO_CSQ UnusedCsq, PKIRQL Irql)
 
VOID NTAPI CsqReleaseLock (PIO_CSQ UnusedCsq, KIRQL Irql)
 
VOID NTAPI CsqCompleteCanceledIrp (PIO_CSQ UnusedCsq, PIRP Irp)
 
VOID NTAPI CsqInsertIrp (PIO_CSQ UnusedCsq, PIRP Irp)
 

Variables

IO_CSQ Csq
 
LIST_ENTRY IrpQueue
 
KSPIN_LOCK IrpQueueLock
 
KSEMAPHORE QueueSemaphore
 

Function Documentation

◆ CsqAcquireLock()

VOID NTAPI CsqAcquireLock ( PIO_CSQ  UnusedCsq,
PKIRQL  Irql 
)

Definition at line 105 of file csqrtns.c.

112 {
113  UNREFERENCED_PARAMETER(UnusedCsq);
114  INFO_(FLOPPY, "CSQ: Acquiring spin lock\n");
116 }
#define INFO_(ch,...)
Definition: debug.h:159
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
_Out_ PKIRQL Irql
Definition: csq.h:179
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
KSPIN_LOCK IrpQueueLock
Definition: csqrtns.c:50

◆ CsqCompleteCanceledIrp()

VOID NTAPI CsqCompleteCanceledIrp ( PIO_CSQ  UnusedCsq,
PIRP  Irp 
)

Definition at line 135 of file csqrtns.c.

145 {
146  UNREFERENCED_PARAMETER(UnusedCsq);
147  TRACE_(FLOPPY, "CSQ: Canceling irp 0x%p\n", Irp);
148  Irp->IoStatus.Status = STATUS_CANCELLED;
149  Irp->IoStatus.Information = 0;
151 }
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define IoCompleteRequest
Definition: irp.c:1240
#define TRACE_(x)
Definition: compat.h:66
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
#define IO_NO_INCREMENT
Definition: iotypes.h:566

◆ CsqInsertIrp()

VOID NTAPI CsqInsertIrp ( PIO_CSQ  UnusedCsq,
PIRP  Irp 
)

Definition at line 155 of file csqrtns.c.

170 {
171  UNREFERENCED_PARAMETER(UnusedCsq);
172  TRACE_(FLOPPY, "CSQ: Inserting IRP 0x%p\n", Irp);
173  InsertTailList(&IrpQueue, &Irp->Tail.Overlay.ListEntry);
175 }
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LIST_ENTRY IrpQueue
Definition: csqrtns.c:49
#define InsertTailList(ListHead, Entry)
KSEMAPHORE QueueSemaphore
Definition: csqrtns.c:51
#define TRACE_(x)
Definition: compat.h:66
LONG NTAPI KeReleaseSemaphore(IN PKSEMAPHORE Semaphore, IN KPRIORITY Increment, IN LONG Adjustment, IN BOOLEAN Wait)
Definition: semphobj.c:54

◆ CsqPeekNextIrp()

PIRP NTAPI CsqPeekNextIrp ( PIO_CSQ  UnusedCsq,
PIRP  Irp,
PVOID  PeekContext 
)

Definition at line 76 of file csqrtns.c.

89 {
90  UNREFERENCED_PARAMETER(UnusedCsq);
92  TRACE_(FLOPPY, "CSQ: Peeking for next IRP\n");
93 
94  if(Irp)
95  return CONTAINING_RECORD(&Irp->Tail.Overlay.ListEntry.Flink, IRP, Tail.Overlay.ListEntry);
96 
97  if(IsListEmpty(&IrpQueue))
98  return NULL;
99 
100  return CONTAINING_RECORD(IrpQueue.Flink, IRP, Tail.Overlay.ListEntry);
101 }
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LIST_ENTRY IrpQueue
Definition: csqrtns.c:49
IRP
Definition: iotypes.h:2463
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE_(x)
Definition: compat.h:66
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
_In_opt_ PIRP _In_opt_ PVOID PeekContext
Definition: csq.h:159

◆ CsqReleaseLock()

VOID NTAPI CsqReleaseLock ( PIO_CSQ  UnusedCsq,
KIRQL  Irql 
)

Definition at line 120 of file csqrtns.c.

127 {
128  UNREFERENCED_PARAMETER(UnusedCsq);
129  INFO_(FLOPPY, "CSQ: Releasing spin lock\n");
131 }
#define INFO_(ch,...)
Definition: debug.h:159
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
_Out_ PKIRQL Irql
Definition: csq.h:179
KSPIN_LOCK IrpQueueLock
Definition: csqrtns.c:50
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627

◆ CsqRemoveIrp()

VOID NTAPI CsqRemoveIrp ( PIO_CSQ  UnusedCsq,
PIRP  Irp 
)

Definition at line 59 of file csqrtns.c.

68 {
69  UNREFERENCED_PARAMETER(UnusedCsq);
70  TRACE_(FLOPPY, "CSQ: Removing IRP 0x%p\n", Irp);
71  RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
72 }
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define TRACE_(x)
Definition: compat.h:66

Variable Documentation

◆ Csq

◆ IrpQueue

LIST_ENTRY IrpQueue

Definition at line 49 of file csqrtns.c.

Referenced by CsqInsertIrp(), CsqPeekNextIrp(), and DriverEntry().

◆ IrpQueueLock

KSPIN_LOCK IrpQueueLock

Definition at line 50 of file csqrtns.c.

Referenced by CsqAcquireLock(), CsqReleaseLock(), and DriverEntry().

◆ QueueSemaphore

KSEMAPHORE QueueSemaphore

Definition at line 51 of file csqrtns.c.

Referenced by CsqInsertIrp(), DriverEntry(), and QueueThread().