ReactOS 0.4.15-dev-7924-g5949c20
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}
_Out_ PKIRQL Irql
Definition: csq.h:179
KSPIN_LOCK IrpQueueLock
Definition: csqrtns.c:50
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define INFO_(ch,...)
Definition: debug.h:159

◆ 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 TRACE_(x)
Definition: compat.h:76
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
#define IO_NO_INCREMENT
Definition: iotypes.h:598

◆ 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}
KSEMAPHORE QueueSemaphore
Definition: csqrtns.c:51
LIST_ENTRY IrpQueue
Definition: csqrtns.c:49
#define FALSE
Definition: types.h:117
#define InsertTailList(ListHead, Entry)
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
98 return NULL;
99
100 return CONTAINING_RECORD(IrpQueue.Flink, IRP, Tail.Overlay.ListEntry);
101}
_In_opt_ PIRP _In_opt_ PVOID PeekContext
Definition: csq.h:160
#define NULL
Definition: types.h:112
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ 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 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}
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986

Variable Documentation

◆ Csq

◆ IrpQueue

◆ 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().