ReactOS 0.4.17-dev-1133-gc25e4fd
inline.h File Reference
#include "precomp.h"
#include "storport.h"
Include dependency graph for inline.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define StorpCheckFlowControl(...)
 

Functions

FORCEINLINE VOID StorpCompleteRequest (_In_ PIRP Irp, _In_ UCHAR SrbStatus, _In_ NTSTATUS IrpStatus)
 Completes a request with specified SRB status and IRP status.
 
FORCEINLINE PFDO_DEVICE_EXTENSION StorpGetMiniportFdo (_In_ PVOID HwDeviceExtension)
 For use in Storport API exposed to miniports; gets FDO extension with HwDeviceExtension.
 
FORCEINLINE ULONG StorpInterlockedInsertHeadListCounted (_In_ PKSPIN_LOCK SpinLock, _In_ PLIST_ENTRY ListHead, _In_ PLIST_ENTRY Entry, _In_ PULONG Counter)
 InsertHeadList and increment element counter with a corresponding spin lock held.
 
FORCEINLINE ULONG StorpInterlockedInsertTailListCounted (_In_ PKSPIN_LOCK SpinLock, _In_ PLIST_ENTRY ListHead, _In_ PLIST_ENTRY Entry, _In_ PULONG Counter)
 InsertTailList and increment element counter with a corresponding spin lock held.
 
FORCEINLINE BOOLEAN StorpInterlockedRemoveEntryListCounted (_In_ PKSPIN_LOCK SpinLock, _In_ PLIST_ENTRY Entry, _In_ PULONG Counter)
 RemoveEntryList and decrement element counter with a corresponding spin lock held.
 
FORCEINLINE PLIST_ENTRY StorpInterlockedRemoveHeadListCounted (_In_ PKSPIN_LOCK SpinLock, _In_ PLIST_ENTRY ListHead, _In_ PULONG Counter)
 RemoveHeadList and decrement element counter with a corresponding spin lock held.
 
FORCEINLINE PLIST_ENTRY StorpInterlockedRemoveTailListCounted (_In_ PKSPIN_LOCK SpinLock, _In_ PLIST_ENTRY ListHead, _In_ PULONG Counter)
 RemoveTailList and decrement element counter with a corresponding spin lock held.
 

Macro Definition Documentation

◆ StorpCheckFlowControl

#define StorpCheckFlowControl (   ...)

Definition at line 252 of file inline.h.

Function Documentation

◆ StorpCompleteRequest()

FORCEINLINE VOID StorpCompleteRequest ( _In_ PIRP  Irp,
_In_ UCHAR  SrbStatus,
_In_ NTSTATUS  IrpStatus 
)

Completes a request with specified SRB status and IRP status.

Definition at line 19 of file inline.h.

23{
24 IoGetCurrentIrpStackLocation(Irp)->Parameters.Scsi.Srb->SrbStatus = SrbStatus;
25 Irp->IoStatus.Status = IrpStatus;
26 Irp->IoStatus.Information = 0;
27
29}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1272
union _IO_STACK_LOCATION::@1813 Parameters
struct _IO_STACK_LOCATION::@5016::@5038 Scsi
#define IO_NO_INCREMENT
Definition: iotypes.h:598

Referenced by PortFlushStarvedRequests(), PortPdoScsi(), PortPdoStarveRequest(), and PortStarvedCsqCompleteCanceledIrp().

◆ StorpGetMiniportFdo()

FORCEINLINE PFDO_DEVICE_EXTENSION StorpGetMiniportFdo ( _In_ PVOID  HwDeviceExtension)

For use in Storport API exposed to miniports; gets FDO extension with HwDeviceExtension.

Parameters
HwDeviceExtensionHwDeviceExtension parameter of Storport API.
Returns
PFDO_DEVICE_EXTENSION FDO Device extension.

Definition at line 39 of file inline.h.

42{
43 PMINIPORT_DEVICE_EXTENSION MiniportExtension;
44
45 NT_ASSERT(HwDeviceExtension);
46
47 MiniportExtension = CONTAINING_RECORD(HwDeviceExtension,
49 HwDeviceExtension);
50
51 return MiniportExtension->Miniport->DeviceExtension;
52}
struct _MINIPORT * Miniport
Definition: precomp.h:84
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
#define NT_ASSERT
Definition: rtlfuncs.h:3334

Referenced by StorPortDeviceBusy(), StorPortDeviceReady(), and StorPortSetDeviceQueueDepth().

◆ StorpInterlockedInsertHeadListCounted()

