37#define HUB_MSOS20_NEWEST_VERSION NTDDI_WIN11_GE
40#define HUB_MSOS20_MAX_DEPTH 8
43 { 0xD8DD60DF, 0x4589, 0x4CC7, { 0x9C, 0xD2, 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F } };
46 { 0xA6C10D69, 0x5E2F, 0x480D, { 0xA5, 0x23, 0x52, 0xC0, 0x56, 0xFA, 0xD4, 0xB4 } };
105 Context->Win8Behavior = Win8Behavior;
106 Context->SspIsochBurstCount = SspIsochBurstCount;
124#define HUB_DESC_NAME(Code) case HubDescCode::Code: return #Code
392 Context->Bitmap[Bit / 32] |= 1UL << (Bit % 32);
403 DPRINT(
"%s %p descriptor check %s (%lu) ignored\n",
408 DPRINT1(
"%s %p descriptor check %s (%lu) failed\n",
423 BOOLEAN Newer =
Ctx->Strictest || Bcd > 0x0200;
431 return Newer ||
Ctx->LegacyStrict;
437 return Ctx->Strictest ||
438 (Bcd >= 0x0201 && Bcd <= 0x0210) ||
439 (Bcd >= 0x0300 && Bcd <= 0x0310);
443 return Ctx->Strictest || (Bcd >= 0x0201 && Bcd < 0x0210);
446 return Ctx->Strictest || (Bcd >= 0x0300 && Bcd <= 0x0310);
449 return Ctx->Strictest || Bcd == 0x0310;
452 return Ctx->ReservedFields;
498 if (
Ctx->Win8Behavior)
533 return (Bits[
Index / 32] & (1UL << (
Index % 32))) != 0;
603 if (Left <
sizeof(*Desc))
611 if (Desc->bLength > Left)
620 if (Desc->bLength <
sizeof(*Desc))
623 if (Desc->bLength == 0)
671 if (
Config->wTotalLength < Needed)
689 if (!
Walk->HadEndpoint)
695 if (!
Walk->GotCompanion)
698 if (
Walk->WantSspCompanion && !
Walk->GotSspCompanion)
717 if (!
Walk->HadInterface)
728 if (
Walk->EndpointsCounted !=
Walk->EndpointsDeclared)
751 if (Desc->bLength <
sizeof(*Desc) &&
757 if (Desc->bLength >
sizeof(*Desc))
766 Number = Desc->bInterfaceNumber;
767 Alternate = Desc->bAlternateSetting;
789 Walk->InterfacesFound++;
797 if (
Walk->Alternate >= Alternate)
802 Walk->EndpointsCounted = 0;
803 Walk->EndpointsDeclared = Desc->bNumEndpoints;
806 Walk->Alternate = Alternate;
824 UCHAR Extra = Desc->bmAttributes & ~USB_ENDPOINT_TYPE_MASK;
825 BOOLEAN BadInterval = Desc->bInterval == 0 || Desc->bInterval > 16;
961 if (Desc->bLength <
sizeof(*Desc) &&
968 if (Desc->bLength >
sizeof(*Desc))
977 if (!
Walk->HadInterface)
983 if ((Desc->bEndpointAddress & 0x0F) == 0)
986 if (Desc->bEndpointAddress & 0x70)
989 if (Desc->bmAttributes & 0xC0)
994 if (
BitIsSet(
Walk->EndpointSeen, Desc->bEndpointAddress))
997 BitSet(
Walk->EndpointSeen, Desc->bEndpointAddress);
998 Walk->EndpointsCounted++;
1001 Walk->LastEndpoint = Desc;
1037 if (Desc->bLength <
sizeof(*Desc) &&
1043 if (Desc->bLength >
sizeof(*Desc))
1046 if (!
Walk->WantCompanion)
1063 Burst = Desc->bMaxBurst;
1066 Ceiling =
Packet * (Burst + 1) * (Mult + 1);
1077 if (Desc->wBytesPerInterval != 0)
1094 if (Desc->wBytesPerInterval != 0)
1102 if (Burst != 0 &&
Packet != 1024)
1108 if (Desc->wBytesPerInterval > Ceiling)
1115 Walk->WantSspCompanion = SspFollows;
1120 if (Burst != 0 &&
Packet != 1024)
1123 if (!SspFollows && Mult > 2)
1129 if (!SspFollows && Desc->wBytesPerInterval > Ceiling)
1132 if (SspFollows && Desc->wBytesPerInterval != 1)
1159 if (Desc->bLength <
sizeof(*Desc) &&
1165 if (Desc->bLength >
sizeof(*Desc))
1168 if (!
Walk->WantSspCompanion)
1183 if (Desc->wReserved != 0)
1186 if (Desc->dwBytesPerInterval < 0xC001 || Desc->dwBytesPerInterval > 0xFFFFFF)
1201 ULONG Declared =
Walk->Config->bNumInterfaces;
1206 if (Desc->bLength <
sizeof(*Desc) &&
1212 if (Desc->bLength >
sizeof(*Desc))
1221 if ((
ULONG)Desc->bFirstInterface + Desc->bInterfaceCount > 256)
1224 if (Desc->bInterfaceCount > Declared)
1228 if (Desc->bInterfaceCount +
Walk->InterfacesFound > Declared)
1231 if (Desc->bInterfaceCount == 0)
1354 DPRINT1(
"%s %p configuration has %lu interfaces, bNumInterfaces %u\n",
1405 for (
i = 0;
i < 16;
i += 4)
1423 if (IsBillboard !=
NULL)
1424 *IsBillboard =
TRUE;
1487 if (
Length <
sizeof(*Bos))
1496 if (Bos->bLength <
sizeof(*Bos))
1500 if (Bos->bLength >
sizeof(*Bos))
1507 if (Bos->wTotalLength <
sizeof(*Bos))
1513 if (Bos->wTotalLength < Minimum)
1520 if (Bos->bNumDeviceCaps == 0)
1541 if (Cap->bLength <
sizeof(*Cap) &&
1547 if (Cap->bLength >
sizeof(*Cap))
1560 if (!Cap->bmAttributes.LPMCapable)
1562 if (Cap->bmAttributes.BESLAndAlternateHIRDSupported)
1571 if (Cap->bmAttributes.BESLAndAlternateHIRDSupported)
1575 Baseline = (
UCHAR)Cap->bmAttributes.BaselineBESL;
1576 Deep = (
UCHAR)Cap->bmAttributes.DeepBESL;
1578 if (Cap->bmAttributes.BaselineBESLValid)
1587 Lpm->Baseline = Baseline;
1591 if (!Cap->bmAttributes.DeepBESLValid)
1594 if (Cap->bmAttributes.BaselineBESLValid && Deep <= Baseline)
1628 if (Cap->bLength <
sizeof(*Cap) &&
1634 if (Cap->bLength >
sizeof(*Cap))
1646 Speeds = Cap->wSpeedsSupported;
1653 if (Cap->bFunctionalitySupport > 3)
1655 else if ((Speeds & (1UL << Cap->bFunctionalitySupport)) == 0)
1661 *
Walk->
U1 = Cap->bU1DevExitLat;
1666 *
Walk->
U2 = Cap->wU2DevExitLat;
1679 ULONG Last = Cap->bmAttributes.SublinkSpeedAttrCount;
1680 ULONG MinimumId = Cap->wFunctionalitySupport.SublinkSpeedAttrID;
1687 for (
i = 0;
i <= Last;
i += 2)
1714 if (Cap->bmSublinkSpeedAttr[
i].SublinkSpeedAttrID != Cap->bmSublinkSpeedAttr[
i + 1].SublinkSpeedAttrID ||
1715 Cap->bmSublinkSpeedAttr[
i].SublinkTypeMode != Cap->bmSublinkSpeedAttr[
i + 1].SublinkTypeMode ||
1716 Cap->bmSublinkSpeedAttr[
i].LinkProtocol != Cap->bmSublinkSpeedAttr[
i + 1].LinkProtocol)
1723 (Cap->bmSublinkSpeedAttr[
i].LaneSpeedExponent != Cap->bmSublinkSpeedAttr[
i + 1].LaneSpeedExponent ||
1724 Cap->bmSublinkSpeedAttr[
i].LaneSpeedMantissa != Cap->bmSublinkSpeedAttr[
i + 1].LaneSpeedMantissa))
1729 if (Cap->bmSublinkSpeedAttr[
i].SublinkSpeedAttrID == MinimumId)
1731 MinimumFound =
TRUE;
1733 Cap->wFunctionalitySupport.MinRxLaneCount != Cap->wFunctionalitySupport.MinTxLaneCount)
1739 if (SeenIds & (1UL << Cap->bmSublinkSpeedAttr[
i].SublinkSpeedAttrID))
1745 SeenIds |= 1UL << Cap->bmSublinkSpeedAttr[
i].SublinkSpeedAttrID;
1750 if (Cap->bmAttributes.SublinkSpeedIDCount + 1UL != Unique)
1769 ULONG Entry =
sizeof(Cap->bmSublinkSpeedAttr[0]);
1772 if (Cap->bLength <
sizeof(*Cap) &&
1778 if (Cap->bLength !=
sizeof(*Cap) +
Entry * Cap->bmAttributes.SublinkSpeedAttrCount)
1787 if (Cap->bmAttributes.Reserved != 0)
1790 if (Cap->wFunctionalitySupport.Reserved != 0)
1793 if (Cap->bReserved != 0)
1796 if (Cap->wReserved != 0)
1815 if (Cap->bLength <
sizeof(*Cap) &&
1821 if (Cap->bLength >
sizeof(*Cap))
1830 if (Cap->bReserved != 0)
1834 if (
IsAllZero(Cap->ContainerID,
sizeof(Cap->ContainerID)))
1872 if (Cap->bLength < Fixed +
sizeof(*Sets) || (Cap->bLength - Fixed) %
sizeof(*Sets) != 0)
1878 Count = (Cap->bLength - Fixed) /
sizeof(*Sets);
1885 if (Sets[
i].dwWindowsVersion == Sets[
j].dwWindowsVersion)
1914 if (Cap->bLength <
sizeof(*Cap))
1921 if (Cap->Version == 1 && Cap->bLength !=
sizeof(*Cap))
1927 if (Cap->Version == 0)
1957 if (Cap->bLength < Fixed &&
1969 if (Cap->bReserved != 0)
1998 if (Cap->bLength <
sizeof(*Cap) &&
2004 if (Cap->bLength >
sizeof(*Cap))
2013 if (Cap->bReserved != 0 ||
2014 Cap->bmAttributes.Reserved1 != 0 ||
2015 Cap->bmAttributes.Reserved2 != 0 ||
2016 Cap->bmAttributes.Reserved3 != 0)
2021 if (Cap->bmAttributes.ChargingPolicy)
2036 ULONG Mode =
sizeof(Cap->AlternateMode[0]);
2042 if (Left <
sizeof(*Cap))
2054 Repaired = (Cap->bLength == 40 || Cap->bLength == 44);
2083 if (Cap->bPreferredAlternateMode >
Modes)
2111 if (Cap->bLength <
sizeof(*Cap) &&
2117 if (
sizeof(*Cap) > Left)
2124 switch (Cap->bDevCapabilityType)
2166 else if (!
Info->DiscardContainerId)
2259 if (Length < Descriptor->wTotalLength)
2342 if (
Info->ChargingPolicy)
2369 *Adjusted = Desc->bLength;
2370 if (Desc->bLength >
Length)
2386 if (Desc->bLength & 1)
2392 if (Desc->bLength !=
Length)
2410 if (AdjustedLength !=
NULL)
2411 *AdjustedLength = Adjusted;
2441 if (Ch <
L' ' || Ch > 0x7F || Ch ==
L',')
2465 return (Ch >=
'A' && Ch <=
'Z') || (Ch >=
'0' && Ch <=
'9') || Ch ==
'_';
2477 for (
i = 0;
i < 8;
i++)
2494 static const WCHAR Expected[7] = {
'M',
'S',
'F',
'T',
'1',
'0',
'0' };
2499 DPRINT1(
"Device %p MS OS string has the wrong signature\n",
Context->LogContext);
2636#define HUB_MSOS20_TYPE_SET_HEADER 0
2637#define HUB_MSOS20_TYPE_CONFIG_SUBSET 1
2638#define HUB_MSOS20_TYPE_FUNCTION_SUBSET 2
2639#define HUB_MSOS20_TYPE_COMPATIBLE_ID 3
2640#define HUB_MSOS20_TYPE_REGISTRY 4
2641#define HUB_MSOS20_TYPE_RESUME_TIME 5
2642#define HUB_MSOS20_TYPE_MODEL_ID 6
2643#define HUB_MSOS20_TYPE_CCGP 7
2666 if (Subset->
wLength <
sizeof(*Subset) || Subset->
wTotalLength <
sizeof(*Subset) +
sizeof(*Desc))
2673 if (Desc->
wLength <
sizeof(*Desc))
2765 if (Subset->
wLength !=
sizeof(*Subset))
2771 if (Subset->
wTotalLength <
sizeof(*Subset) +
sizeof(*Desc))
2778 if (SubsetEnd >
End)
2846 for (
i = 0;
i < 8;
i++)
2848 if (Ended &&
Id[
i] != 0)
2885 if (
Id->wLength !=
sizeof(*
Id))
2977 if (Resume->
wLength !=
sizeof(*Resume))
2995 Info->ResumeTime = Resume;
3018 if (Model->
wLength !=
sizeof(*Model))
3030 Info->ModelId = Model;
3070 switch (Desc->wDescriptorType)
3179HubDescCheckMsOs20Set(
3206 ULONG RemovableBytes;
3230 RemovableBytes = (
Ports + 8) / 8;
3231 PowerBytes = (
Ports + 7) / 8;
3232 Expected = Fixed + RemovableBytes + PowerBytes;
3243 if (
Descriptor->wHubCharacteristics & 0x0002)
3246 if (
Descriptor->wHubCharacteristics & 0xFF00)
3249 if (
Descriptor->bRemoveAndPowerMask[0] & 0x01)
3253 Used = (
Ports + 1) % 8;
3256 Spare = (
UCHAR)(0xFF << Used);
3257 if (
Descriptor->bRemoveAndPowerMask[RemovableBytes - 1] & Spare)
3261 for (
i = 0;
i < PowerBytes;
i++)
3263 if (
Descriptor->bRemoveAndPowerMask[RemovableBytes +
i] != 0xFF)
3283 DPRINT1(
"Hub %p has no SuperSpeed hub descriptor\n",
Context->LogContext);
3309 if (
Descriptor->wHubCharacteristics & 0x0002)
3312 if (
Descriptor->wHubCharacteristics & 0xFFE0)
3322 Spare = (
Ports + 1 < 16) ? (0xFFFFUL << (
Ports + 1)) & 0xFFFF : 0;
3383 ULONG SameNumber = 0;
3386 if (HasAlternates !=
NULL)
3387 *HasAlternates =
FALSE;
3391 Config->wTotalLength <
sizeof(*Config))
3422 if (HasAlternates ==
NULL)
3426 if (SameNumber <= 1)
3436 *HasAlternates =
TRUE;
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
static VOID NTAPI CheckPreviousEndpoint(_Inout_ ConfigWalk *Walk, _Inout_ Verdict *Result)
#define HUB_MSOS20_TYPE_COMPATIBLE_ID
#define HUB_MSOS20_TYPE_SET_HEADER
#define HUB_MSOS20_TYPE_FUNCTION_SUBSET
static VOID NTAPI CheckMsOs20Platform(_Inout_ BosWalk *Walk, _In_ PUSB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR Cap, _Inout_ Verdict *Result)
static BOOLEAN NTAPI WalkMsOs20Set(_In_ const HubDescContext *Ctx, _In_reads_bytes_(Length) PVOID Set, _In_ ULONG Length, _In_ const HubMsOs20SetInfo *SetInfo, _Inout_ HubMsOs20Info *Info)
VOID NTAPI HubDescInitHubContext(_Out_ HubDescContext *Context, _In_ USHORT BcdUsb, _In_ USB_DEVICE_SPEED Speed)
static VOID NTAPI CheckIad(_Inout_ ConfigWalk *Walk, _In_ PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR Desc, _Out_ PULONG Advance, _Inout_ Verdict *Result)
_In_ ULONG _Out_opt_ HubBosInfo * Info
static VOID NTAPI CheckSuperSpeedCap(_Inout_ BosWalk *Walk, _In_ PUSB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR Cap, _Inout_ PULONG Advance, _Inout_ Verdict *Result)
static BOOLEAN NTAPI CheckMsOs20ModelId(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc)
static VOID NTAPI CheckInterface(_Inout_ ConfigWalk *Walk, _In_ PUSB_INTERFACE_DESCRIPTOR Desc, _Out_ PULONG Advance, _Inout_ Verdict *Result)
BOOLEAN NTAPI HubDescNextMsOs20(_In_ PUCHAR End, _Inout_ HubMsOs20Common **Current)
BOOLEAN NTAPI HubDescCheckMsOsString(_In_ const HubDescContext *Context, _In_ const HubMsOsString *Descriptor)
BOOLEAN NTAPI HubDescCheck30Hub(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_30_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
#define HUB_MSOS20_MAX_DEPTH
static BOOLEAN NTAPI CheckMsOs20ResumeTime(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc)
static BOOLEAN NTAPI CheckMsOs20CompatibleId(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc)
BOOLEAN NTAPI HubDescCheckConfiguration(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_CONFIGURATION_DESCRIPTOR Descriptor, _In_ ULONG Length, _Out_opt_ PBOOLEAN SupportsStreams)
VOID NTAPI HubDescLog(_In_ const HubDescContext *Context, _In_ HubDescCode Code, _In_ BOOLEAN Warning)
static VOID NTAPI CheckBillboardCap(_Inout_ BosWalk *Walk, _Inout_ PUSB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR Cap, _Inout_ PULONG Advance, _Inout_ Verdict *Result)
static VOID NTAPI CheckPlatformFeatures(_Inout_ BosWalk *Walk, _In_ HubPlatformFeatures *Cap, _Inout_ Verdict *Result)
_In_ ULONG _Out_opt_ HubBosInfo _Out_opt_ PUSHORT _Out_opt_ PUSHORT _Inout_opt_ PBOOLEAN LtmCapable
static BOOLEAN NTAPI CheckMsOs20SetHeader(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc)
BOOLEAN NTAPI HubDescCheckMsOsExtConfigHeader(_In_ const HubDescContext *Context, _In_reads_bytes_(Length) const HubMsOsExtConfigHeader *Descriptor, _In_ ULONG Length)
if(Length< sizeof(*Descriptor))
static VOID NTAPI CheckConfigFixedPart(_Inout_ ConfigWalk *Walk, _Inout_ Verdict *Result)
BOOLEAN NTAPI HubDescCheckDevice(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_DEVICE_DESCRIPTOR Descriptor, _In_ ULONG Length, _Inout_opt_ PBOOLEAN IsBillboard)
static BOOLEAN NTAPI CheckMsOs20Registry(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc)
static VOID NTAPI CheckSspCompanion(_Inout_ ConfigWalk *Walk, _In_ PUSB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR Desc, _Out_ PULONG Advance, _Inout_ Verdict *Result)
#define HUB_MSOS20_TYPE_RESUME_TIME
#define HUB_MSOS20_TYPE_REGISTRY
_In_ ULONG _In_ const HubMsOs20SetInfo * SetInfo
static VOID NTAPI CheckHeader(_In_ const HubDescContext *Ctx, _In_ PUCHAR Base, _In_ ULONG BufferLength, _In_ PUCHAR End, _In_ PUSB_COMMON_DESCRIPTOR Desc, _Out_ PULONG Advance, _Inout_ Verdict *Result)
static BOOLEAN NTAPI GateApplies(_In_ const HubDescContext *Ctx, _In_ Gate Kind)
static BOOLEAN NTAPI IsMsOsIdChar(_In_ UCHAR Ch)
static VOID NTAPI CheckPowerDeliveryCap(_Inout_ BosWalk *Walk, _In_ PUSB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR Cap, _Inout_ PULONG Advance, _Inout_ Verdict *Result)
static VOID NTAPI NoteFatal(_In_ const HubDescContext *Ctx, _Inout_ Verdict *Result, _In_ HubDescCode Code)
VOID NTAPI HubDescInitDeviceContext(_Out_ HubDescContext *Context, _In_ USHORT BcdUsb, _In_ USB_DEVICE_SPEED Speed, _In_ BOOLEAN Win8Behavior, _In_ ULONG SspIsochBurstCount, _In_opt_ PULONG Bitmap)
BOOLEAN NTAPI HubDescCheck20Hub(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
static Verdict NTAPI CheckStringCore(_In_ const HubDescContext *Ctx, _In_reads_bytes_(Length) PUSB_STRING_DESCRIPTOR Desc, _In_ ULONG Length, _Out_ PULONG Adjusted)
static BOOLEAN NTAPI FieldMatches(_In_ LONG Wanted, _In_ UCHAR Actual)
_In_ ULONG _Out_opt_ HubBosInfo _Out_opt_ PUSHORT U1ExitLatency
#define HUB_MSOS20_TYPE_MODEL_ID
static BOOLEAN NTAPI MsOs20VersionUsable(_In_ ULONG Version)
BOOLEAN NTAPI HubDescCheckSerialNumber(_In_ const HubDescContext *Context, _In_reads_bytes_(*Length) PUSB_STRING_DESCRIPTOR Descriptor, _Inout_ PULONG Length)
static VOID NTAPI CheckSublinkSpeeds(_In_ const HubDescContext *Ctx, _In_ PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR Cap, _In_ ULONG Present, _Inout_ Verdict *Result)
static BOOLEAN NTAPI BitIsSet(_In_reads_(8) const ULONG *Bits, _In_ UCHAR Index)
_In_ ULONG _Out_opt_ HubBosInfo _Out_opt_ PUSHORT _Out_opt_ PUSHORT U2ExitLatency
#define HUB_MSOS20_TYPE_CCGP
static VOID NTAPI CheckContainerIdCap(_Inout_ BosWalk *Walk, _In_ PUSB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR Cap, _Inout_ PULONG Advance, _Inout_ Verdict *Result)
static VOID NTAPI CheckCompanion(_Inout_ ConfigWalk *Walk, _In_ PUSB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR Desc, _Out_ PULONG Advance, _Inout_ Verdict *Result)
static VOID NTAPI CheckBosFixedPart(_In_ const HubDescContext *Ctx, _In_opt_ PUSB_BOS_DESCRIPTOR Bos, _In_ ULONG Length, _Out_ PUCHAR *End, _Out_ PULONG Advance, _Inout_ Verdict *Result)
static BOOLEAN NTAPI CheckMsOs20Feature(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc, _In_ PUCHAR End, _In_ ULONG Depth)
static VOID NTAPI StartCheck(_In_ const HubDescContext *Ctx, _Inout_ Verdict *Result)
PUSB_COMMON_DESCRIPTOR NTAPI HubDescFind(_In_reads_bytes_(TotalLength) PVOID Buffer, _In_ ULONG TotalLength, _In_ PVOID Position, _In_ UCHAR Type)
BOOLEAN NTAPI HubDescCheckMsOsContainerId(_In_ const HubDescContext *Context, _In_reads_bytes_(Length) const HubMsOsContainerId *Descriptor, _In_ ULONG Length)
static BOOLEAN NTAPI AssumeSize(_In_ const HubDescContext *Ctx, _Inout_ Verdict *Result, _In_ HubDescCode Code, _In_ Gate Kind, _In_ ULONG Size, _In_ ULONG Left, _Inout_ PULONG Advance)
static BOOLEAN NTAPI CheckMsOs20Id(_In_ const HubDescContext *Ctx, _In_reads_(8) const UCHAR *Id)
BOOLEAN NTAPI HubDescCheckMsOsContainerIdHeader(_In_ const HubDescContext *Context, _In_reads_bytes_(Length) const HubMsOsHeader *Descriptor, _In_ ULONG Length)
static VOID NTAPI CheckUsb20Cap(_Inout_ BosWalk *Walk, _In_ PUSB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR Cap, _Inout_ PULONG Advance, _Inout_ Verdict *Result)
static BOOLEAN NTAPI IsAllZero(_In_reads_bytes_(Length) const VOID *Buffer, _In_ ULONG Length)
static ULONG NTAPI BytesLeft(_In_ PUCHAR Base, _In_ ULONG BufferLength, _In_ const VOID *Descriptor)
static VOID NTAPI CheckEndpointType(_In_ ConfigWalk *Walk, _In_ PUSB_ENDPOINT_DESCRIPTOR Desc, _Inout_ Verdict *Result)
BOOLEAN NTAPI HubDescCheckString(_In_ const HubDescContext *Context, _In_reads_bytes_(Length) PUSB_STRING_DESCRIPTOR Descriptor, _In_ ULONG Length, _Out_opt_ PULONG AdjustedLength)
static BOOLEAN NTAPI IsSmallPacket(_In_ ULONG Size)
PUSB_INTERFACE_DESCRIPTOR NTAPI HubDescFindInterface(_In_ PUSB_CONFIGURATION_DESCRIPTOR Config, _In_ PVOID Position, _In_ LONG Number, _In_ LONG Alternate, _In_ LONG Class, _In_ LONG SubClass, _In_ LONG Protocol, _Out_opt_ PBOOLEAN HasAlternates)
static BOOLEAN NTAPI CheckMsOs20Subset(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc, _In_ PUCHAR End, _In_ ULONG Depth)
PCSTR NTAPI HubDescCodeName(_In_ HubDescCode Code)
static BOOLEAN NTAPI MsOs20AllowedIn(_In_ BOOLEAN Function, _In_ ULONG Type)
_In_ ULONG _Out_opt_ HubBosInfo _Out_opt_ PUSHORT _Out_opt_ PUSHORT _Inout_opt_ PBOOLEAN _Inout_opt_ HubLpmInfo _Inout_opt_ PULONG DeviceFlags
static VOID NTAPI CheckSuperSpeedPlusCap(_Inout_ BosWalk *Walk, _In_ PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR Cap, _Inout_ PULONG Advance, _Inout_ Verdict *Result)
static VOID NTAPI CheckPreviousInterface(_Inout_ ConfigWalk *Walk, _Inout_ Verdict *Result)
static BOOLEAN NTAPI CheckMsOs20Ccgp(_In_ const HubDescContext *Ctx, _Inout_ HubMsOs20Info *Info, _In_ HubMsOs20Common *Desc)
static VOID NTAPI BitSet(_Inout_updates_(8) PULONG Bits, _In_ UCHAR Index)
static const GUID HubPlatformFeaturesUuid
_In_ ULONG _Out_opt_ HubBosInfo _Out_opt_ PUSHORT _Out_opt_ PUSHORT _Inout_opt_ PBOOLEAN _Inout_opt_ HubLpmInfo * Lpm
static VOID NTAPI CheckEndpoint(_Inout_ ConfigWalk *Walk, _In_ PUSB_ENDPOINT_DESCRIPTOR Desc, _Out_ PULONG Advance, _Inout_ Verdict *Result)
#define HUB_DESC_NAME(Code)
#define HUB_MSOS20_TYPE_CONFIG_SUBSET
BOOLEAN NTAPI HubDescCheckMsOsExtConfig(_In_ const HubDescContext *Context, _In_reads_bytes_(sizeof(HubMsOsExtConfig)) const HubMsOsExtConfig *Descriptor, _In_ ULONG Length)
static BOOLEAN NTAPI IsMsOs10IdValid(_In_reads_(8) const UCHAR *Id)
#define HUB_MSOS20_NEWEST_VERSION
static VOID NTAPI CheckPlatformCap(_Inout_ BosWalk *Walk, _In_ PUSB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR Cap, _Inout_ PULONG Advance, _Inout_ Verdict *Result)
static VOID NTAPI CheckCapability(_Inout_ BosWalk *Walk, _Inout_ PUSB_DEVICE_CAPABILITY_DESCRIPTOR Cap, _Out_ PULONG Advance, _Inout_ Verdict *Result)
BOOLEAN NTAPI HubDescCheckBosHeader(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_BOS_DESCRIPTOR Descriptor, _In_ ULONG Length)
static const GUID HubMsOs20PlatformUuid
static VOID NTAPI Note(_In_ const HubDescContext *Ctx, _Inout_ Verdict *Result, _In_ HubDescCode Code, _In_ Gate Kind)
#define HUB_MSOS20_COMPATIBLE_ID
#define HUB_MSOS20_REGISTRY
#define HUB_BOS_SUPERSPEED_CAPABLE
#define HUB_MSOS20_CONFIG_SUBSET
#define HUB_MSOS20_RESUME_TIME
#define HUB_MSOS20_FUNCTION_SUBSET
#define HUB_DESC_BITMAP_ULONGS
@ SspCapAttributesReserved
@ ConfigTotalLengthTooLarge
@ CompanionControlBytesPerInterval
@ PlatformFeaturesVersion
@ InterfaceBufferTooSmall
@ SspCompanionLengthTooSmall
@ BillboardPreferredInvalid
@ MsOs20MultipleResumeTime
@ IadFirstInterfaceTooLarge
@ Hub20RemovableMissingPort
@ MsOsExtConfigBufferSize
@ FunctionSubsetMisplacedFeature
@ BosBufferLargerThanTotal
@ SsCapAttributesReserved
@ MsOsExtConfigCompatibleId
@ MsOs20RegistryNameTooLarge
@ ConfigSubsetMisplacedFeature
@ FunctionSubsetTotalTooLarge
@ MsOsExtConfigFirstInterface
@ SspCompanionNotSuperSpeed
@ PlatformFeaturesTooSmall
@ MsOs20RegistryDataTooLarge
@ Hub30RemovableMissingPort
@ DeepBeslNotAboveBaseline
@ CompanionInterruptBurst
@ EndpointBeforeInterface
@ EndpointAddressReserved
@ FunctionSubsetFeatureLength
@ SsCapFunctionalityReserved
@ BillboardBufferTooSmall
@ ContainerIdLengthTooLarge
@ CompanionInterruptBytesPerInterval
@ CompanionInterruptAttributes
@ IsochPacketInAlternate0
@ CompanionIsochBytesPerInterval
@ FunctionSubsetTotalTooSmall
@ SspCompanionLengthTooLarge
@ MsOs20CompatibleIdAfterNull
@ MsOs20CompatibleIdLength
@ EndpointAttributesReserved
@ CompanionLengthTooSmall
@ MsOsExtConfigBufferVsLength
@ MsOs20RegistryNameOddOrZero
@ SspCapFunctionalityReserved
@ InterfaceLengthTooLarge
@ InterfaceLengthTooSmall
@ MsOsExtConfigSubCompatibleId
@ InterruptAttributesReserved
@ CompanionControlAttributes
@ SsCapFunctionalityNotInSpeeds
@ MsOsContainerIdBufferSize
@ ConfigSubsetFeatureLength
@ Hub30CharacteristicsReserved
@ SspCompanionBufferTooSmall
@ ConfigTotalLengthTooSmall
@ MsOs20MultipleSetHeaders
@ MsOs20FeatureOutOfOrder
@ CompanionLengthTooLarge
@ MsOsExtConfigLengthVsCount
@ ContainerIdBufferTooSmall
@ CompanionBufferTooSmall
@ PlatformFeaturesMultiple
@ ContainerIdLengthTooSmall
@ CompanionInterruptBurstPacket
@ CompanionBulkBytesPerInterval
@ BillboardLengthTooSmall
@ ConfigSubsetTotalTooSmall
@ ConfigSubsetTotalTooLarge
@ CompanionIsochBurstPacket
@ ConfigMissingSspCompanion
@ MsOs20TotalLengthMismatch
@ SerialNumberBadCharacter
@ ControlAttributesReserved
@ Hub30DecodeLatencyReserved
@ Hub20CharacteristicsReserved
@ CapMultipleSuperSpeedPlus
@ SspAttrSymmetricMismatch
@ MsOs20MultipleCompatibleId
@ CompanionIsochBytesNotOne
@ ConfigBufferTooSmallForInterfaces
#define HUB_MSOS20_MODEL_ID
#define HUB_BOS_ENHANCED_SUPERSPEED_CAPABLE
#define HUB_BOS_CHARGING_POLICY
#define HUB_MSOS20_SET_HEADER
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG DataLength
#define _IRQL_requires_(irql)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
@ EnableExtendedValidation
_In_ PCWSTR _Out_ PULONG _Out_ PBOOLEAN Present
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT Endpoint
#define RtlEqualMemory(dst, src, len)
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
#define _In_reads_bytes_(s)
#define _Inout_updates_(s)
#define _Inout_updates_bytes_(s)
#define _In_reads_bytes_opt_(s)
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
_In_ ULONG _In_ ULONG _In_ ULONG Length
static PS2_PORT Ports[PS2_PORTS]
#define IsEqualGUID(rguid1, rguid2)
PACPI_METHOD_ARGUMENT Next
const HubDescContext * Ctx
const HubDescContext * Ctx
PUSB_CONFIGURATION_DESCRIPTOR Config
PUSB_ENDPOINT_DESCRIPTOR LastEndpoint
HubPlatformFeatures * PlatformFeatures
HubMsOs20SetInfo * MsOs20SetInfo
BOOLEAN DiscardContainerId
BOOLEAN HasFlag(_In_ HubGlobal Flag) const
USHORT wPropertyNameLength
UCHAR bResumeSignalingTime
UCHAR bResumeRecoveryTime
static const VBE_MODE Modes[VBE_MODE_COUNT]
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
#define USB_ENDPOINT_TYPE_INTERRUPT
#define USB_CONFIGURATION_DESCRIPTOR_TYPE
#define USB_ENDPOINT_DESCRIPTOR_TYPE
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
#define USB_ENDPOINT_TYPE_CONTROL
#define USB_DEVICE_DESCRIPTOR_TYPE
#define USB_STRING_DESCRIPTOR_TYPE
#define USB_ENDPOINT_TYPE_ISOCHRONOUS
struct _USB_COMMON_DESCRIPTOR * PUSB_COMMON_DESCRIPTOR
struct _USB_INTERFACE_DESCRIPTOR USB_INTERFACE_DESCRIPTOR
#define USB_ENDPOINT_TYPE_MASK
#define USB_INTERFACE_DESCRIPTOR_TYPE
struct _USB_COMMON_DESCRIPTOR USB_COMMON_DESCRIPTOR
#define USB_ENDPOINT_TYPE_BULK
#define USB_DEVICE_CLASS_BILLBOARD
enum _USB_DEVICE_SPEED USB_DEVICE_SPEED
#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE
#define USB_20_HUB_DESCRIPTOR_TYPE
#define USB_30_HUB_DESCRIPTOR_TYPE
#define USB_DEVICE_CAPABILITY_CONTAINER_ID
#define USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_RESERVED_MASK
#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_MODE_SYMMETRIC
#define USB_DEVICE_CAPABILITY_SUPERSPEED_USB
struct _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR * PUSB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR
#define USB_BOS_DESCRIPTOR_TYPE
#define USB_DEVICE_CAPABILITY_SUPERSPEED_U2_DEVICE_EXIT_MAX_VALUE
struct _USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR * PUSB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR
#define USB_DEVICE_CAPABILITY_PLATFORM
#define USB_DEVICE_CAPABILITY_BILLBOARD
struct _USB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR * PUSB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR
struct _USB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR * PUSB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR
#define USB_DEVICE_CAPABILITY_SUPERSPEED_U1_DEVICE_EXIT_MAX_VALUE
#define USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR_TYPE
#define USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_TYPE
#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB
#define USB_DEVICE_CAPABILITY_POWER_DELIVERY
#define USB_DEVICE_CAPABILITY_USB20_EXTENSION_BMATTRIBUTES_RESERVED_MASK
#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_RX
#define USB_DEVICE_CAPABILITY_SUPERSPEED_BMATTRIBUTES_RESERVED_MASK
#define USB_DEVICE_CAPABILITY_DESCRIPTOR_TYPE
#define USB_DEVICE_CAPABILITY_USB20_EXTENSION
struct _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR * PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR
#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_TX
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor