ReactOS 0.4.17-dev-1281-g065abb3
hubutil.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  HubSpinLockGuard
 
class  HubWaitLockGuard
 
class  HubTimer
 

Macros

#define HUB_TAG_DRIVER   'w3HU'
 
#define HUB_TAG_HUB   'h3HU'
 
#define HUB_TAG_DEVICE   'd3HU'
 
#define HUB_TAG_PORT   'p3HU'
 

Functions

PVOID operator new (_In_ size_t Size, _In_ PVOID Where) noexcept
 
VOID operator delete (_In_ PVOID Memory, _In_ PVOID Where) noexcept
 
FORCEINLINE VOID NTAPI HubClearListEntry (_Out_ PLIST_ENTRY Entry)
 
FORCEINLINE BOOLEAN NTAPI HubIsListEntryLinked (_In_ const LIST_ENTRY *Entry)
 
 _IRQL_requires_ (PASSIVE_LEVEL) VOID NTAPI HubWaitForPnpEvent(_In_ PKEVENT Event
 Sends a synchronous IOCTL to the specified device object.
 
FORCEINLINE VOID NTAPI HubDereferenceDeferred (_In_ WDFOBJECT Object)
 
FORCEINLINE VOID NTAPI HubDeleteDeferred (_In_ WDFOBJECT Object)
 

Variables

_In_ PCSTR What
 
_In_ PCSTR _In_ WDFOBJECT Object
 

Macro Definition Documentation

◆ HUB_TAG_DEVICE

#define HUB_TAG_DEVICE   'd3HU'

Definition at line 13 of file hubutil.h.

◆ HUB_TAG_DRIVER

#define HUB_TAG_DRIVER   'w3HU'

Definition at line 11 of file hubutil.h.

◆ HUB_TAG_HUB

#define HUB_TAG_HUB   'h3HU'

Definition at line 12 of file hubutil.h.

◆ HUB_TAG_PORT

#define HUB_TAG_PORT   'p3HU'

Definition at line 14 of file hubutil.h.

Function Documentation

◆ _IRQL_requires_()

_IRQL_requires_ ( PASSIVE_LEVEL  )

Sends a synchronous IOCTL to the specified device object.

Waits on a PnP handshake event with no timeout, printing a watchdog line every minute so a stuck machine is visible in the debugger.

Definition at line 2121 of file class.c.

13175{
13177
13178 PAGED_CODE();
13179
13180 TracePrint((TRACE_LEVEL_VERBOSE,
13181 TRACE_FLAG_PNP,
13182 "ClassDetermineTokenOperationCommandSupport (%p): Entering function.\n",
13183 DeviceObject));
13184
13185 //
13186 // Send down Inquiry for VPD_THIRD_PARTY_COPY_PAGE and cache away the device parameters
13187 // from WINDOWS_BLOCK_DEVICE_TOKEN_LIMITS_DESCRIPTOR.
13188 //
13190
13191 if (NT_SUCCESS(status)) {
13192
13193 ULONG maxListIdentifier = MaxTokenOperationListIdentifier;
13194
13195 //
13196 // Query the maximum list identifier to use for TokenOperation commands.
13197 //
13198 if (NT_SUCCESS(ClasspGetMaximumTokenListIdentifier(DeviceObject, REG_DISK_CLASS_CONTROL, &maxListIdentifier))) {
13199 if (maxListIdentifier >= MIN_TOKEN_LIST_IDENTIFIERS) {
13200
13201 NT_ASSERT(maxListIdentifier <= MAX_TOKEN_LIST_IDENTIFIERS);
13202 MaxTokenOperationListIdentifier = maxListIdentifier;
13203 }
13204 }
13205
13206 }
13207
13208 TracePrint((TRACE_LEVEL_VERBOSE,
13209 TRACE_FLAG_PNP,
13210 "ClassDetermineTokenOperationCommandSupport (%p): Exiting function with status %x.\n",
13212 status));
13213
13214 return status;
13215}
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
#define REG_DISK_CLASS_CONTROL
Definition: classp.h:218
#define MAX_TOKEN_LIST_IDENTIFIERS
Definition: classp.h:215
#define MIN_TOKEN_LIST_IDENTIFIERS
Definition: classp.h:214
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
ULONG MaxTokenOperationListIdentifier
Definition: class.c:107
_IRQL_requires_same_ NTSTATUS ClasspGetBlockDeviceTokenLimitsInfo(_Inout_ PDEVICE_OBJECT DeviceObject)
Definition: class.c:13220
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
Definition: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061
#define NT_ASSERT
Definition: rtlfuncs.h:3334

◆ HubClearListEntry()

FORCEINLINE VOID NTAPI HubClearListEntry ( _Out_ PLIST_ENTRY  Entry)

Definition at line 149 of file hubutil.h.

151{
152 Entry->Flink = NULL;
153 Entry->Blink = NULL;
154}
PLIST_ENTRY Entry
Definition: devhcd.cpp:1262
#define NULL
Definition: types.h:112
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121

Referenced by _IRQL_requires_(), HubFdo::QueuePowerDownToDevices(), HubFdo::QueuePowerUpToDevices(), and HubFdo::UnregisterDevice().

◆ HubDeleteDeferred()

FORCEINLINE VOID NTAPI HubDeleteDeferred ( _In_ WDFOBJECT  Object)

WdfObjectDelete with the same deferral as HubDereferenceDeferred.

Definition at line 195 of file hubutil.h.

197{
198 KIRQL Irql;
199
203}
_Out_ PKIRQL Irql
Definition: csq.h:179
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
WdfObjectDelete(String)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

Referenced by PortMachine::ForgetDetachedDevice().

◆ HubDereferenceDeferred()

FORCEINLINE VOID NTAPI HubDereferenceDeferred ( _In_ WDFOBJECT  Object)

Drops a reference at DISPATCH_LEVEL so a last release never waits on its own work item.

Definition at line 181 of file hubutil.h.

183{
184 KIRQL Irql;
185
189}
#define WdfObjectDereference(Handle)
Definition: wdfobject.h:826

Referenced by DeviceMachine::DereferenceDevice(), and PortMachine::DereferencePort().

◆ HubIsListEntryLinked()

FORCEINLINE BOOLEAN NTAPI HubIsListEntryLinked ( _In_ const LIST_ENTRY *  Entry)

Definition at line 159 of file hubutil.h.

161{
162 return Entry->Flink != NULL;
163}

◆ operator delete()

VOID operator delete ( _In_ PVOID  Memory,
_In_ PVOID  Where 
)
inlinenoexcept

Definition at line 29 of file hubutil.h.

32{
35}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
Definition: wdfmemory.h:169

◆ operator new()

PVOID operator new ( _In_ size_t  Size,
_In_ PVOID  Where 
)
inlinenoexcept

Definition at line 19 of file hubutil.h.

22{
24 return Where;
25}
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539

Variable Documentation

◆ Object

Definition at line 175 of file hubutil.h.

◆ What

_In_ PCSTR What

Definition at line 174 of file hubutil.h.