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

Go to the source code of this file.

Classes

struct  HubSha1
 

Macros

#define HUB_ENUM_DEVICE_DESCRIPTOR_FAILED   0x40010000
 
#define HUB_ENUM_SET_ADDRESS_FAILED   0x40010001
 
#define HUB_ENUM_PORT_RESET_FAILED   0x40010002
 
#define HUB_ENUM_BAD_CONFIG_DESCRIPTOR   0x40010004
 
#define HUB_ENUM_BAD_DEVICE_DESCRIPTOR   0x40010005
 
#define HUB_ENUM_CONFIG_DESCRIPTOR_FAILED   0x40010007
 
#define HUB_ENUM_SET_SEL_FAILED   0x4001000A
 
#define HUB_ENUM_BOS_FAILED   0x4001000B
 
#define HUB_ENUM_QUALIFIER_FAILED   0x4001000C
 
#define HUB_ENUM_SERIAL_NUMBER_FAILED   0x4001000D
 
#define HUB_ENUM_LANGUAGE_IDS_FAILED   0x4001000E
 
#define HUB_ENUM_PRODUCT_STRING_FAILED   0x4001000F
 
#define HUB_ENUM_MSOS_EXT_CONFIG_FAILED   0x40010010
 
#define HUB_ENUM_MSOS_CONTAINER_ID_FAILED   0x40010011
 
#define HUB_ENUM_BAD_BOS   0x40010012
 
#define HUB_ENUM_BAD_QUALIFIER   0x40010013
 
#define HUB_ENUM_BAD_LANGUAGE_IDS   0x40010014
 
#define HUB_ENUM_BAD_MSOS_CONTAINER_ID   0x40010015
 
#define HUB_ENUM_BAD_MSOS_EXT_CONFIG   0x40010016
 
#define HUB_ENUM_BAD_PRODUCT_STRING   0x40010017
 
#define HUB_ENUM_BAD_SERIAL_NUMBER   0x40010018
 
#define HUB_ENUM_LINK_SS_INACTIVE   0x40010019
 
#define HUB_ENUM_LINK_COMPLIANCE   0x4001001A
 
#define HUB_ENUM_INCOMPATIBLE   0x4001001B
 
#define HUB_ENUM_MSOS20_SET_FAILED   0x4001001C
 
#define HUB_ENUM_BAD_MSOS20_SET   0x4001001D
 
#define HUB_ENUM_ALT_ENUM_FAILED   0x4001001E
 
#define HUB_ENUM_BAD_BILLBOARD_URL   0x4001001F
 
#define HUB_ENUM_BAD_ALT_MODE_STRING   0x40010020
 
#define HUB_SERIAL_PREFIX_BYTES   (6 * sizeof(WCHAR))
 
#define HUB_SHA1_DIGEST_BYTES   20
 

Functions

VOID NTAPI HubSha1Init (_Out_ HubSha1 *Context)
 
VOID NTAPI HubSha1Update (_Inout_ HubSha1 *Context, _In_reads_bytes_(Length) const VOID *Data, _In_ SIZE_T Length)
 
VOID NTAPI HubSha1Final (_Inout_ HubSha1 *Context, _Out_writes_bytes_all_(HUB_SHA1_DIGEST_BYTES) PUCHAR Digest)
 
FORCEINLINE VOID NTAPI HubSetPortProperty (_In_ HubPort *Port, _In_ PortProperty Property)
 
FORCEINLINE VOID NTAPI HubClearPortProperty (_In_ HubPort *Port, _In_ PortProperty Property)
 
 _IRQL_requires_ (PASSIVE_LEVEL) NTSTATUS NTAPI HubConnectorRegisterPort(_In_ HubPort *Port)
 Sends a synchronous IOCTL to the specified device object.
 

Macro Definition Documentation

◆ HUB_ENUM_ALT_ENUM_FAILED

#define HUB_ENUM_ALT_ENUM_FAILED   0x4001001E

Definition at line 37 of file hubid.h.

◆ HUB_ENUM_BAD_ALT_MODE_STRING

#define HUB_ENUM_BAD_ALT_MODE_STRING   0x40010020

Definition at line 39 of file hubid.h.

◆ HUB_ENUM_BAD_BILLBOARD_URL

#define HUB_ENUM_BAD_BILLBOARD_URL   0x4001001F

Definition at line 38 of file hubid.h.

◆ HUB_ENUM_BAD_BOS

#define HUB_ENUM_BAD_BOS   0x40010012

Definition at line 25 of file hubid.h.

◆ HUB_ENUM_BAD_CONFIG_DESCRIPTOR

#define HUB_ENUM_BAD_CONFIG_DESCRIPTOR   0x40010004

Definition at line 14 of file hubid.h.

◆ HUB_ENUM_BAD_DEVICE_DESCRIPTOR

#define HUB_ENUM_BAD_DEVICE_DESCRIPTOR   0x40010005

Definition at line 15 of file hubid.h.

◆ HUB_ENUM_BAD_LANGUAGE_IDS

#define HUB_ENUM_BAD_LANGUAGE_IDS   0x40010014

Definition at line 27 of file hubid.h.

◆ HUB_ENUM_BAD_MSOS20_SET

#define HUB_ENUM_BAD_MSOS20_SET   0x4001001D

Definition at line 36 of file hubid.h.

◆ HUB_ENUM_BAD_MSOS_CONTAINER_ID

#define HUB_ENUM_BAD_MSOS_CONTAINER_ID   0x40010015

Definition at line 28 of file hubid.h.

◆ HUB_ENUM_BAD_MSOS_EXT_CONFIG

#define HUB_ENUM_BAD_MSOS_EXT_CONFIG   0x40010016

Definition at line 29 of file hubid.h.

◆ HUB_ENUM_BAD_PRODUCT_STRING

#define HUB_ENUM_BAD_PRODUCT_STRING   0x40010017

Definition at line 30 of file hubid.h.

◆ HUB_ENUM_BAD_QUALIFIER

#define HUB_ENUM_BAD_QUALIFIER   0x40010013

Definition at line 26 of file hubid.h.

◆ HUB_ENUM_BAD_SERIAL_NUMBER

#define HUB_ENUM_BAD_SERIAL_NUMBER   0x40010018

Definition at line 31 of file hubid.h.

◆ HUB_ENUM_BOS_FAILED

#define HUB_ENUM_BOS_FAILED   0x4001000B

Definition at line 18 of file hubid.h.

◆ HUB_ENUM_CONFIG_DESCRIPTOR_FAILED

#define HUB_ENUM_CONFIG_DESCRIPTOR_FAILED   0x40010007

Definition at line 16 of file hubid.h.

◆ HUB_ENUM_DEVICE_DESCRIPTOR_FAILED

#define HUB_ENUM_DEVICE_DESCRIPTOR_FAILED   0x40010000

Definition at line 11 of file hubid.h.

◆ HUB_ENUM_INCOMPATIBLE

#define HUB_ENUM_INCOMPATIBLE   0x4001001B

Definition at line 34 of file hubid.h.

◆ HUB_ENUM_LANGUAGE_IDS_FAILED

#define HUB_ENUM_LANGUAGE_IDS_FAILED   0x4001000E

Definition at line 21 of file hubid.h.

◆ HUB_ENUM_LINK_COMPLIANCE

#define HUB_ENUM_LINK_COMPLIANCE   0x4001001A

Definition at line 33 of file hubid.h.

◆ HUB_ENUM_LINK_SS_INACTIVE

#define HUB_ENUM_LINK_SS_INACTIVE   0x40010019

Definition at line 32 of file hubid.h.

◆ HUB_ENUM_MSOS20_SET_FAILED

#define HUB_ENUM_MSOS20_SET_FAILED   0x4001001C

Definition at line 35 of file hubid.h.

◆ HUB_ENUM_MSOS_CONTAINER_ID_FAILED

#define HUB_ENUM_MSOS_CONTAINER_ID_FAILED   0x40010011

Definition at line 24 of file hubid.h.

◆ HUB_ENUM_MSOS_EXT_CONFIG_FAILED

#define HUB_ENUM_MSOS_EXT_CONFIG_FAILED   0x40010010

Definition at line 23 of file hubid.h.

◆ HUB_ENUM_PORT_RESET_FAILED

#define HUB_ENUM_PORT_RESET_FAILED   0x40010002

Definition at line 13 of file hubid.h.

◆ HUB_ENUM_PRODUCT_STRING_FAILED

#define HUB_ENUM_PRODUCT_STRING_FAILED   0x4001000F

Definition at line 22 of file hubid.h.

◆ HUB_ENUM_QUALIFIER_FAILED

#define HUB_ENUM_QUALIFIER_FAILED   0x4001000C

Definition at line 19 of file hubid.h.

◆ HUB_ENUM_SERIAL_NUMBER_FAILED

#define HUB_ENUM_SERIAL_NUMBER_FAILED   0x4001000D

Definition at line 20 of file hubid.h.

◆ HUB_ENUM_SET_ADDRESS_FAILED

#define HUB_ENUM_SET_ADDRESS_FAILED   0x40010001

Definition at line 12 of file hubid.h.

◆ HUB_ENUM_SET_SEL_FAILED

#define HUB_ENUM_SET_SEL_FAILED   0x4001000A

Definition at line 17 of file hubid.h.

◆ HUB_SERIAL_PREFIX_BYTES

#define HUB_SERIAL_PREFIX_BYTES   (6 * sizeof(WCHAR))

Definition at line 42 of file hubid.h.

◆ HUB_SHA1_DIGEST_BYTES

#define HUB_SHA1_DIGEST_BYTES   20

Definition at line 53 of file hubid.h.

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.

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.

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.

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.

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.

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.

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.

STATUS_SUCCESS when the caller's token is an administrator's.

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.

STATUS_SUCCESS when the caller's token is an administrator's.

Sends a synchronous IOCTL to the specified device object.

Reads one value of a walk. A missing value only clears Present; FALSE means stop.

Reads up to Size bytes of a value into a zeroed buffer; the type is not checked.

Writes a REG_BINARY value into the device's usbflags subkey.

Sets or clears ExtPropertiesInstalled from ExtPropDescSemaphore in the hardware key.

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.

STATUS_SUCCESS when the caller's token is an administrator's.

Sends a synchronous IOCTL to the specified device object.

Reads one value of a walk. A missing value only clears Present; FALSE means stop.

Reads up to Size bytes of a value into a zeroed buffer; the type is not checked.

Writes a REG_BINARY value into the device's usbflags subkey.

Sets or clears ExtPropertiesInstalled from ExtPropDescSemaphore in the hardware key.

Fails only when a port cannot be bound to the USB4 host router its ACPI node names.

Assigns device, hardware, compatible, container and instance ids to a new child PDO.

Answers IRP_MN_QUERY_DEVICE_TEXT on a child PDO; always completes the IRP.

Takes the connector map lock, needed around HubConnectorFindCompanion.

Device hardware key values read at PDO prepare hardware.

Saves the MS OS 2.0 set info in usbflags when the set asks for alternate enumeration.

MsOs20Flags and EnumerationRetryCount, written at PDO start.

Rereads the UXD record; UpdateRequired says whether the device id changes.

Replacement PnP id of a UXD reserved device, or an empty String. Always succeeds.

Telemetry values under the device's Ceip subkey.

BootPathSurpriseRemovalCount + 1.

This machine's dual role features for a dual role partner.

Tells UCX the WDM PDO of the device; call right after the child PDO was created.

IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME: Argument1 and its length Argument2.

IOCTL_INTERNAL_USB_GET_BUS_INFO for the device: the 16 byte USB_BUS_NOTIFICATION at Argument1.

Registers the GUID_USB_WMI_NODE_INFO instance of a child PDO (not for hubs or composites).

Registers the boot device surprise removal event on an external, non hub boot PDO.

Fires the boot device surprise removal event, if one is registered.

Sends a synchronous IOCTL to the specified device object.

Publishes "<port>#<host>" for every bound port on the hub's PDO. QUIRK: with no bound port an older value is left in place.

Binds USB 3 ports to the host routers named by the USB4 DVSEC; an earlier ACPI mapping wins.

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.

STATUS_SUCCESS when the caller's token is an administrator's.

Sends a synchronous IOCTL to the specified device object.

Reads one value of a walk. A missing value only clears Present; FALSE means stop.

Reads up to Size bytes of a value into a zeroed buffer; the type is not checked.

Writes a REG_BINARY value into the device's usbflags subkey.

Sets or clears ExtPropertiesInstalled from ExtPropDescSemaphore in the hardware key.

Fails only when a port cannot be bound to the USB4 host router its ACPI node names.

Assigns device, hardware, compatible, container and instance ids to a new child PDO.

Answers IRP_MN_QUERY_DEVICE_TEXT on a child PDO; always completes the IRP.

Takes the connector map lock, needed around HubConnectorFindCompanion.

Device hardware key values read at PDO prepare hardware.

Saves the MS OS 2.0 set info in usbflags when the set asks for alternate enumeration.

MsOs20Flags and EnumerationRetryCount, written at PDO start.

Rereads the UXD record; UpdateRequired says whether the device id changes.

Replacement PnP id of a UXD reserved device, or an empty String. Always succeeds.

Telemetry values under the device's Ceip subkey.

BootPathSurpriseRemovalCount + 1.

This machine's dual role features for a dual role partner.

Tells UCX the WDM PDO of the device; call right after the child PDO was created.

IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME: Argument1 and its length Argument2.

IOCTL_INTERNAL_USB_GET_BUS_INFO for the device: the 16 byte USB_BUS_NOTIFICATION at Argument1.

Registers the GUID_USB_WMI_NODE_INFO instance of a child PDO (not for hubs or composites).

Registers the boot device surprise removal event on an external, non hub boot PDO.

Fires the boot device surprise removal event, if one is registered.

Sends a synchronous IOCTL to the specified device object.

Publishes "<port>#<host>" for every bound port on the hub's PDO. QUIRK: with no bound port an older value is left in place.

Binds USB 3 ports to the host routers named by the USB4 DVSEC; an earlier ACPI mapping wins.

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

Copies up to Size bytes of a device property; a failed query leaves the field zero.

Only the controller name length is real; both bandwidth fields read 0.

The answer overlays a USB_HUB_NAME on TotalSize, so TotalSize comes back as the name length + 4.

Evaluates a method without arguments into Output.

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.

STATUS_SUCCESS when the caller's token is an administrator's.

Sends a synchronous IOCTL to the specified device object.

Reads one value of a walk. A missing value only clears Present; FALSE means stop.

Reads up to Size bytes of a value into a zeroed buffer; the type is not checked.

Writes a REG_BINARY value into the device's usbflags subkey.

Sets or clears ExtPropertiesInstalled from ExtPropDescSemaphore in the hardware key.

Fails only when a port cannot be bound to the USB4 host router its ACPI node names.

Assigns device, hardware, compatible, container and instance ids to a new child PDO.

Answers IRP_MN_QUERY_DEVICE_TEXT on a child PDO; always completes the IRP.

Takes the connector map lock, needed around HubConnectorFindCompanion.

Device hardware key values read at PDO prepare hardware.

Saves the MS OS 2.0 set info in usbflags when the set asks for alternate enumeration.

MsOs20Flags and EnumerationRetryCount, written at PDO start.

Rereads the UXD record; UpdateRequired says whether the device id changes.

Replacement PnP id of a UXD reserved device, or an empty String. Always succeeds.

Telemetry values under the device's Ceip subkey.

BootPathSurpriseRemovalCount + 1.

This machine's dual role features for a dual role partner.

Tells UCX the WDM PDO of the device; call right after the child PDO was created.

IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME: Argument1 and its length Argument2.

IOCTL_INTERNAL_USB_GET_BUS_INFO for the device: the 16 byte USB_BUS_NOTIFICATION at Argument1.

Registers the GUID_USB_WMI_NODE_INFO instance of a child PDO (not for hubs or composites).

Registers the boot device surprise removal event on an external, non hub boot PDO.

Fires the boot device surprise removal event, if one is registered.

Sends a synchronous IOCTL to the specified device object.

Publishes "<port>#<host>" for every bound port on the hub's PDO. QUIRK: with no bound port an older value is left in place.

Binds USB 3 ports to the host routers named by the USB4 DVSEC; an earlier ACPI mapping wins.

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

Copies up to Size bytes of a device property; a failed query leaves the field zero.

Only the controller name length is real; both bandwidth fields read 0.

The answer overlays a USB_HUB_NAME on TotalSize, so TotalSize comes back as the name length + 4.

Evaluates a method without arguments into Output.

Drops every MSI descriptor and keeps only lists that still offer a line interrupt.

Picks the list with the best MSI offer: MSI-X first, then the most messages.

Keeps message descriptors covering Wanted messages and removes the others.

Evaluates _DSM on the controller ACPI object with a buffer as Arg3; returns up to 8 result bytes, 0 on failure.

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.

STATUS_SUCCESS when the caller's token is an administrator's.

Sends a synchronous IOCTL to the specified device object.

Reads one value of a walk. A missing value only clears Present; FALSE means stop.

Reads up to Size bytes of a value into a zeroed buffer; the type is not checked.

Writes a REG_BINARY value into the device's usbflags subkey.

Sets or clears ExtPropertiesInstalled from ExtPropDescSemaphore in the hardware key.

Fails only when a port cannot be bound to the USB4 host router its ACPI node names.

Assigns device, hardware, compatible, container and instance ids to a new child PDO.

Answers IRP_MN_QUERY_DEVICE_TEXT on a child PDO; always completes the IRP.

Takes the connector map lock, needed around HubConnectorFindCompanion.

Device hardware key values read at PDO prepare hardware.

Saves the MS OS 2.0 set info in usbflags when the set asks for alternate enumeration.

MsOs20Flags and EnumerationRetryCount, written at PDO start.

Rereads the UXD record; UpdateRequired says whether the device id changes.

Replacement PnP id of a UXD reserved device, or an empty String. Always succeeds.

Telemetry values under the device's Ceip subkey.

BootPathSurpriseRemovalCount + 1.

This machine's dual role features for a dual role partner.

Tells UCX the WDM PDO of the device; call right after the child PDO was created.

IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME: Argument1 and its length Argument2.

IOCTL_INTERNAL_USB_GET_BUS_INFO for the device: the 16 byte USB_BUS_NOTIFICATION at Argument1.

Registers the GUID_USB_WMI_NODE_INFO instance of a child PDO (not for hubs or composites).

Registers the boot device surprise removal event on an external, non hub boot PDO.

Fires the boot device surprise removal event, if one is registered.

Sends a synchronous IOCTL to the specified device object.

Publishes "<port>#<host>" for every bound port on the hub's PDO. QUIRK: with no bound port an older value is left in place.

Binds USB 3 ports to the host routers named by the USB4 DVSEC; an earlier ACPI mapping wins.

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

Copies up to Size bytes of a device property; a failed query leaves the field zero.

Only the controller name length is real; both bandwidth fields read 0.

The answer overlays a USB_HUB_NAME on TotalSize, so TotalSize comes back as the name length + 4.

Evaluates a method without arguments into Output.

Drops every MSI descriptor and keeps only lists that still offer a line interrupt.

Picks the list with the best MSI offer: MSI-X first, then the most messages.

Keeps message descriptors covering Wanted messages and removes the others.

Evaluates _DSM on the controller ACPI object with a buffer as Arg3; returns up to 8 result bytes, 0 on failure.

Lets UCX hook the controller device init. Call before WdfDeviceCreate.

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.

STATUS_SUCCESS when the caller's token is an administrator's.

Sends a synchronous IOCTL to the specified device object.

Reads one value of a walk. A missing value only clears Present; FALSE means stop.

Reads up to Size bytes of a value into a zeroed buffer; the type is not checked.

Writes a REG_BINARY value into the device's usbflags subkey.

Sets or clears ExtPropertiesInstalled from ExtPropDescSemaphore in the hardware key.

Fails only when a port cannot be bound to the USB4 host router its ACPI node names.

Assigns device, hardware, compatible, container and instance ids to a new child PDO.

Answers IRP_MN_QUERY_DEVICE_TEXT on a child PDO; always completes the IRP.

Takes the connector map lock, needed around HubConnectorFindCompanion.

Device hardware key values read at PDO prepare hardware.

Saves the MS OS 2.0 set info in usbflags when the set asks for alternate enumeration.

MsOs20Flags and EnumerationRetryCount, written at PDO start.

Rereads the UXD record; UpdateRequired says whether the device id changes.

Replacement PnP id of a UXD reserved device, or an empty String. Always succeeds.

Telemetry values under the device's Ceip subkey.

BootPathSurpriseRemovalCount + 1.

This machine's dual role features for a dual role partner.

Tells UCX the WDM PDO of the device; call right after the child PDO was created.

IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME: Argument1 and its length Argument2.

IOCTL_INTERNAL_USB_GET_BUS_INFO for the device: the 16 byte USB_BUS_NOTIFICATION at Argument1.

Registers the GUID_USB_WMI_NODE_INFO instance of a child PDO (not for hubs or composites).

Registers the boot device surprise removal event on an external, non hub boot PDO.

Fires the boot device surprise removal event, if one is registered.

Sends a synchronous IOCTL to the specified device object.

Publishes "<port>#<host>" for every bound port on the hub's PDO. QUIRK: with no bound port an older value is left in place.

Binds USB 3 ports to the host routers named by the USB4 DVSEC; an earlier ACPI mapping wins.

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

Copies up to Size bytes of a device property; a failed query leaves the field zero.

Only the controller name length is real; both bandwidth fields read 0.

The answer overlays a USB_HUB_NAME on TotalSize, so TotalSize comes back as the name length + 4.

Evaluates a method without arguments into Output.

Drops every MSI descriptor and keeps only lists that still offer a line interrupt.

Picks the list with the best MSI offer: MSI-X first, then the most messages.

Keeps message descriptors covering Wanted messages and removes the others.

Evaluates _DSM on the controller ACPI object with a buffer as Arg3; returns up to 8 result bytes, 0 on failure.

Lets UCX hook the controller device init. Call before WdfDeviceCreate.

Definition at line 13147 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

◆ HubClearPortProperty()

FORCEINLINE VOID NTAPI HubClearPortProperty ( _In_ HubPort *  Port,
_In_ PortProperty  Property 
)

Definition at line 87 of file hubid.h.

90{
91 InterlockedAnd((PLONG)&Port->m_Info.Properties, ~(LONG)Property);
92}
CPPORT Port[4]
Definition: headless.c:38
#define InterlockedAnd
Definition: interlocked.h:77
long LONG
Definition: pedump.c:60
int32_t * PLONG
Definition: typedefs.h:58

◆ HubSetPortProperty()

FORCEINLINE VOID NTAPI HubSetPortProperty ( _In_ HubPort *  Port,
_In_ PortProperty  Property 
)

Definition at line 77 of file hubid.h.

