ReactOS 0.4.17-dev-1281-g065abb3
hubdescval.cpp File Reference
#include "usbhub3.h"
#include <debug.h>
Include dependency graph for hubdescval.cpp:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static VOID NTAPI HubLogHubFinding (_In_opt_ PVOID Context, _In_ HubDescCode Code, _In_ BOOLEAN Warning)
 
static VOID NTAPI HubBuildDescContext (_In_ HubFdo *Hub, _Out_ HubDescContext *Context)
 
BOOLEAN NTAPI HubValidateHubConfiguration (_In_ HubFdo *Hub, _In_reads_bytes_(Length) PUSB_CONFIGURATION_DESCRIPTOR Descriptor, _In_ ULONG Length)
 
BOOLEAN NTAPI HubCheckUsb2HubDescriptor (_In_ HubFdo *Hub, _In_reads_bytes_(Length) PUSB_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
 
BOOLEAN NTAPI HubCheckUsb3HubDescriptor (_In_ HubFdo *Hub, _In_reads_bytes_(Length) PUSB_30_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
 
VOID NTAPI HubLogConfigTotalLengthMismatch (_In_ HubFdo *Hub)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file hubdescval.cpp.

Function Documentation

◆ HubBuildDescContext()

static VOID NTAPI HubBuildDescContext ( _In_ HubFdo *  Hub,
_Out_ HubDescContext *  Context 
)
static

Definition at line 35 of file hubdescval.cpp.

38{
41 Context->LogContext = Hub;
42}
HubFdo * Hub
Definition: bootdev.cpp:261
HubParentInfo m_ParentInfo
Definition: fdo.h:360
UCXHUB_PARENT_INTERFACE m_Parent
Definition: fdo.h:355
VOID NTAPI HubDescInitHubContext(_Out_ HubDescContext *Context, _In_ USHORT BcdUsb, _In_ USB_DEVICE_SPEED Speed)
Definition: desccheck.cpp:112
static VOID NTAPI HubLogHubFinding(_In_opt_ PVOID Context, _In_ HubDescCode Code, _In_ BOOLEAN Warning)
Definition: hubdescval.cpp:17
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
USB_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: fdo.h:89
USB_DEVICE_SPEED HubSpeed
Definition: hubucx.h:504

Referenced by HubCheckUsb2HubDescriptor(), HubCheckUsb3HubDescriptor(), HubLogConfigTotalLengthMismatch(), and HubValidateHubConfiguration().

◆ HubCheckUsb2HubDescriptor()

BOOLEAN NTAPI HubCheckUsb2HubDescriptor ( _In_ HubFdo *  Hub,
_In_reads_bytes_(Length) PUSB_HUB_DESCRIPTOR  Descriptor,
_In_ ULONG  Length 
)

Definition at line 59 of file hubdescval.cpp.

63{
65
68}
BOOLEAN NTAPI HubDescCheck20Hub(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
Definition: desccheck.cpp:3198
static VOID NTAPI HubBuildDescContext(_In_ HubFdo *Hub, _Out_ HubDescContext *Context)
Definition: hubdescval.cpp:35
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342

Referenced by HubMachine::ParseHubDescriptor().

◆ HubCheckUsb3HubDescriptor()

BOOLEAN NTAPI HubCheckUsb3HubDescriptor ( _In_ HubFdo *  Hub,
_In_reads_bytes_(Length) PUSB_30_HUB_DESCRIPTOR  Descriptor,
_In_ ULONG  Length 
)

Definition at line 72 of file hubdescval.cpp.

76{
78
81}
BOOLEAN NTAPI HubDescCheck30Hub(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_30_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
Definition: desccheck.cpp:3272

Referenced by HubMachine::ParseHubDescriptor().

◆ HubLogConfigTotalLengthMismatch()

VOID NTAPI HubLogConfigTotalLengthMismatch ( _In_ HubFdo *  Hub)

Definition at line 85 of file hubdescval.cpp.

87{
89
92}
VOID NTAPI HubDescLog(_In_ const HubDescContext *Context, _In_ HubDescCode Code, _In_ BOOLEAN Warning)
Definition: desccheck.cpp:383
@ ConfigTotalLengthTooLarge
#define FALSE
Definition: types.h:117

Referenced by HubMachine::CacheConfigDescriptor().

◆ HubLogHubFinding()

static VOID NTAPI HubLogHubFinding ( _In_opt_ PVOID  Context,
_In_ HubDescCode  Code,
_In_ BOOLEAN  Warning 
)
static

Hub findings have no bitmap and no verifier break, only a debug print.

Definition at line 17 of file hubdescval.cpp.

21{
22 if (Context == NULL)
23 return;
24
25 if (Warning)
26 DPRINT("Hub %p descriptor check %s (%lu) ignored\n", Context, HubDescCodeName(Code), (ULONG)Code);
27 else
28 DPRINT1("Hub %p descriptor check %s (%lu) failed\n", Context, HubDescCodeName(Code), (ULONG)Code);
29}
#define DPRINT1
Definition: precomp.h:8
@ Warning
PCSTR NTAPI HubDescCodeName(_In_ HubDescCode Code)
Definition: desccheck.cpp:128
#define NULL
Definition: types.h:112
#define DPRINT
Definition: sndvol32.h:73
uint32_t ULONG
Definition: typedefs.h:59
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1707

Referenced by HubBuildDescContext().

◆ HubValidateHubConfiguration()

BOOLEAN NTAPI HubValidateHubConfiguration ( _In_ HubFdo *  Hub,
_In_reads_bytes_(Length) PUSB_CONFIGURATION_DESCRIPTOR  Descriptor,
_In_ ULONG  Length 
)

Definition at line 46 of file hubdescval.cpp.

50{
52
55}
BOOLEAN NTAPI HubDescCheckConfiguration(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_CONFIGURATION_DESCRIPTOR Descriptor, _In_ ULONG Length, _Out_opt_ PBOOLEAN SupportsStreams)
Definition: desccheck.cpp:1237

Referenced by HubMachine::CacheConfigDescriptor().