FORCEINLINE ULONG StorpInterlockedInsertHeadListCounted ( _In_ PKSPIN_LOCK  SpinLock,
_In_ PLIST_ENTRY  ListHead,
_In_ PLIST_ENTRY  Entry,
_In_ PULONG  Counter 
)

InsertHeadList and increment element counter with a corresponding spin lock held.

Parameters
SpinLockSpin lock for interlocked exclusive access.
ListHeadList head of the list.
EntryList entry to be inserted.
CounterPointer to the list element counter ULONG value.
Returns
ULONG Number of items in the list after insertion.

Definition at line 71 of file inline.h.

77{
79
81 InsertHeadList(ListHead, Entry);
82 ++(*Counter);
84
85 return (*Counter);
86}
#define InsertHeadList(ListHead, Entry)
VOID FASTCALL KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:130
VOID FASTCALL KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:166
Entry
Definition: section.c:5216
static LARGE_INTEGER Counter
Definition: clock.c:43
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:228
*LockHandle LockHandle _Out_ PKLOCK_QUEUE_HANDLE LockHandle
Definition: kefuncs.h:717

Referenced by PortAddDevice(), PortCreatePdo(), and StorPortExtendedFunction().

◆ StorpInterlockedInsertTailListCounted()

FORCEINLINE ULONG StorpInterlockedInsertTailListCounted ( _In_ PKSPIN_LOCK  SpinLock,
_In_ PLIST_ENTRY  ListHead,
_In_ PLIST_ENTRY  Entry,
_In_ PULONG  Counter 
)

InsertTailList and increment element counter with a corresponding spin lock held.

Parameters
SpinLockSpin lock for interlocked exclusive access.
ListHeadList head of the list.
EntryList entry to be inserted.
CounterPointer to the list element counter ULONG value.
Returns
ULONG Number of items in the list after insertion.

Definition at line 99 of file inline.h.

105{
107
109 InsertTailList(ListHead, Entry);
110 ++(*Counter);
112
113 return (*Counter);
114}
#define InsertTailList(ListHead, Entry)

◆ StorpInterlockedRemoveEntryListCounted()

FORCEINLINE BOOLEAN StorpInterlockedRemoveEntryListCounted ( _In_ PKSPIN_LOCK  SpinLock,
_In_ PLIST_ENTRY  Entry,
_In_ PULONG  Counter 
)

RemoveEntryList and decrement element counter with a corresponding spin lock held.

Parameters
SpinLockSpin lock for interlocked exclusive access.
EntryList entry to be removed.
CounterPointer to the list element counter ULONG value.
Returns
BOOLEAN Whether the list is empty after the removal.

Definition at line 126 of file inline.h.

130{
133
136 --(*Counter);
137
138 NT_ASSERT(Empty == (*Counter == 0));
139
141
142 return Empty;
143}
unsigned char BOOLEAN
Definition: actypes.h:127
@ Empty
Definition: npfs.h:126
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986

Referenced by PortDeletePdo().

◆ StorpInterlockedRemoveHeadListCounted()

FORCEINLINE PLIST_ENTRY StorpInterlockedRemoveHeadListCounted ( _In_ PKSPIN_LOCK  SpinLock,
_In_ PLIST_ENTRY  ListHead,
_In_ PULONG  Counter 
)

RemoveHeadList and decrement element counter with a corresponding spin lock held.

Parameters
SpinLockSpin lock for interlocked exclusive access.
ListHeadList head to take an entry from.
CounterPointer to the list element counter ULONG value.
Returns
PLIST_ENTRY The element taken from the list.

Definition at line 155 of file inline.h.

159{
162
164
165 NT_ASSERT(IsListEmpty(ListHead) == (*Counter == 0));
166
167 Entry = RemoveHeadList(ListHead);
168 --(*Counter);
170
171 return Entry;
172}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
Definition: typedefs.h:120

◆ StorpInterlockedRemoveTailListCounted()

FORCEINLINE PLIST_ENTRY StorpInterlockedRemoveTailListCounted ( _In_ PKSPIN_LOCK  SpinLock,
_In_ PLIST_ENTRY  ListHead,
_In_ PULONG  Counter 
)

RemoveTailList and decrement element counter with a corresponding spin lock held.

Parameters
SpinLockSpin lock for interlocked exclusive access.
ListHeadList head to take an entry from.
CounterPointer to the list element counter ULONG value.
Returns
PLIST_ENTRY The element taken from the list.

Definition at line 184 of file inline.h.

188{
191
193
194 NT_ASSERT(IsListEmpty(ListHead) == (*Counter == 0));
195
196 Entry = RemoveTailList(ListHead);
197 --(*Counter);
199
200 return Entry;
201}
#define RemoveTailList(ListHead)
Definition: env_spec_w32.h:975