15#define MSOS_FLAG_CONTAINER_ID 0x02
18#define MSOS_EXT_PROPERTIES_INDEX 5
19#define MSOS_EXT_PROPERTIES_VERSION 0x0100
20#define MSOS_EXT_PROPERTIES_MAX 4096
23#define MSOS20_TYPE_REGISTRY_PROPERTY 4
50#define MSOS_CUSTOM_PROPERTY_FIXED (sizeof(HubMsOsCustomProperty) + sizeof(ULONG))
61 return BcdUsb >= 0x0200 || BcdUsb < 0x0100;
88 const LONG Keep = (
LONG)ChildState::AltEnumCompleted | (
LONG)ChildState::AltEnumCommandSent;
140HubInstallMsOs20Property(
183 DPRINT1(
"Device %p has no MS OS 2.0 descriptor set to install\n",
Child);
202 DPRINT1(
"Device %p MS OS 2.0 descriptor set walk failed\n",
Child);
211 Status = IoSetDevicePropertyData(WdfDeviceWdmGetDeviceObject(
Child->m_Pdo->m_Device),
212 &DEVPKEY_Device_ModelId,
216 sizeof(
Child->m_MsOs20.ModelId->ModelId),
217 Child->m_MsOs20.ModelId->ModelId);
237 case HubMsOsMode::ForceQuery:
238 Child->ClearProperty(ChildProperty::MsOsNotSupported);
241 case HubMsOsMode::NeverQuery:
242 Child->SetProperty(ChildProperty::MsOsNotSupported);
250 !
Child->HasProperty(ChildProperty::MsOsNotSupported) &&
251 Child->m_MsOsVendorCode == 0)
256 return Child->HasHack(ChildHack::AlwaysQueryMsOs);
268 !
Child->HasProperty(ChildProperty::MsOsNotSupported) &&
269 !
Child->HasProperty(ChildProperty::IsComposite))
274 return Child->HasHack(ChildHack::AlwaysQueryMsOs);
286 !
Child->HasProperty(ChildProperty::MsOsNotSupported) &&
287 !
Child->HasHack(ChildHack::SkipContainerIdQuery))
292 return Child->HasHack(ChildHack::AlwaysQueryMsOs);
311 HubRefreshExtPropertiesInstalled(
Child);
312 Installed =
Child->HasProperty(ChildProperty::ExtPropertiesInstalled);
317 if (
Child->HasHack(ChildHack::AlwaysQueryMsOs) && !Installed)
320 if ((BcdUsb >= 0x0100 && BcdUsb <= 0x01FF) ||
322 Child->HasProperty(ChildProperty::MsOsNotSupported))
392 DPRINT1(
"Device %p extended properties header is %lu bytes\n",
405 DPRINT1(
"Device %p extended properties header is invalid\n",
m_Device);
421 DPRINT1(
"Device %p extended properties of %lu bytes could not be allocated\n",
482 DPRINT1(
"Device %p extended properties: %lu of %lu bytes read\n",
489 DPRINT1(
"Device %p extended properties header changed between reads\n",
Child);
#define InterlockedExchange
BOOLEAN AltEnumNeededOnReenum()
BOOLEAN MsOsQueryWanted()
VOID StoreMsOsVendorCode()
BOOLEAN ExtPropertiesWanted()
BOOLEAN AltEnumNeededAfterBos()
BOOLEAN ExtPropertiesValid()
VOID MarkMsOsInstallHandled()
BOOLEAN MsOs20ValuesWanted()
BOOLEAN SetExtPropertiesSemaphore()
BOOLEAN MsOsExtendedConfigSupported()
BOOLEAN WriteCustomProperties()
BOOLEAN InstallMsOs20Values()
VOID MarkContainerIdUnsupported()
BOOLEAN AltEnumNeededInEnum()
BOOLEAN ExtPropertiesHeaderValid()
BOOLEAN MsOsContainerIdSupported()
VOID MarkMsOsUnsupported()
BOOLEAN MsOs20Supported()
BOOLEAN ContainerIdWanted()
VOID FreeExtPropertiesBuffer()
BOOLEAN AllocateExtPropertiesBuffer()
USB_DEVICE_DESCRIPTOR m_OriginalDeviceDescriptor
USB_DEVICE_DESCRIPTOR m_DeviceDescriptor
VOID SetProperty(_In_ ChildProperty Flag)
BOOLEAN HasProperty(_In_ ChildProperty Flag) const
volatile LONG m_StateFlags
HubMsOs20SetInfo m_MsOs20SetInfo
HubControlRequest m_Control
HubMsOsString m_MsOsString
volatile LONG m_Properties
VOID SetState(_In_ ChildState Flag)
BOOLEAN HasState(_In_ ChildState Flag) const
BOOLEAN NTAPI HubDescNextMsOs20(_In_ PUCHAR End, _Inout_ HubMsOs20Common **Current)
#define HUB_MSOS20_ALT_ENUM
#define HUB_MSOS20_REGISTRY
#define HUB_MSOS20_MODEL_ID
#define HUB_MSOS20_SET_INFO
#define DEVPROP_TYPE_GUID
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG DataLength
#define NT_SUCCESS(StatCode)
static DWORD DWORD * dwLength
#define _IRQL_requires_(irql)
#define ExAllocatePoolWithTag(hernya, size, tag)
static BOOLEAN NTAPI HubMsOsVersionAllowed(_In_ HubChild *Child)
#define MSOS_FLAG_CONTAINER_ID
static BOOLEAN NTAPI HubHasMsOs20SetInfo(_In_ HubChild *Child)
return HubWriteDeviceValue(Child, &ValueName, Property->wPropertyDataType, DataLength,(PVOID)(Tail+sizeof(DataLength)))
#define MSOS20_TYPE_REGISTRY_PROPERTY
#define MSOS_EXT_PROPERTIES_INDEX
#define MSOS_EXT_PROPERTIES_MAX
#define MSOS_EXT_PROPERTIES_VERSION
static const HubMsOsExtPropHeader *NTAPI HubExtPropHeader(_In_ HubChild *Child)
#define MSOS_CUSTOM_PROPERTY_FIXED
static BOOLEAN NTAPI HubCustomPropertyValid(_In_reads_bytes_(Total) const UCHAR *Buffer, _In_ ULONG Total, _In_ ULONG Offset, _Out_ PULONG Size)
_In_ PCUNICODE_STRING _Out_ HubUxdSettings * Record
#define RtlEqualMemory(dst, src, len)
#define ExFreePoolWithTag(_P, _T)
#define _In_reads_bytes_(s)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ ULONG _In_ ULONG Offset
struct _URB_CONTROL_TRANSFER_EX Urb
USHORT wPropertyNameLength
#define RtlCopyMemory(Destination, Source, Length)
_In_ WDFCOLLECTION _In_ ULONG Index
#define DECLARE_CONST_UNICODE_STRING(_variablename, _string)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO