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

Go to the source code of this file.

Classes

struct  HubDriverState
 

Macros

#define HUB_LIVEDUMP_HUB_RESET_OK   0x3000
 
#define HUB_LIVEDUMP_HUB_RESET_FAILED   0x3001
 
#define HUB_LIVEDUMP_SUPERSPEED_DISABLED   0x3002
 
#define HUB_LIVEDUMP_ENUMERATION_FAILED   0x3003
 
#define HUB_BUGCHECK_USB3   0x144
 
#define HUB_USB3_BOOT_DEVICE_FAILED   2
 
#define HUB_BOOT_DEVICE_IS_STORAGE   1
 
#define HUB_BOOT_DEVICE_IS_HUB   2
 

Typedefs

typedef NTSTATUS(NTAPI * PFN_HUB_KSE_QUERY_DEVICE_FLAGS) (_In_ PCWSTR DeviceKey, _In_ PCWSTR DeviceClass, _Out_ PULONG64 DeviceFlags)
 
typedef NTSTATUS(NTAPI * PFN_HUB_REGISTER_BOOT_DEVICE) (_In_ PVOID Registration, _Out_ PVOID *Handle)
 
typedef VOID(NTAPI * PFN_HUB_NOTIFY_BOOT_DEVICE_REMOVAL) (_In_ PVOID Handle)
 
typedef NTSTATUS(NTAPI * PFN_HUB_REGISTER_POWER_SETTING) (_In_opt_ PDEVICE_OBJECT DeviceObject, _In_ LPCGUID SettingGuid, _In_ PPOWER_SETTING_CALLBACK Callback, _In_opt_ PVOID Context, _Outptr_opt_ PVOID *Handle)
 
typedef NTSTATUS(NTAPI * PFN_HUB_UNREGISTER_POWER_SETTING) (_Inout_ PVOID Handle)
 
typedef _Must_inspect_result_ NTSTATUS(NTAPI * PFN_HUB_GET_INTERFACE_PROPERTY) (_In_ PUNICODE_STRING SymbolicLinkName, _In_ CONST DEVPROPKEY *PropertyKey, _In_ LCID Lcid, _Reserved_ ULONG Flags, _In_ ULONG Size, _Out_writes_bytes_to_(Size, *RequiredSize) PVOID Data, _Out_ PULONG RequiredSize, _Out_ PDEVPROPTYPE Type)
 

Enumerations

enum class  HubGlobal : ULONG {
  DisableSelectiveSuspendUI = 0x00000002 , EnableDiagnosticMode = 0x00000008 , DisableUxdSupport = 0x00000010 , EnableExtendedValidation = 0x00000020 ,
  WakeOnConnectUI = 0x00000040 , DisableOnSoftRemove = 0x00000080 , UxdDeleteOnShutdown = 0x00000100 , UxdDeleteOnReload = 0x00000200 ,
  UxdDeleteOnDisconnect = 0x00000400 , UxdEnable = 0x00000800 , EtwEnabled = 0x00001000 , CheckReservedFields = 0x00002000 ,
  StrictDescriptorChecks = 0x00004000 , EnableUsb20HardwareLpm = 0x00008000 , PreventSuperSpeedDebounce = 0x00010000 , AlwaysSecondReset = 0x00020000 ,
  EnableUsbLtm = 0x00040000
}
 
enum class  HubMsOsMode : ULONG { QueryOnce = 0 , ForceQuery = 1 , NeverQuery = 2 }
 
enum class  HubReport : ULONG { HubResetSucceeded = 0 , HubResetFailed = 1 , DeviceEnumerationFailed = 2 }
 

Functions

NTSTATUS NTAPI HubCreateReport (_In_ WDFDEVICE HubFdo, _In_ HubReport Type, _In_ ULONG SubReason)
 
 _IRQL_requires_ (PASSIVE_LEVEL) NTSTATUS NTAPI HubSubmitLiveDump(_In_ WDFDEVICE Device
 Sends a synchronous IOCTL to the specified device object.
 
VOID NTAPI HubNotifyBootDeviceRemoval (_In_opt_ PVOID Handle)
 

Variables

HubDriverState HubDriver
 
_In_ ULONG Code
 
_In_ ULONG _In_ ULONG SubReason
 

Macro Definition Documentation

◆ HUB_BOOT_DEVICE_IS_HUB

#define HUB_BOOT_DEVICE_IS_HUB   2

Definition at line 160 of file hubdriver.h.

◆ HUB_BOOT_DEVICE_IS_STORAGE

#define HUB_BOOT_DEVICE_IS_STORAGE   1

Definition at line 159 of file hubdriver.h.

◆ HUB_BUGCHECK_USB3

#define HUB_BUGCHECK_USB3   0x144

Definition at line 157 of file hubdriver.h.

◆ HUB_LIVEDUMP_ENUMERATION_FAILED

#define HUB_LIVEDUMP_ENUMERATION_FAILED   0x3003

Definition at line 154 of file hubdriver.h.

◆ HUB_LIVEDUMP_HUB_RESET_FAILED

#define HUB_LIVEDUMP_HUB_RESET_FAILED   0x3001

Definition at line 152 of file hubdriver.h.

◆ HUB_LIVEDUMP_HUB_RESET_OK

#define HUB_LIVEDUMP_HUB_RESET_OK   0x3000

Definition at line 151 of file hubdriver.h.

◆ HUB_LIVEDUMP_SUPERSPEED_DISABLED

#define HUB_LIVEDUMP_SUPERSPEED_DISABLED   0x3002

Definition at line 153 of file hubdriver.h.

◆ HUB_USB3_BOOT_DEVICE_FAILED

#define HUB_USB3_BOOT_DEVICE_FAILED   2

Definition at line 158 of file hubdriver.h.

Typedef Documentation

◆ PFN_HUB_GET_INTERFACE_PROPERTY

◆ PFN_HUB_KSE_QUERY_DEVICE_FLAGS

typedef NTSTATUS(NTAPI * PFN_HUB_KSE_QUERY_DEVICE_FLAGS) (_In_ PCWSTR DeviceKey, _In_ PCWSTR DeviceClass, _Out_ PULONG64 DeviceFlags)

Definition at line 41 of file hubdriver.h.

◆ PFN_HUB_NOTIFY_BOOT_DEVICE_REMOVAL

typedef VOID(NTAPI * PFN_HUB_NOTIFY_BOOT_DEVICE_REMOVAL) (_In_ PVOID Handle)

Definition at line 54 of file hubdriver.h.

◆ PFN_HUB_REGISTER_BOOT_DEVICE

typedef NTSTATUS(NTAPI * PFN_HUB_REGISTER_BOOT_DEVICE) (_In_ PVOID Registration, _Out_ PVOID *Handle)

Definition at line 48 of file hubdriver.h.

◆ PFN_HUB_REGISTER_POWER_SETTING

◆ PFN_HUB_UNREGISTER_POWER_SETTING

typedef NTSTATUS(NTAPI * PFN_HUB_UNREGISTER_POWER_SETTING) (_Inout_ PVOID Handle)

Definition at line 68 of file hubdriver.h.

Enumeration Type Documentation

◆ HubGlobal

Enumerator
DisableSelectiveSuspendUI 
EnableDiagnosticMode 
DisableUxdSupport 
EnableExtendedValidation 
WakeOnConnectUI 
DisableOnSoftRemove 
UxdDeleteOnShutdown 
UxdDeleteOnReload 
UxdDeleteOnDisconnect 
UxdEnable 
EtwEnabled 
CheckReservedFields 
StrictDescriptorChecks 
EnableUsb20HardwareLpm 
PreventSuperSpeedDebounce 
AlwaysSecondReset 
EnableUsbLtm 

Definition at line 11 of file hubdriver.h.

12{
13 DisableSelectiveSuspendUI = 0x00000002,
14 EnableDiagnosticMode = 0x00000008,
15 DisableUxdSupport = 0x00000010,
16 EnableExtendedValidation = 0x00000020,
17 WakeOnConnectUI = 0x00000040,
18 DisableOnSoftRemove = 0x00000080,
19 UxdDeleteOnShutdown = 0x00000100,
20 UxdDeleteOnReload = 0x00000200,
21 UxdDeleteOnDisconnect = 0x00000400,
22 UxdEnable = 0x00000800,
23 EtwEnabled = 0x00001000,
24 CheckReservedFields = 0x00002000,
25 StrictDescriptorChecks = 0x00004000,
26 EnableUsb20HardwareLpm = 0x00008000,
27 PreventSuperSpeedDebounce = 0x00010000,
28 AlwaysSecondReset = 0x00020000,
29 EnableUsbLtm = 0x00040000
30};
@ StrictDescriptorChecks
@ EnableExtendedValidation
@ DisableUxdSupport
@ AlwaysSecondReset
@ PreventSuperSpeedDebounce
@ DisableSelectiveSuspendUI
@ UxdDeleteOnReload
@ EnableDiagnosticMode
@ UxdDeleteOnDisconnect
@ DisableOnSoftRemove
@ CheckReservedFields
@ EnableUsb20HardwareLpm
@ UxdDeleteOnShutdown

◆ HubMsOsMode

Enumerator
QueryOnce 
ForceQuery 
NeverQuery 

Definition at line 33 of file hubdriver.h.

34{
35 QueryOnce = 0,
36 ForceQuery = 1,
37 NeverQuery = 2
38};

◆ HubReport

Enumerator
HubResetSucceeded 
HubResetFailed 
DeviceEnumerationFailed 

Definition at line 143 of file hubdriver.h.

144{
146 HubResetFailed = 1,
148};
@ DeviceEnumerationFailed
@ HubResetSucceeded

Function Documentation

◆ _IRQL_requires_()

_IRQL_requires_ ( PASSIVE_LEVEL  )

Sends a synchronous IOCTL to the specified device object.

Parameters
[in]IoControlCodeThe IOCTL to send to the device.
[in]DeviceObjectPointer to the device object that will handle the IOCTL.
[in]InputBufferOptional pointer to a buffer containing input data for the IOCTL. When specified, the buffer should be at least of InputBufferLength size.
[in]InputBufferLengthSize in bytes, of the buffer pointed by InputBuffer.
[out]OutputBufferOptional pointer to a buffer that will receive output data from the IOCTL. When specified, the buffer should be at least of OutputBufferLength size.
[in]OutputBufferLengthSize in bytes, of the buffer pointed by OutputBuffer.
[in]FileObjectOptional pointer to a file object that may be necessary for the IOCTL.
Returns
An NTSTATUS code indicating success or failure of this function.
Note
Must be called at PASSIVE_LEVEL with all APCs enabled.

Nothing is found unless the PCI bus driver publishes the properties.

The root hub name without its prefix; NULL when the PDO has no name.

Grows a private buffer to what the helper asks for.

Lets KMDF handle the IRP, then hands it back here still uncompleted.

Waits for the device machine to answer a PnP or power event; returns the PnP status.

Deletes the UCX endpoints of the disabled pipes, then the interface record.

One 4 byte value; the registry type is not checked.

Reread whenever user experience settings change; the open status is returned.

Sends a synchronous IOCTL to the specified device object.

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

◆ HubCreateReport()

NTSTATUS NTAPI HubCreateReport ( _In_ WDFDEVICE  HubFdo,
_In_ HubReport  Type,
_In_ ULONG  SubReason 
)

Device enumeration failures are throttled per hub, since no device is passed.

Definition at line 151 of file errreport.cpp.

155{
158 WDFWORKITEM WorkItem;
160
162 return HubSubmitLiveDump(HubFdo, HubReportCode(Type), SubReason);
163
166 Attributes.ParentObject = HubFdo;
167
168 Status = WdfWorkItemCreate(&Config, &Attributes, &WorkItem);
169 if (!NT_SUCCESS(Status))
170 {
171 DPRINT1("Hub %p report work item create failed 0x%lx\n", HubFdo, Status);
172 return Status;
173 }
174
175 HubGetReportWork(WorkItem)->Type = Type;
176 HubGetReportWork(WorkItem)->SubReason = SubReason;
178
179 return STATUS_SUCCESS;
180}
Type
Definition: Type.h:7
#define DPRINT1
Definition: precomp.h:8
Definition: fdo.h:132
_In_ ULONG Attributes
Definition: dispmprt.h:1077
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
static VOID NTAPI HubEvtReportWorkItem(_In_ WDFWORKITEM WorkItem)
Definition: errreport.cpp:139
_In_ ULONG _In_ ULONG SubReason
Definition: errreport.cpp:100
static ULONG NTAPI HubReportCode(_In_ HubReport Type)
Definition: errreport.cpp:117
NTSTATUS Status
Definition: errreport.cpp:36
Status
Definition: gdiplustypes.h:24
WdfWorkItemEnqueue(WorkItem)
_In_opt_ PVOID _In_ PUCXHUB_WORKITEM WorkItem
Definition: hubucx.h:227
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
Definition: wdfobject.h:170
FORCEINLINE VOID WDF_WORKITEM_CONFIG_INIT(_Out_ PWDF_WORKITEM_CONFIG Config, _In_ PFN_WDF_WORKITEM EvtWorkItemFunc)
Definition: wdfworkitem.h:85

Referenced by HubEvtReportWorkItem(), and DeviceMachine::ReportEnumFailure().

◆ HubNotifyBootDeviceRemoval()

VOID NTAPI HubNotifyBootDeviceRemoval ( _In_opt_ PVOID  Handle)

Kernel boot device removal notice; nothing when the kernel lacks it or Handle is NULL.

Definition at line 335 of file entry.cpp.

337{
340}
#define NULL
Definition: types.h:112
HubDriverState HubDriver
Definition: entry.cpp:13
ULONG Handle
Definition: gdb_input.c:15
PFN_HUB_NOTIFY_BOOT_DEVICE_REMOVAL NotifyBootDeviceRemoval
Definition: hubdriver.h:113

Referenced by PortMachine::NotifyBootDeviceRemoval(), and DeviceMachine::NotifyWrongDevice().

Variable Documentation

◆ Code

Definition at line 176 of file hubdriver.h.

◆ HubDriver

◆ SubReason

_In_ ULONG _In_ ULONG SubReason

Definition at line 177 of file hubdriver.h.