80{
81 InterlockedOr((PLONG)&Port->m_Info.Properties, (LONG)Property);
82}
#define InterlockedOr
Definition: interlocked.h:239

◆ HubSha1Final()

VOID NTAPI HubSha1Final ( _Inout_ HubSha1 *  Context,
_Out_writes_bytes_all_(HUB_SHA1_DIGEST_BYTES) PUCHAR  Digest 
)

Definition at line 132 of file hubsha1.cpp.

135{
136 ULONG64 Bits = Context->TotalBytes * 8;
137 ULONG Index;
138
139 Context->Block[Context->BlockUsed++] = 0x80;
140
141 if (Context->BlockUsed > sizeof(Context->Block) - 8)
142 {
143 RtlZeroMemory(&Context->Block[Context->BlockUsed], sizeof(Context->Block) - Context->BlockUsed);
144 HubSha1Compress(Context->State, Context->Block);
145 Context->BlockUsed = 0;
146 }
147
148 RtlZeroMemory(&Context->Block[Context->BlockUsed], sizeof(Context->Block) - 8 - Context->BlockUsed);
149
150 for (Index = 0; Index < 8; Index++)
151 Context->Block[56 + Index] = (UCHAR)(Bits >> (56 - Index * 8));
152
153 HubSha1Compress(Context->State, Context->Block);
154
155 for (Index = 0; Index < HUB_SHA1_DIGEST_BYTES; Index++)
156 Digest[Index] = (UCHAR)(Context->State[Index / 4] >> (24 - (Index % 4) * 8));
157
159}
#define HUB_SHA1_DIGEST_BYTES
Definition: hubid.h:53
static VOID NTAPI HubSha1Compress(_Inout_updates_(5) PULONG State, _In_reads_bytes_(64) const UCHAR *Block)
Definition: hubsha1.cpp:26
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned char UCHAR
Definition: typedefs.h:53
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_In_ WDFCOLLECTION _In_ ULONG Index
FORCEINLINE PVOID RtlSecureZeroMemory(_Out_writes_bytes_all_(Size) PVOID Pointer, _In_ SIZE_T Size)
Definition: rtlfuncs.h:3149

Referenced by HubIdGenerateContainerId().

◆ HubSha1Init()

VOID NTAPI HubSha1Init ( _Out_ HubSha1 *  Context)

Definition at line 90 of file hubsha1.cpp.

92{
93 RtlZeroMemory(Context, sizeof(*Context));
94 Context->State[0] = 0x67452301;
95 Context->State[1] = 0xEFCDAB89;
96 Context->State[2] = 0x98BADCFE;
97 Context->State[3] = 0x10325476;
98 Context->State[4] = 0xC3D2E1F0;
99}

Referenced by HubIdGenerateContainerId().

◆ HubSha1Update()

VOID NTAPI HubSha1Update ( _Inout_ HubSha1 *  Context,
_In_reads_bytes_(Length) const VOID *  Data,
_In_ SIZE_T  Length 
)

Definition at line 103 of file hubsha1.cpp.

107{
108 const UCHAR* Bytes = (const UCHAR*)Data;
109 SIZE_T Chunk;
110
111 Context->TotalBytes += Length;
112
113 while (Length != 0)
114 {
115 Chunk = min(Length, sizeof(Context->Block) - Context->BlockUsed);
116 RtlCopyMemory(&Context->Block[Context->BlockUsed], Bytes, Chunk);
117 Context->BlockUsed += (ULONG)Chunk;
118 Bytes += Chunk;
119 Length -= Chunk;
120
121 if (Context->BlockUsed == sizeof(Context->Block))
122 {
123 HubSha1Compress(Context->State, Context->Block);
124 Context->BlockUsed = 0;
125 }
126 }
127}
_In_ UINT Bytes
Definition: mmcopy.h:9
#define min(a, b)
Definition: monoChain.cc:55
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by HubIdGenerateContainerId().