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

Go to the source code of this file.

Classes

class  UcxUserRequest
 
struct  UcxUserRequestSize
 

Macros

#define NDEBUG
 
#define UCX_DRIVER_TRACKING_CODE   4
 
#define UCX_REPORTED_USBDI_VERSION   0x600
 
#define UCX_BUS_BANDWIDTH   (7000 * 8 * 8)
 
#define UCX_PASS_THRU_MAX_LENGTH   0x10000
 
#define UCX_LEGACY_NAME_ATTEMPTS   5
 
#define UCX_SYNTHETIC_FRAME_MASK   0x7FF
 
#define UCX_USER_HEADER_SIZE   sizeof(USBUSER_REQUEST_HEADER)
 
#define UCX_USER_NAME_MIN   sizeof(USB_UNICODE_NAME)
 

Functions

 C_ASSERT (UCX_USER_HEADER_SIZE==16)
 
 C_ASSERT (UCX_USER_NAME_MIN==6)
 
 C_ASSERT (sizeof(USB_ROOT_HUB_NAME)==6)
 
static WDMUSB_POWER_STATE NTAPI UcxMapDevicePowerState (_In_ DEVICE_POWER_STATE State)
 
static WDMUSB_POWER_STATE NTAPI UcxMapSystemPowerState (_In_ SYSTEM_POWER_STATE State)
 
static VOID NTAPI UcxUserGetControllerInfo (_Inout_ UcxUserRequest &User, _In_ UcxController *Controller)
 
 _IRQL_requires_ (PASSIVE_LEVEL) static VOID NTAPI UcxUserGetDriverKeyName(_Inout_ UcxUserRequest &User
 
 if (Space< UCX_USER_NAME_MIN)
 
 RtlZeroMemory (Name, Space)
 
 if (NT_SUCCESS(Status)) = HubReadUxdRecord(Key, &Name, Record)
 
else if (Status==STATUS_BUFFER_TOO_SMALL)
 
User SetStatus (UsbUserInvalidParameter)
 
User Header () -> ActualBufferLength=UCX_USER_HEADER_SIZE+UCX_USER_NAME_MIN+ResultLength
 
 _IRQL_requires_ (PASSIVE_LEVEL) static NTSTATUS NTAPI UcxGetStrippedRootHubName(_In_ UcxRootHub *RootHub
 Sends a synchronous IOCTL to the specified device object.
 
 if (!NT_SUCCESS(RootHub->ReferenceSymbolicName(&Original)))
 
 WdfStringGetUnicodeString (Original, &Name)
 
 if (Count==0||Name.Buffer==NULL)
 
 if (!NT_SUCCESS(Status)) DPRINT1("Copying root hub %p name failed 0x%lx\n"
 
 WdfObjectDereferenceWithTag (Original,(PVOID) UCX_POOL_TAG)
 
 if (!NT_SUCCESS(UcxGetStrippedRootHubName(RootHub, &String)))
 
 if (String==NULL) return
 
 WdfStringGetUnicodeString (String, &Text)
 
 RtlCopyMemory (Name->String, Text.Buffer, min(Size, Space))
 
 if (Size > Space)
 
 WdfObjectDelete (String)
 
static VOID NTAPI UcxUserPassThru (_Inout_ UcxUserRequest &User)
 
static VOID NTAPI UcxMapWakeAndPower (_In_ const DEVICE_CAPABILITIES *HcCaps, _In_ SYSTEM_POWER_STATE SleepState, _Out_ PUSB_POWER_INFO Info)
 
static VOID NTAPI UcxUserGetPowerStateMap (_Inout_ UcxUserRequest &User, _In_ UcxController *Controller)
 
static VOID NTAPI UcxUserGetBandwidthInformation (_Inout_ UcxUserRequest &User)
 
static VOID NTAPI UcxReadFrameForStatistics (_In_ UcxController *Controller, _Inout_ PULONG Frame)
 
static VOID NTAPI UcxUserGetBusStatistics (_Inout_ UcxUserRequest &User, _In_ UcxController *Controller)
 
static VOID NTAPI UcxUserGetDriverVersion (_Inout_ UcxUserRequest &User)
 
static BOOLEAN NTAPI UcxLookupUserRequestSize (_In_ ULONG Request, _Out_ PULONG ParameterLength)
 
static VOID NTAPI UcxRunUserRequest (_Inout_ UcxUserRequest &User, _In_ WDFDEVICE Fdo, _In_ UcxController *Controller)
 
static VOID NTAPI UcxHandleUserRequest (_In_ WDFDEVICE Fdo, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, _In_ size_t InputBufferLength)
 
 PAGED_CODE ()
 
 for (Attempt=0;Attempt< UCX_LEGACY_NAME_ATTEMPTS;Attempt++)
 
 if (Block==NULL||Block->UsbUserStatusCode !=UsbUserSuccess)
 
 if (Name->Length > MAXULONG - FIELD_OFFSET(USB_ROOT_HUB_NAME, RootHubName))
 
 if (Fits)
 
 ExFreePoolWithTag (Block, UCX_POOL_TAG)
 
 WdfRequestCompleteWithInformation (Request, STATUS_SUCCESS, ActualLength)
 
BOOLEAN NTAPI UcxDispatchUserIoctl (_In_ WDFDEVICE Fdo, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, _In_ size_t InputBufferLength, _In_ ULONG IoControlCode)
 
 C_ASSERT (FIELD_OFFSET(USB_DEVICE_NODE_INFO, NodeType)==88)
 
 C_ASSERT (FIELD_OFFSET(USB_DEVICE_NODE_INFO, BusAddress)==92)
 
 C_ASSERT (FIELD_OFFSET(USB_DEVICE_NODE_INFO, ControllerDeviceInfo)==124)
 
 C_ASSERT (sizeof(USB_DEVICE_NODE_INFO)==1202)
 
NTSTATUS NTAPI UcxEvtWmiNodeInfoQueryInstance (_In_ WDFWMIINSTANCE WmiInstance, _In_ ULONG OutBufferSize, _Out_writes_bytes_to_(OutBufferSize, *BufferUsed) PVOID OutBuffer, _Out_ PULONG BufferUsed)
 

Variables

_In_ WDFDEVICE Fdo
 
ULONG Space = User.NameSpace()
 
ULONG ResultLength = 0
 
NTSTATUS Status = WdfDeviceQueryProperty(Fdo, DevicePropertyDriverKeyName, Space, Name->String, &ResultLength)
 
 else
 
_Out_ WDFSTRING * Stripped
 
UNICODE_STRING Name = (PUSB_UNICODE_NAME)(Block + 1)
 
WDFSTRING Original
 
USHORT Skip = 0
 
USHORT Count = Name.Length / sizeof(WCHAR)
 
Name Length = Skip * sizeof(WCHAR)
 
Name MaximumLength = Skip * sizeof(WCHAR)
 
WDF_OBJECT_ATTRIBUTES_INIT & Attributes
 
Attributes ParentObject = RootHub->m_Handle
 
 RootHub
 
UNICODE_STRING Text
 
WDFSTRING String
 
ULONG Size = Text.Length
 
static const UcxUserRequestSize UcxUserRequestSizes []
 
_In_ WDFREQUEST Request
 
_In_ WDFREQUEST _In_ size_t OutputBufferLength
 
_In_ WDFREQUEST _In_ size_t _In_ ULONG IoControlCode
 
PUSBUSER_REQUEST_HEADER Block = NULL
 
PUSB_ROOT_HUB_NAME Output
 
ULONG Attempt
 
ULONG ActualLength = ActualLength
 
BOOLEAN Fits = OutputBufferLength >= ActualLength
 
Output RootHubName [0] = UNICODE_NULL
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file userreq.cpp.

◆ UCX_BUS_BANDWIDTH

#define UCX_BUS_BANDWIDTH   (7000 * 8 * 8)

Definition at line 19 of file userreq.cpp.

◆ UCX_DRIVER_TRACKING_CODE

#define UCX_DRIVER_TRACKING_CODE   4

Definition at line 15 of file userreq.cpp.

◆ UCX_LEGACY_NAME_ATTEMPTS

#define UCX_LEGACY_NAME_ATTEMPTS   5

Definition at line 22 of file userreq.cpp.

◆ UCX_PASS_THRU_MAX_LENGTH

#define UCX_PASS_THRU_MAX_LENGTH   0x10000

Definition at line 21 of file userreq.cpp.

◆ UCX_REPORTED_USBDI_VERSION

#define UCX_REPORTED_USBDI_VERSION   0x600

Definition at line 16 of file userreq.cpp.

◆ UCX_SYNTHETIC_FRAME_MASK

#define UCX_SYNTHETIC_FRAME_MASK   0x7FF

Definition at line 23 of file userreq.cpp.

◆ UCX_USER_HEADER_SIZE

#define UCX_USER_HEADER_SIZE   sizeof(USBUSER_REQUEST_HEADER)

Definition at line 26 of file userreq.cpp.

◆ UCX_USER_NAME_MIN

#define UCX_USER_NAME_MIN   sizeof(USB_UNICODE_NAME)

Definition at line 27 of file userreq.cpp.

Function Documentation

◆ _IRQL_requires_() [1/2]

_IRQL_requires_ ( PASSIVE_LEVEL  )

Sends a synchronous IOCTL to the specified device object.

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

Grows a private buffer to what the helper asks for.

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

◆ _IRQL_requires_() [2/2]

_IRQL_requires_ ( PASSIVE_LEVEL  ) &

◆ C_ASSERT() [1/7]

C_ASSERT ( FIELD_OFFSET(USB_DEVICE_NODE_INFO, BusAddress)  = =92)

◆ C_ASSERT() [2/7]

C_ASSERT ( FIELD_OFFSET(USB_DEVICE_NODE_INFO, ControllerDeviceInfo)  = =124)

◆ C_ASSERT() [3/7]

C_ASSERT ( FIELD_OFFSET(USB_DEVICE_NODE_INFO, NodeType)  = =88)

◆ C_ASSERT() [4/7]

C_ASSERT ( sizeof(USB_DEVICE_NODE_INFO)  = =1202)

◆ C_ASSERT() [5/7]

C_ASSERT ( sizeof(USB_ROOT_HUB_NAME)  = =6)

◆ C_ASSERT() [6/7]

C_ASSERT ( UCX_USER_HEADER_SIZE  = =16)

◆ C_ASSERT() [7/7]

C_ASSERT ( UCX_USER_NAME_MIN  = =6)

◆ ExFreePoolWithTag()

ExFreePoolWithTag ( Block  ,
UCX_POOL_TAG   
)

◆ for()

for ( )

Definition at line 715 of file userreq.cpp.

716 {
717 Block = (PUSBUSER_REQUEST_HEADER)ExAllocatePoolZero(PagedPool, Size, UCX_POOL_TAG);
718 if (Block == NULL)
719 {
720 DPRINT1("Name IOCTL 0x%lx could not allocate %lu bytes\n", IoControlCode, Size);
722 return;
723 }
724
725 Block->RequestBufferLength = Size;
726
728
730 {
731 Block->UsbUserRequest = USBUSER_GET_CONTROLLER_DRIVER_KEY;
732 UcxUserGetDriverKeyName(User, Fdo);
733 }
734 else
735 {
736 Block->UsbUserRequest = USBUSER_GET_ROOTHUB_SYMBOLIC_NAME;
737 UcxUserGetRootHubName(User, Controller->m_RootHub);
738 }
739
740 if (Block->UsbUserStatusCode != UsbUserBufferTooSmall)
741 break;
742
743 Size = Block->ActualBufferLength;
745 Block = NULL;
746 }
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define PagedPool
Definition: env_spec_w32.h:308
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
static PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
Definition: precomp.h:45
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ UCXCONTROLLER * Controller
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST Request
#define UCX_POOL_TAG
Definition: ucxutil.h:11
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define IOCTL_GET_HCD_DRIVERKEY_NAME
Definition: usbioctl.h:165
ULONG Size
Definition: userreq.cpp:263
WdfRequestCompleteWithInformation(Request, STATUS_SUCCESS, ActualLength)
PUSBUSER_REQUEST_HEADER Block
Definition: userreq.cpp:697
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461

Referenced by __attribute__(), _Init_timeinfo(), _IRQL_requires_(), _setmbcp_nolock(), _TIFFVSetField(), acpi_bus_add(), ActivateOtherWindowMin(), add_chunk(), add_metadata_reloc_extent_item(), AddResourceItems(), adns__findlabel_next(), af_iup_shift(), alpha_blend_bmp_pixels(), alpha_blend_pixels_hrgn(), ArbpBuildAllocationStack(), ArbpForEachRegistryRange(), AtaDeviceExecuteAcpiTaskFile(), BitmapTestSrc_CopyPixels(), BlasterWrite(), BmfdQueryFontTree(), BT958HwAdapterControl(), UcxRootHub::BuildPowerCapabilities(), Bus_PDO_QueryResources(), cff_encoding_load(), cff_font_load(), check_pkt_fuzzy(), cid_read_subrs(), ColorCorrection(), compress_data(), compress_output(), Convert_Glyph(), copy_pixels(), create_chunk(), create_mbcinfo(), CreateCommand(), CreateOutputFile(), CreateStockObjects(), CreateStubFromTypeInfo(), CRYPT_AsnDecodeArray(), CRYPT_AsnDecodeNameValueInternal(), CRYPT_EncodeValueWithType(), d3d12_desc_flush_vk_heap_updates_locked(), d3d12_descriptor_heap_create(), d3d12_descriptor_heap_Release(), d3d12_resource_init_tiles(), d3d9_stateblock_Apply(), d3dx_evaluate_parameter(), D3DXFillTexture(), D3DXFillVolumeTexture(), D3DXSHProjectCubeMap(), DcCreateRxRing(), ddraw_surface_blt_clipped(), decode_pathname4(), decompress_onepass(), DetectBiosDisks(), DIB_16BPP_BitBltSrcCopy(), DIB_32BPP_BitBltSrcCopy(), DisplayEvent(), do_barray_io(), do_get_text(), do_sarray_io(), drop_root(), DrvEvaluatePrtObject(), DrvSetPointerShape(), elf_hash_symtab(), empty_image(), emptyImage3D(), EvalConvertParameterObjects(), Ext2InitializeVcb(), FdcFdoQueryBusRelations(), FdoEnumerateDevices(), fill_image(), fillImage3D(), XhciRootHub::FillSpeeds(), find_ps_builtin_semantics(), find_subvol(), flush_partial_stripe(), FNT_Load_Glyph(), FstubReadHeaderEFI(), FstubWritePartitionTableEFI(), ft_smooth_overlap_spans(), ft_stroke_border_export(), fx_4_parse_shader_initializer(), GdipReleaseDC(), gen_bitlen(), geometry_shader_init_so_desc(), get_apple_string(), get_usage(), get_win_string(), gl_GetIntegerv(), gl_PopAttrib(), gl_render_bitmap(), gl_TexSubImage2D(), GPOS_apply_ChainContextPos(), GPOS_apply_ContextPos(), GSUB_apply_ChainContextSubst(), GSUB_apply_ContextSubst(), HalPutScatterGatherList(), has_encoder_param_long(), HLPFILE_Uncompress_Topic(), hlsl_type_get_component_offset(), ID3DXAllocateHierarchyImpl_CreateMeshContainer(), inflateBack(), init_block(), int_upsample(), InternalLockCondVar(), IntFillImeCandidatesCHT(), IntRemoveCursorFromList(), IntWideCharToMultiByteCP(), jpeg_CreateDecompress(), KiSystemService(), KiTrap0DHandler(), LinesHorizontalProc(), LinesProc(), LinesVerticalProc(), lzx_output_match(), LZXinit(), LZXreset(), make_funny_pointers(), metadc_create_region(), MirrorRgnByWidth(), MountMgrDeletePoints(), name_string_to_path(), NetBTAstatRemote(), ObpQueryNameInfoSize(), OHCI_RH_GetPortStatus(), OnVScroll(), PciDebugPrintIoResource(), pdb_read_jg_file(), PEN_GetObject(), pfr_face_init(), pfr_slot_load_bitmap(), png_encoder_commit_frame(), PNP_AddEmptyLogConf(), PNP_FreeLogConf(), PpInitGetGroupOrderIndex(), XhciInterrupters::PrepareOne(), print_rpc_gss_sec(), PrintStackTrace(), process_update(), PropertySheetA(), PropertySheetW(), rc4_init(), read_data_raid6(), realize_virt_arrays(), regenerate_space_list(), REGION_bXformRgn(), Reorder_Ra_follows_matra(), reset_actions(), RtlFirstFreeAce(), RxGetRegistryParameters(), s_get_cpsc(), s_sum_cps(), ScanForUnpartitionedDiskSpace(), ScsiFlopDeviceControl(), SECUR32_arc4Init(), select_scan_parameters(), select_style(), FxUsbDevice::SelectConfig(), sep_downsample(), SepSidInTokenEx(), SerenumPdoPnp(), set_bottom_pointers(), set_constants(), set_wraparound_pointers(), setSBCS(), SetVolumeValue(), should_balance_chunk(), sm6_parser_emit_reg_composite_construct(), SOFTWARE_GdipDrawThinPath(), spirv_compiler_emit_constant_array(), spirv_compiler_get_descriptor_info(), start_pass(), start_pass_fdctmgr(), START_TEST(), state_init_default(), stateblock_savedstates_set_all(), stateblock_savedstates_set_pixel(), stateblock_savedstates_set_vertex(), surface_cpu_blt(), T1_Get_MM_WeightVector(), T1_Set_MM_WeightVector(), test_D3DXFillTexture(), test_D3DXSHProjectCubeMap(), test_dibsections(), test_emf_pattern_brush(), test_mf_PatternBrush(), Test_RtlFlsAllocFree(), TIFFCIELabToRGBInit(), TIFFSetDirectory(), TLB_AllocAndInitFuncDesc(), TT_Load_Simple_Glyph(), ui_patblt(), UrlCombineW(), USBFlopFormatTracks(), value_allocate_constant_array(), VGADDI_BltFromSavedScreenBits(), VGADDI_BltToSavedScreenBits(), vsir_program_trace(), VTUTF8ChannelOInit(), VTUTF8ChannelOWrite2(), wined3d_context_gl_init(), wined3d_cs_packet_decref_objects(), wined3d_cs_packet_incref_objects(), wined3d_unordered_access_view_vk_clear(), WmipClearIrpObjectList(), wodOpen(), write_data(), write_metadata_items(), and zoh_vari_process().

◆ Header()

◆ if() [1/12]

if ( !  NT_SUCCESSRootHub->ReferenceSymbolicName(&Original))

Definition at line 205 of file userreq.cpp.

206 {
207 DPRINT("Root hub %p has no symbolic name yet\n", RootHub);
208 return STATUS_SUCCESS;
209 }
#define DPRINT
Definition: sndvol32.h:73
_Must_inspect_result_ _In_ UCXCONTROLLER _In_ PUCX_ROOTHUB_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ UCXROOTHUB * RootHub
Definition: ucxroothub.h:299

◆ if() [2/12]

if ( !  NT_SUCCESSStatus)

◆ if() [3/12]

if ( !  NT_SUCCESSUcxGetStrippedRootHubName(RootHub, &String))

Definition at line 274 of file userreq.cpp.

275 {
276 User.SetStatus(UsbUserInvalidParameter);
277 User.Header()->ActualBufferLength = UCX_USER_HEADER_SIZE + UCX_USER_NAME_MIN;
278 return;
279 }
#define UCX_USER_HEADER_SIZE
Definition: userreq.cpp:26
#define UCX_USER_NAME_MIN
Definition: userreq.cpp:27

◆ if() [4/12]

if ( Block  = = NULL || Block->UsbUserStatusCode != UsbUserSuccess)

Definition at line 748 of file userreq.cpp.

749 {
750 DPRINT1("Name IOCTL 0x%lx failed, USBUSER status %d\n",
751 IoControlCode, Block != NULL ? (INT)Block->UsbUserStatusCode : -1);
752
753 if (Block != NULL)
755
757 return;
758 }
int32_t INT
Definition: typedefs.h:58
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

◆ if() [5/12]

if ( Count  = = 0 || Name.Buffer == NULL)

Definition at line 214 of file userreq.cpp.

215 {
216 DPRINT1("Root hub %p symbolic name is empty\n", RootHub);
218 }
Status
Definition: gdiplustypes.h:24

◆ if() [6/12]

if ( Fits  )

Definition at line 776 of file userreq.cpp.

777 {
779 }
WCHAR RootHubName[ANYSIZE_ARRAY]
Definition: usbioctl.h:320
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
PUSB_ROOT_HUB_NAME Output
Definition: userreq.cpp:699
UNICODE_STRING Name
Definition: userreq.cpp:197

◆ if() [7/12]

if ( Name->  Length,
MAXULONG -   FIELD_OFFSETUSB_ROOT_HUB_NAME, RootHubName 
)

Definition at line 763 of file userreq.cpp.

764 {
766 Fits = FALSE;
767 }
#define FALSE
Definition: types.h:117
#define MAXULONG
Definition: typedefs.h:251
ULONG ActualLength
Definition: userreq.cpp:702
BOOLEAN Fits
Definition: userreq.cpp:703

◆ if() [8/12]

if ( NT_SUCCESS(Status)  ) = HubReadUxdRecord(Key, &Name, Record)

Definition at line 169 of file userreq.cpp.

170 {
171 User.SetStatus(UsbUserSuccess);
172 Name->Length = ResultLength + sizeof(WCHAR);
173 }
short WCHAR
Definition: pedump.c:58
_In_ PGUID _In_ ULONG _Out_ PULONG ResultLength
Definition: ucxcontroller.h:83

◆ if() [9/12]

if ( Size  ,
Space   
)

Definition at line 290 of file userreq.cpp.

291 {
292 User.SetStatus(UsbUserBufferTooSmall);
293 }

◆ if() [10/12]

if ( )

Definition at line 159 of file userreq.cpp.

160 {
161 User.SetStatus(UsbUserBufferTooSmall);
162 return;
163 }

◆ if() [11/12]

Definition at line 174 of file userreq.cpp.

175 {
176 User.SetStatus(UsbUserBufferTooSmall);
177 }

◆ if() [12/12]

if ( String  = =NULL)

◆ PAGED_CODE()

PAGED_CODE ( )

◆ RtlCopyMemory()

RtlCopyMemory ( Name->  String,
Text.  Buffer,
min(Size, Space)   
)

◆ RtlZeroMemory()

RtlZeroMemory ( Name  ,
Space   
)

◆ SetStatus()

User SetStatus ( UsbUserInvalidParameter  )

◆ UcxDispatchUserIoctl()

BOOLEAN NTAPI UcxDispatchUserIoctl ( _In_ WDFDEVICE  Fdo,
_In_ WDFREQUEST  Request,
_In_ size_t  OutputBufferLength,
_In_ size_t  InputBufferLength,
_In_ ULONG  IoControlCode 
)

TRUE when UCX recognized and completed the request.

Definition at line 793 of file userreq.cpp.

799{
800 switch (IoControlCode)
801 {
802 /* Accepted, nothing changes */
805 WdfRequestComplete(Request, STATUS_SUCCESS);
806 return TRUE;
807
810 UcxHandleLegacyName(Fdo, Request, OutputBufferLength, IoControlCode);
811 return TRUE;
812
813 case IOCTL_USB_USER_REQUEST:
815 return TRUE;
816
817 default:
818 return FALSE;
819 }
820}
#define TRUE
Definition: types.h:120
_In_ PGUID _In_ ULONG OutputBufferLength
Definition: ucxcontroller.h:81
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
#define IOCTL_USB_DIAGNOSTIC_MODE_ON
Definition: usbioctl.h:155
#define IOCTL_USB_DIAGNOSTIC_MODE_OFF
Definition: usbioctl.h:150
#define IOCTL_USB_GET_ROOT_HUB_NAME
Definition: usbioctl.h:160
static VOID NTAPI UcxHandleUserRequest(_In_ WDFDEVICE Fdo, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, _In_ size_t InputBufferLength)
Definition: userreq.cpp:629

Referenced by UcxApiIoDeviceControl().

◆ UcxEvtWmiNodeInfoQueryInstance()

NTSTATUS NTAPI UcxEvtWmiNodeInfoQueryInstance ( _In_ WDFWMIINSTANCE  WmiInstance,
_In_ ULONG  OutBufferSize,
_Out_writes_bytes_to_(OutBufferSize, *BufferUsed) PVOID  OutBuffer,
_Out_ PULONG  BufferUsed 
)

Definition at line 832 of file userreq.cpp.

837{
838 UcxController* Controller = UcxController::FromFdo(WdfWmiInstanceGetDevice(WmiInstance));
839 const UCX_CONTROLLER_PCI_INFORMATION* Pci = &Controller->m_Config.PciDeviceInfo;
840 PUSB_DEVICE_NODE_INFO Node = (PUSB_DEVICE_NODE_INFO)OutBuffer;
841 UcxRootHub* RootHub = Controller->m_RootHub;
842
843 *BufferUsed = sizeof(*Node);
844
845 if (OutBufferSize < sizeof(*Node))
846 {
847 DPRINT1("WMI node info buffer of %lu bytes is too small\n", OutBufferSize);
849 }
850
852
853 Node->Sig = USB_NODE_INFO_SIG;
854 Node->LengthInBytes = sizeof(*Node);
855 RtlStringCbCopyA((PSTR)Node->DeviceDescription,
856 sizeof(Node->DeviceDescription),
857 (PCSTR)Controller->m_Config.DeviceDescription);
858
859 Node->NodeType = UsbController;
860 Node->BusAddress.PciBusNumber = Pci->BusNumber;
861 Node->BusAddress.PciDeviceNumber = Pci->DeviceNumber;
862 Node->BusAddress.PciFunctionNumber = Pci->FunctionNumber;
863
864 Node->ControllerDeviceInfo.PciVendorId = Pci->VendorId;
865 Node->ControllerDeviceInfo.PciDeviceId = Pci->DeviceId;
866 Node->ControllerDeviceInfo.PciRevision = Pci->RevisionId;
867 Node->ControllerDeviceInfo.NumberOfRootPorts = RootHub->m_NumberOf20Ports + RootHub->m_NumberOf30Ports;
868 Node->ControllerDeviceInfo.HcFeatureFlags = USB_HC_FEATURE_FLAG_SEL_SUSPEND;
869
870 return STATUS_SUCCESS;
871}
static UcxController * FromFdo(_In_ WDFDEVICE Fdo)
Definition: hostctl.cpp:21
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
Definition: scsi.h:4117
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
char * PSTR
Definition: typedefs.h:51
const char * PCSTR
Definition: typedefs.h:52
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
Definition: dlist.c:348
_In_ ULONG OutBufferSize
Definition: wdfwmi.h:87
_In_ ULONG _Out_ PULONG BufferUsed
Definition: wdfwmi.h:92
_Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
Definition: wdfwmi.h:514

◆ UcxHandleUserRequest()

static VOID NTAPI UcxHandleUserRequest ( _In_ WDFDEVICE  Fdo,
_In_ WDFREQUEST  Request,
_In_ size_t  OutputBufferLength,
_In_ size_t  InputBufferLength 
)
static

Definition at line 629 of file userreq.cpp.

634{
636 PUSBUSER_REQUEST_HEADER Header;
639
641 {
642 DPRINT1("USBUSER IOCTL input length %Iu differs from output length %Iu\n", InputBufferLength, OutputBufferLength);
644 return;
645 }
646
647 if (!NT_SUCCESS(WdfRequestRetrieveOutputBuffer(Request, UCX_USER_HEADER_SIZE, (PVOID*)&Header, NULL)))
648 {
649 DPRINT1("USBUSER IOCTL buffer of %Iu bytes is too small\n", OutputBufferLength);
651 return;
652 }
653
655
656 /* The request itself succeeds from here; problems go into the header */
657 Header->UsbUserStatusCode = UsbUserSuccess;
658 Header->ActualBufferLength = UCX_USER_HEADER_SIZE;
659
660 if (Header->RequestBufferLength != OutputBufferLength)
661 {
662 DPRINT1("USBUSER header length %lu differs from buffer length %Iu\n",
663 Header->RequestBufferLength, OutputBufferLength);
664 User.SetStatus(UsbUserInvalidHeaderParameter);
666 return;
667 }
668
669 /* A short parameter block reports the needed size but returns only the header */
670 if (UcxLookupUserRequestSize(Header->UsbUserRequest, &ParameterLength) &&
671 !User.CheckParameterLength(ParameterLength))
672 {
674 return;
675 }
676
678
679 Information = min(Header->RequestBufferLength, Header->ActualBufferLength);
681}
Definition: Header.h:9
#define min(a, b)
Definition: monoChain.cc:55
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ ULONG ParameterLength
Definition: usbdlib.h:233
static BOOLEAN NTAPI UcxLookupUserRequestSize(_In_ ULONG Request, _Out_ PULONG ParameterLength)
Definition: userreq.cpp:534
User Header() -> ActualBufferLength=UCX_USER_HEADER_SIZE+UCX_USER_NAME_MIN+ResultLength
static VOID NTAPI UcxRunUserRequest(_Inout_ UcxUserRequest &User, _In_ WDFDEVICE Fdo, _In_ UcxController *Controller)
Definition: userreq.cpp:555
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049

Referenced by UcxDispatchUserIoctl().

◆ UcxLookupUserRequestSize()

static BOOLEAN NTAPI UcxLookupUserRequestSize ( _In_ ULONG  Request,
_Out_ PULONG  ParameterLength 
)
static

Parameter size of a request UCX knows, or FALSE for anything else.

Definition at line 534 of file userreq.cpp.

537{
538 ULONG Index;
539
541 {
543 {
545 return TRUE;
546 }
547 }
548
549 return FALSE;
550}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
static const UcxUserRequestSize UcxUserRequestSizes[]
Definition: userreq.cpp:512
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by UcxHandleUserRequest(), and UcxRunUserRequest().

◆ UcxMapDevicePowerState()

static WDMUSB_POWER_STATE NTAPI UcxMapDevicePowerState ( _In_ DEVICE_POWER_STATE  State)
static

Definition at line 99 of file userreq.cpp.

101{
103 return (WDMUSB_POWER_STATE)(WdmUsbPowerDeviceUnspecified + State);
104
105 return WdmUsbPowerNotMapped;
106}
@ PowerDeviceUnspecified
Definition: ntpoapi.h:48
@ PowerDeviceD3
Definition: ntpoapi.h:52

Referenced by UcxUserGetPowerStateMap().

◆ UcxMapSystemPowerState()

static WDMUSB_POWER_STATE NTAPI UcxMapSystemPowerState ( _In_ SYSTEM_POWER_STATE  State)
static

Definition at line 112 of file userreq.cpp.

114{
116 return (WDMUSB_POWER_STATE)(WdmUsbPowerSystemUnspecified + State);
117
118 return WdmUsbPowerNotMapped;
119}
@ PowerSystemShutdown
Definition: ntpoapi.h:41
@ PowerSystemWorking
Definition: ntpoapi.h:36

Referenced by UcxUserGetPowerStateMap().

◆ UcxMapWakeAndPower()

static VOID NTAPI UcxMapWakeAndPower ( _In_ const DEVICE_CAPABILITIES *  HcCaps,
_In_ SYSTEM_POWER_STATE  SleepState,
_Out_ PUSB_POWER_INFO  Info 
)
static

Whether the controller can wake the system from Sx, and stays powered in it.

Definition at line 336 of file userreq.cpp.

340{
341 DEVICE_POWER_STATE DeviceState = HcCaps->DeviceState[SleepState];
342
343 if (SleepState <= HcCaps->SystemWake)
344 {
345 Info->CanWakeup = (DeviceState != PowerDeviceUnspecified);
346 Info->IsPowered = Info->CanWakeup;
347 }
348 else
349 {
350 Info->CanWakeup = FALSE;
352 }
353}
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFDEVICE _Out_ PWDF_DEVICE_STATE DeviceState
Definition: wdfdevice.h:2005

Referenced by UcxUserGetPowerStateMap().

◆ UcxReadFrameForStatistics()

static VOID NTAPI UcxReadFrameForStatistics ( _In_ UcxController *  Controller,
_Inout_ PULONG  Frame 
)
static

Uses the cached frame during a reset; failures report a counter that just moves on.

Definition at line 420 of file userreq.cpp.

423{
425
426 if (Controller->m_Config.EvtControllerGetCurrentFrameNumber != NULL)
427 Status = Controller->GetCurrentFrameNumber(Frame);
428
429 if (!NT_SUCCESS(Status))
430 {
431 DPRINT("Frame number read on controller %p failed 0x%lx, faking one\n", Controller, Status);
432 Controller->m_SyntheticFrame = (Controller->m_SyntheticFrame + 1) & UCX_SYNTHETIC_FRAME_MASK;
433 *Frame = Controller->m_SyntheticFrame;
434 }
435}
#define UCX_SYNTHETIC_FRAME_MASK
Definition: userreq.cpp:23

Referenced by UcxUserGetBusStatistics().

◆ UcxRunUserRequest()

static VOID NTAPI UcxRunUserRequest ( _Inout_ UcxUserRequest &  User,
_In_ WDFDEVICE  Fdo,
_In_ UcxController *  Controller 
)
static

Definition at line 555 of file userreq.cpp.

559{
560 switch (User.Header()->UsbUserRequest)
561 {
562 case USBUSER_GET_CONTROLLER_INFO_0:
564 break;
565
566 case USBUSER_GET_CONTROLLER_DRIVER_KEY:
567 UcxUserGetDriverKeyName(User, Fdo);
568 break;
569
570 case USBUSER_PASS_THRU:
572 break;
573
574 case USBUSER_GET_POWER_STATE_MAP:
576 break;
577
578 case USBUSER_GET_BANDWIDTH_INFORMATION:
580 break;
581
582 case USBUSER_GET_BUS_STATISTICS_0:
584 break;
585
586 case USBUSER_GET_ROOTHUB_SYMBOLIC_NAME:
587 UcxUserGetRootHubName(User, Controller->m_RootHub);
588 break;
589
590 case USBUSER_GET_USB_DRIVER_VERSION:
592 break;
593
594 /* Accepted and ignored */
595 case USBUSER_USB_REFRESH_HCT_REG:
596 break;
597
598 /* Unlike the other test operations */
599 case USBUSER_OP_SEND_ONE_PACKET:
600 DPRINT1("USBUSER send one packet is not supported\n");
601 User.SetStatus(UsbUserInvalidHeaderParameter);
602 break;
603
604 case USBUSER_OP_RAW_RESET_PORT:
605 case USBUSER_SET_ROOTPORT_FEATURE:
606 case USBUSER_CLEAR_ROOTPORT_FEATURE:
607 case USBUSER_GET_ROOTPORT_STATUS:
608 DPRINT1("USBUSER test request 0x%lx is disabled\n", User.Header()->UsbUserRequest);
609 User.SetStatus(UsbUserFeatureDisabled);
610 break;
611
612 default:
613 {
614 /* Only consumed by the assert, so it is unused in free builds */
616
617 DPRINT1("Unknown USBUSER request 0x%lx\n", User.Header()->UsbUserRequest);
618 NT_ASSERT(!UcxLookupUserRequestSize(User.Header()->UsbUserRequest, &ParameterLength));
620 User.SetStatus(UsbUserInvalidRequestCode);
621 break;
622 }
623 }
624}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
static VOID NTAPI UcxUserPassThru(_Inout_ UcxUserRequest &User)
Definition: userreq.cpp:308
static VOID NTAPI UcxUserGetBandwidthInformation(_Inout_ UcxUserRequest &User)
Definition: userreq.cpp:405
static VOID NTAPI UcxUserGetBusStatistics(_Inout_ UcxUserRequest &User, _In_ UcxController *Controller)
Definition: userreq.cpp:441
static VOID NTAPI UcxUserGetPowerStateMap(_Inout_ UcxUserRequest &User, _In_ UcxController *Controller)
Definition: userreq.cpp:359
static VOID NTAPI UcxUserGetDriverVersion(_Inout_ UcxUserRequest &User)
Definition: userreq.cpp:488
static VOID NTAPI UcxUserGetControllerInfo(_Inout_ UcxUserRequest &User, _In_ UcxController *Controller)
Definition: userreq.cpp:126

Referenced by UcxHandleUserRequest().

◆ UcxUserGetBandwidthInformation()

static VOID NTAPI UcxUserGetBandwidthInformation ( _Inout_ UcxUserRequest &  User)
static

Definition at line 405 of file userreq.cpp.

407{
408 PUSB_BANDWIDTH_INFO Info = User.Payload<USB_BANDWIDTH_INFO>();
409
410 RtlZeroMemory(Info, sizeof(*Info));
411 Info->TotalBusBandwidth = UCX_BUS_BANDWIDTH;
412 Info->Total32secBandwidth = UCX_BUS_BANDWIDTH * 32;
413 Info->AllocedBulkAndControl = (UCX_BUS_BANDWIDTH / 5) * 32;
414}
#define UCX_BUS_BANDWIDTH
Definition: userreq.cpp:19

Referenced by UcxRunUserRequest().

◆ UcxUserGetBusStatistics()

static VOID NTAPI UcxUserGetBusStatistics ( _Inout_ UcxUserRequest &  User,
_In_ UcxController *  Controller 
)
static

Definition at line 441 of file userreq.cpp.

444{
445 PUSB_BUS_STATISTICS_0 Stats = User.Payload<USB_BUS_STATISTICS_0>();
446 UcxRootHub* RootHub = Controller->m_RootHub;
448 ULONG Frame;
449
450 Stats->DeviceCount = Controller->m_ChildDeviceCount;
451
453 RtlCopyMemory(&Stats->CurrentSystemTime, &Now, sizeof(Now));
454
455 Frame = Stats->CurrentUsbFrame;
457 Stats->CurrentUsbFrame = Frame;
458
459 Stats->BulkBytes = 0;
460 Stats->IsoBytes = 0;
461 Stats->InterruptBytes = 0;
462 Stats->ControlDataBytes = 0;
463 Stats->CommonBufferBytes = 0;
464
465 /* Keeps tools from deciding the controller is stuck */
466 Stats->PciInterruptCount = 1;
467
468 Stats->HardResetCount = 0;
469 Stats->WorkerSignalCount = 0;
470 Stats->WorkerIdleTimeMs = 0;
471
472 if (!RootHub->m_PdoStarted)
473 {
474 Stats->RootHubEnabled = FALSE;
475 Stats->RootHubDevicePowerState = 4;
476 }
477 else
478 {
479 Stats->RootHubEnabled = TRUE;
480 Stats->RootHubDevicePowerState = Controller->m_RootHubInD0 ? 0 : 2;
481 }
482}
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
struct tm * Now
Definition: output.c:19
static VOID NTAPI UcxReadFrameForStatistics(_In_ UcxController *Controller, _Inout_ PULONG Frame)
Definition: userreq.cpp:420

Referenced by UcxRunUserRequest().

◆ UcxUserGetControllerInfo()

static VOID NTAPI UcxUserGetControllerInfo ( _Inout_ UcxUserRequest &  User,
_In_ UcxController *  Controller 
)
static

Definition at line 126 of file userreq.cpp.

129{
130 PUSB_CONTROLLER_INFO_0 Info = User.Payload<USB_CONTROLLER_INFO_0>();
131 const UCX_CONTROLLER_PCI_INFORMATION* Pci = &Controller->m_Config.PciDeviceInfo;
132
133 Info->PciVendorId = Pci->VendorId;
134 Info->PciDeviceId = Pci->DeviceId;
135 Info->PciRevision = Pci->RevisionId;
136
137 /* USB 2.0 ports only, known once the hub asked for the root hub info */
138 Info->NumberOfRootPorts = Controller->m_RootHub->m_NumberOf20Ports;
139 Info->ControllerFlavor = USB_HcGeneric;
140 Info->HcFeatureFlags = 0;
141
142 User.SetStatus(UsbUserSuccess);
143}
@ USB_HcGeneric
Definition: usb.h:55

Referenced by UcxRunUserRequest().

◆ UcxUserGetDriverVersion()

static VOID NTAPI UcxUserGetDriverVersion ( _Inout_ UcxUserRequest &  User)
static

Definition at line 488 of file userreq.cpp.

490{
491 PUSB_DRIVER_VERSION_PARAMETERS Version = User.Payload<USB_DRIVER_VERSION_PARAMETERS>();
492
493 Version->DriverTrackingCode = UCX_DRIVER_TRACKING_CODE;
494 Version->USBDI_Version = UCX_REPORTED_USBDI_VERSION;
495 Version->USBUSER_Version = USBUSER_VERSION;
496#if DBG
497 Version->CheckedPortDriver = TRUE;
498 Version->CheckedMiniportDriver = TRUE;
499#else
500 Version->CheckedPortDriver = FALSE;
501 Version->CheckedMiniportDriver = FALSE;
502#endif
503}
#define UCX_DRIVER_TRACKING_CODE
Definition: userreq.cpp:15
#define UCX_REPORTED_USBDI_VERSION
Definition: userreq.cpp:16
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469

Referenced by UcxRunUserRequest().

◆ UcxUserGetPowerStateMap()

static VOID NTAPI UcxUserGetPowerStateMap ( _Inout_ UcxUserRequest &  User,
_In_ UcxController *  Controller 
)
static

Definition at line 359 of file userreq.cpp.

362{
363 PUSB_POWER_INFO Info = User.Payload<USB_POWER_INFO>();
364 UcxRootHub* RootHub = Controller->m_RootHub;
365 const WDF_DEVICE_POWER_CAPABILITIES* RhCaps = &RootHub->m_PowerCaps;
366 const DEVICE_CAPABILITIES* HcCaps = &Controller->m_HcCaps;
368
369 if (!RootHub->m_PdoStarted)
370 {
371 DPRINT1("Power state map requested before root hub %p started\n", RootHub);
372 User.SetStatus(UsbUserDeviceNotStarted);
373 return;
374 }
375
376 Info->RhDeviceWake = UcxMapDevicePowerState(RhCaps->DeviceWake);
377 Info->RhSystemWake = UcxMapSystemPowerState(RhCaps->SystemWake);
378 Info->HcDeviceWake = UcxMapDevicePowerState(HcCaps->DeviceWake);
379 Info->HcSystemWake = UcxMapSystemPowerState(HcCaps->SystemWake);
380 Info->LastSystemSleepState = UcxMapSystemPowerState(RootHub->m_LastSystemSleepState);
381
382 if (Info->SystemState < WdmUsbPowerSystemWorking || Info->SystemState > WdmUsbPowerSystemHibernate)
383 return;
384
385 State = (SYSTEM_POWER_STATE)(Info->SystemState - WdmUsbPowerSystemUnspecified);
386
387 Info->RhDevicePowerState = UcxMapDevicePowerState(RhCaps->DeviceState[State]);
388 Info->HcDevicePowerState = UcxMapDevicePowerState(HcCaps->DeviceState[State]);
389
391 {
392 Info->CanWakeup = FALSE;
393 Info->IsPowered = FALSE;
394 }
395 else
396 {
397 UcxMapWakeAndPower(HcCaps, State, Info);
398 }
399}
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
DEVICE_POWER_STATE DeviceWake
Definition: wdfdevice.h:1590
SYSTEM_POWER_STATE SystemWake
Definition: wdfdevice.h:1591
DEVICE_POWER_STATE DeviceState[PowerSystemMaximum]
Definition: wdfdevice.h:1584
static WDMUSB_POWER_STATE NTAPI UcxMapSystemPowerState(_In_ SYSTEM_POWER_STATE State)
Definition: userreq.cpp:112
static VOID NTAPI UcxMapWakeAndPower(_In_ const DEVICE_CAPABILITIES *HcCaps, _In_ SYSTEM_POWER_STATE SleepState, _Out_ PUSB_POWER_INFO Info)
Definition: userreq.cpp:336
static WDMUSB_POWER_STATE NTAPI UcxMapDevicePowerState(_In_ DEVICE_POWER_STATE State)
Definition: userreq.cpp:99
DEVICE_CAPABILITIES
Definition: iotypes.h:965

Referenced by UcxRunUserRequest().

◆ UcxUserPassThru()

static VOID NTAPI UcxUserPassThru ( _Inout_ UcxUserRequest &  User)
static

Definition at line 308 of file userreq.cpp.

310{
311 ULONG Length = User.Payload<USB_PASS_THRU_PARAMETERS>()->ParameterLength;
312
314 {
315 DPRINT1("Pass through parameter length %lu is too large\n", Length);
316 User.SetStatus(UsbUserInvalidParameter);
317 }
318 else if (UCX_USER_HEADER_SIZE + FIELD_OFFSET(USB_PASS_THRU_PARAMETERS, Parameters) + Length >
319 User.Header()->RequestBufferLength)
320 {
321 DPRINT1("Pass through buffer too small for %lu parameter bytes\n", Length);
322 User.SetStatus(UsbUserBufferTooSmall);
323 }
324 else
325 {
326 DPRINT("Pass through request is not serviced\n");
327 User.SetStatus(UsbUserMiniportError);
328 User.Header()->ActualBufferLength = UCX_USER_HEADER_SIZE + sizeof(USB_PASS_THRU_PARAMETERS) + Length;
329 }
330}
_In_ HANDLE _In_ CONST PDXGKMDT_OPM_GET_INFO_PARAMETERS Parameters
Definition: dispmprt.h:321
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define UCX_PASS_THRU_MAX_LENGTH
Definition: userreq.cpp:21

Referenced by UcxRunUserRequest().

◆ WdfObjectDelete()

WdfObjectDelete ( String  )

Referenced by _IRQL_requires_(), _IRQL_requires_max_(), XhciEndpoint::Cleanup(), HubChild::Create(), UcxController::Create(), UcxRootHub::Create(), UcxUsbDevice::Create(), UcxEndpoint::Create(), UcxRootHub::CreatePdo(), EndpointMachine::DeleteEndpoint(), UcxUsbDevice::DeleteFromHub(), EndpointMachine::DeleteStaleEndpoint(), DeviceAsynchronousCompletion(), DeviceDisableGesn(), DeviceRestoreDefaultSpeed(), DeviceSendStartUnit(), DriverEvtDeviceAdd(), EndpointMachine::FinishStreamsCloseRequest(), HubMachine::GetParentInfo(), HubMachine::GetRootHub20Ports(), HubMachine::GetRootHub30Ports(), GetSOFTplg(), HDA_AsyncWait(), HDAGraphics_EvtIoTargetRemoveCanceled(), HDAGraphics_EvtIoTargetRemoveComplete(), HDAGraphicsPowerInterfaceAdd(), HubAcpiFree(), HubClearTtBuffer(), HubConfigurationComplete(), HubDeleteDeferred(), HubDropDeviceObject(), HubEvtOverCurrentWorkItem(), HubEvtReportWorkItem(), HubEvtSelectiveSuspendWorkItem(), HubFreeConfiguration(), HubIoctlComplete(), HubIoGetConnectionName(), HubParentInfoComplete(), HubPdoEvtCompletePowerIrp(), HubResetComplete(), HubRootHubInfoComplete(), HubSendUcxIoctl(), HubTtClearComplete(), if(), NHLTCheckSupported(), NHLTQuery(), NHLTQueryTableAddress(), UcxEndpoint::OpenStaticStreamsComplete(), DeviceMachine::PrepareInterfaceLists(), UcxController::QueryHcCapabilities(), UcxUsbDevice::RegisterComposite(), XhciInterrupters::ReleaseOne(), HubMachine::ResetHub(), HubMachine::SelectHubConfiguration(), UcxClientReleaseUrb(), UcxCreateObjectWithTwoContexts(), UcxCreateStaticStreams(), UcxDeleteXrbMemory(), UcxEvtDriverUnload(), UcxEvtRootHubPrepareHardware(), UcxEvtRootHubReleaseHardware(), UcxUsbdHandle::Unregister(), UcxUsbDevice::UnregisterComposite(), and HubMachine::UpdateControllerHubInfo().

◆ WdfObjectDereferenceWithTag()

WdfObjectDereferenceWithTag ( Original  ,
(PVOID)  UCX_POOL_TAG 
)

◆ WdfRequestCompleteWithInformation()

◆ WdfStringGetUnicodeString() [1/2]

WdfStringGetUnicodeString ( Original  ,
&  Name 
)

◆ WdfStringGetUnicodeString() [2/2]

WdfStringGetUnicodeString ( String  ,
&  Text 
)

Variable Documentation

◆ ActualLength

◆ Attempt

ULONG Attempt

Definition at line 701 of file userreq.cpp.

Referenced by AtaPortIdentifyDevice(), and IopParseDevice().

◆ Attributes

Definition at line 238 of file userreq.cpp.

◆ Block

PUSBUSER_REQUEST_HEADER Block = NULL

Definition at line 697 of file userreq.cpp.

Referenced by _msize(), _recalloc(), calloc(), co_IntCallLowLevelHook(), co_MsqSendMessage(), ConSrvInsertObject(), ATL::CAtlPlex::Create(), CTEBlock(), CTESignal(), ATL::CAtlPlex::Destroy(), DumpCBW(), ExfAcquirePushLockExclusive(), ExfAcquirePushLockShared(), ExFreeToZone(), ExpCheckPoolBlocks(), Ext2AddBlockExtent(), Ext2AddMcbMetaExts(), Ext2BuildExtents(), Ext2CheckSetBlock(), Ext2DoExtentExpand(), Ext2ExpandBlock(), Ext2ExpandExtent(), Ext2ExpandLast(), Ext2FreeBlock(), Ext2GetBlock(), Ext2InitializeZone(), Ext2LookupBlockExtent(), Ext2MapExtent(), Ext2NewBlock(), Ext2RemoveMcbMetaExts(), FAST486_OPCODE_HANDLER(), FAT16CountAvailableClusters(), FAT16FindAndMarkAvailableCluster(), FAT32CountAvailableClusters(), FAT32FindAndMarkAvailableCluster(), FixupUpdateSequenceArray(), for(), Free(), free(), FrLdrHeapAllocateEx(), FrLdrHeapCreate(), FrLdrHeapFreeEx(), FrLdrHeapRelease(), FrLdrHeapRemoveFreeList(), FrLdrHeapVerify(), ATL::CAtlList< E, ETraits >::GetFreeNode(), HubMachine::GetRootHub20Ports(), HubMachine::GetRootHub30Ports(), Heap32First(), Heap32Next(), HubSha1Compress(), HvIsCellAllocated(), HvpAddBin(), HvpGetCellHeader(), HvpWriteHive(), HvpWriteLog(), if(), InsertConsole(), IntKeyboardGetIndicatorTrans(), IntKeyboardUpdateLeds(), MockExFreePool(), MyFreePool(), NdisAllocateMemoryWithTag(), NtfsFixupRecord(), realloc(), RtlpDphGetBlockSizeFromCorruptedBlock(), RtlpDphIsPageHeapBlock(), RtlpDphReportCorruptedBlock(), RtlValidateHeap(), SHA1Transform(), UDFReadTagged(), and UserInitKeyboard().

◆ Count

_In_ WDFDEVICE _In_ WDF_DEVICE_HWACCESS_TARGET_TYPE _In_ WDF_DEVICE_HWACCESS_TARGET_SIZE _In_ PVOID _In_ SIZE_T _In_opt_ ULONG Count = Name.Length / sizeof(WCHAR)

Definition at line 200 of file userreq.cpp.

Referenced by $if(), __inbytestring(), __indwordstring(), __inwordstring(), __movsb(), __movsd(), __movsw(), __outbytestring(), __outdwordstring(), __outwordstring(), __RtlImageRvaToSection(), __stosb(), __stosd(), __stosw(), FxChildList::_ComputeRelationsSize(), FxPortResourceInfo::_CreateAndInit(), FxRegisterResourceInfo::_CreateAndInit(), ATL::CRegKey::_DoDeleteKeyTree(), _recalloc(), _Success_(), _tmain(), A< T1 >::A(), A_SHAFinal(), ACPIEnumerateDevices(), AcpiExConvertToInteger(), AcpiExIntegerToString(), AcpiNsCheckPackage(), AcpiNsCheckPackageList(), AcpiNsConvertToBuffer(), AcpiNsCustomPackage(), AcpiNsRemoveElement(), AcpiNsRemoveNullElements(), AcpiNsSortList(), AcpiRsConvertAmlToResource(), AcpiRsConvertResourceToAml(), AcpiRsDumpDescriptor(), AcpiRsDumpIrqList(), AcpiRsDumpResourceList(), AcpiRsEncodeBitmask(), AcpiUtBoundStringLength(), AcpiUtCheckAndRepairAscii(), AcpiUtCreatePackageObject(), AcpiUtDebugDumpBuffer(), AcpiUtDumpBuffer(), AcpiUtExecute_CID(), AcpiUtExecute_CLS(), AcpiUtShortShiftLeft(), AcpiUtShortShiftRight(), AcquireReadLock(), FxResourceCollection::AddAt(), AddDlg_OnInitDialog(), AddNewKbLayoutsByLcid(), AfdEventReceiveDatagramHandler(), AllocateInterfaceDescriptorsArray(), XhciEndpoint::AnyTransfersPending(), ArbpQueryConflict(), ArcRead(), ARRAY_EnsureSize(), AtapiStringCmp(), AtapiSuckPortBuffer2(), AtapiZeroMemory(), AtaReadBlock16(), AtaReadBlock32(), AtaWriteBlock16(), AtaWriteBlock32(), AVrfpCountThunks(), BackupBootSector(), BiosMiscService(), BITMAP_GetObject(), BochsQueryAvailableModes(), BootAnimInitialize(), BuildArgvForOsLoader(), calloc(), CaptureGateOnWorkItem(), CcCopyWrite(), CcpCountCacheSections(), CcWriteBehind(), CdCleanupFileContext(), CdIs8dot3Name(), ChanMgrIsFull(), CheckBuffer(), CheckMsOs20Platform(), CheckPattern(), ChecksumCompute(), CheckVolume(), clean_main(), CmBattOpenClose(), CmpAddValueToList(), CmpCompareInIndex(), CmpDoFindSubKeyByNumber(), CmpRemoveFastIndexKeyCell(), CmpRemoveIndexKeyCell(), CmpRemoveSubKey(), CmpRemoveValueFromList(), CmpRepairSubKeyCounts(), CmSetValueKey(), CODE_SEG(), ConvertCoffs(), ConvertLargeMCBToDataRuns(), ConvertStabs(), CopyPacketToBufferChain(), CountBTreeKeys(), CountHandlers(), CountInterfaces(), CpSetBaud(), FxCmResList::CreateWdmList(), FxIoResReqList::CreateWdmList(), CredEnumerateA(), CredEnumerateW(), CsrCaptureMessageMultiUnicodeStringsInPlace(), ddraw_surface7_BltBatch(), DECLARE_INTERFACE_(), DetectSerialPorts(), DGReceiveComplete(), DIB_16BPP_HLine(), DIB_24BPP_ColorFill(), DIB_24BPP_HLine(), XhciUsbDevice::DisableEndpointList(), disk_read(), DiskBootDriverReinit(), DiskDriverReinit(), DiskRead(), DispDataRequestComplete(), DisplayPendingOps(), DnsAddrArray_Create(), DoExport(), DoHelpCommand(), DoLAYOUT(), DoScroll(), DosFindDeviceDescriptor(), DosFindFreeDescriptor(), DosFindWin32Descriptor(), DosReadFile(), DosWriteFile(), DrvEvaluateGtmObject(), DrvTestCard1Dev5QueryResourceRequirements(), DrvTestCard1Dev6QueryResourceRequirements(), DumpAllRuns(), DumpFlags(), EditDlg_OnInitDialog(), EmulatorReadIo(), EmulatorWriteIo(), EngQueryPerformanceCounter(), XhciTransferRing::EnsureFreeSegments(), EnumDeviceDrivers(), EnumProcesses(), EnumProcessModules(), EnumPropsA(), EnumPropsExA(), EnumPropsExW(), EnumPropsW(), EvalCreateOutputArguments(), EvalGetElementSize(), ExAllocateCacheAwareRundownProtection(), ExCompareExchangeCallBack(), ExfAcquireRundownProtectionCacheAwareEx(), ExfAcquireRundownProtectionEx(), ExfReleaseRundownProtectionCacheAwareEx(), ExfReleaseRundownProtectionEx(), ExfWaitForRundownProtectionRelease(), ExInitializeRundownProtectionCacheAware(), ExIsResourceAcquiredSharedLite(), ExpInitializeExecutive(), ExReferenceCallBackBlock(), ExReleaseResourceForThreadLite(), Ext2ExpandExtent(), Ext2FreeBlock(), Ext2GetBlock(), Ext2NewBlock(), ExtMount(), ExtRead(), ExtReadSuperBlock(), ExtReadVolumeSectors(), UcxUsbDevice::FanOutToEndpoints(), FAST486_OPCODE_HANDLER(), Fast486RotateOperation(), FatFlushFatEntries(), FatMount(), FatRead(), FatReadVolumeSectors(), FillPolygon(), FindCheckItem(), FindMatchingCreateItem(), FindModule(), FltpDetachFromFileSystemDevice(), FltRegisterFilter(), XhciEndpoint::ForEachRing(), FsRtlLookupBaseMcbEntry(), FsRtlNumberOfRunsInBaseMcb(), FstubAdjustPartitionCount(), ftGdiGetKerningPairs(), GetCacheInfoAmdLegacy(), GetCacheInfoIntelLeaf2(), FxCmResList::GetCount(), GetFileSystemByName(), GetFontFamilyInfoForList(), GetLayoutCount(), GetLogicalPartitionCount(), GetPartitionCount(), GetPrimaryPartitionCount(), GetSysAudioDeviceCount(), GetTextboxText(), gl_render_vb(), GreExtTextOutW(), GreGetCharABCWidthsW(), GreGetCharWidthW(), GreGetKerningPairs(), GreGetTextExtentExW(), HalCalibratePerformanceCounter(), HaliReadMPConfigTable(), HalpCalibrateStallExecution(), HalpQueryAcpiResourceRequirements(), HalpReportResourceUsage(), HalReadDmaCounter(), UcxUsbDevice::HandleHubEndpointsConfigure(), UcxUsbDevice::HandleHubReset(), UcxUsbDevice::HandleHubTreePurge(), HDA_TransferCodecVerbs(), HDA_WaitForTransfer(), HidParser_GetCollectionCount(), HTMLTxtRange_move(), HTMLTxtRange_moveEnd(), HTMLTxtRange_moveStart(), HubCacheSublinkSpeeds(), HubChildKeepUnchanged(), HubChildSizeEndpointArrays(), HubFindHubInterface(), HubIdLanguageSupported(), HubUsb4FindHost(), HubWmiHubName(), IKsFilter_fnRemoveProcessPin(), ILGetConnection(), implicit_handle(), InbvDriverInitialize(), InfOpenFile(), InfoTdiQueryListEntities(), IniFileInitialize(), CEnumIDList::Initialize(), CLanStatus::InitializeNetTaskbarNotifications(), InitOperatingSystemList(), InitPaletteWithTable(), IntCreateCompatibleBitmap(), IntExtTextOutW(), IntFillPolygon(), IntGdiGetFontResourceInfo(), IntGdiPolyBezier(), IntGdiPolyBezierTo(), IntGdiPolygon(), IntGdiPolyline(), IntGdiPolylineTo(), IntGdiPolyPolygon(), IntGdiPolyPolyline(), IntGetFontLocalizedName(), IntGetTextDisposition(), IntMultiByteToWideCharCP(), IntMultiByteToWideCharSYMBOL(), IntMultiByteToWideCharUTF8(), IntPolygon(), IntWideCharToMultiByteSYMBOL(), IoConnectInterrupt(), FxPowerIdleMachine::IoIncrementWithFlags(), IopSetServiceEnumData(), IOReadStrB(), IOReadStrD(), IOReadStrW(), IOWriteStrB(), IOWriteStrD(), IOWriteStrW(), IsoBufferDirectory(), IsoMount(), IsoRead(), IterateStabs(), ITextDocument2Old_fnRedo(), ITextDocument2Old_fnUndo(), KdbpCmdDisassembleX(), KdbpCmdStep(), KdbpSymFindModule(), KdbpSymSearchModuleList(), KdpDriverReinit(), KdRosDumpStackFrames(), KeAddSystemServiceTable(), KeInitializeQueue(), KeInitializeSemaphore(), KeIpiGenericCall(), KeWaitForMultipleObjects(), KiGetCacheInfoModern(), KiGetCpuCacheDescriptors(), KiScanReadyQueues(), KiSystemCallHandler(), KmtFilterRegisterCallbacks(), KsAllocateExtraData(), KsFilterAddTopologyConnections(), KsFilterCreatePinFactory(), KspCopyEventSets(), KspCopyMethodSets(), KspCopyPropertySets(), KspCountEventSets(), KspCountMethodSets(), KspCountPropertySets(), KspPinPropertyHandler(), KspQueryBusRelations(), KspValidateConnectRequest(), LdrEnumResources(), LdrProcessRelocationBlock(), LdrProcessRelocationBlockLongLong(), LdrpRunInitializeRoutines(), LdrRelocateImageWithBias(), LockBuffers(), LsaLookupNames(), LsaLookupNames2(), LsaLookupSids(), LsapLookupAccountNames(), LsapLookupBuiltinNames(), LsapLookupFullyQualifiedWellKnownNames(), LsapLookupIsolatedAccountNames(), LsapLookupIsolatedBuiltinNames(), LsapLookupIsolatedNames(), LsapLookupNames(), LsapSplitNames(), LsarLookupNames(), LsarLookupNames2(), LsarLookupNames3(), LsarLookupNames4(), LV_AddItems(), main(), MainWnd_OnUpdateRegistry(), MainWndDropFiles(), MakePattern(), XhciRegisters::MapRegisters(), memcmp(), memcpy(), MemFastMoveMemory(), memmove(), memset(), MiBuildPfnDatabaseFromPages(), MiProcessValidPteList(), MiRemoveFromSystemSpace(), MkI30RootWithEntries(), MkRootIndxBlock(), MkSetHardLinks(), MkViewIndxBlock(), MkViewRootN(), MmCommitSessionMappedView(), MmCreateProcessAddressSpace(), MMixerAddMixerControlsToMixerLineByNodeIndexArray(), MMixerAddPinConnection(), MMixerAddPinToPinConnection(), MMixerApplyOutputFilterHack(), MMixerCountMixerControls(), MMixerGetNodeType(), MMixerHandleNodeToNodeConnection(), MMixerInitialize(), MpsTimerHandler(), NdisCopyFromPacketToPacket(), NdisCopyFromPacketToPacketSafe(), NdisQueryPacket(), NetUserGetLocalGroups(), NICReadDataAlign(), NICWriteDataAlign(), NLS_RecordsCountForDBCSTable(), NLS_RecordsCountForGlyphTable(), NLS_RecordsCountForMBTable(), NLS_RecordsCountForUnicodeTable(), NormalizeArcDeviceName(), NpCompareAliasNames(), NtCreatePagingFile(), NtfsDiskRead(), NtfsFlushVolumeFiles(), NtfsMount(), NtfsRead(), NtfsRelinkFileNames(), NtGdiExtCreateRegion(), NtGdiExtTextOutW(), NtGdiGetCharABCWidthsW(), NtGdiGetCharWidthW(), NtGdiGetKerningPairs(), NtGdiGetTextExtentExW(), NtGdiGetTextFaceW(), NtGdiPolyPolyDraw(), NtGdiTransformPoints(), NtQueryDirectoryObject(), NtUserBuildPropList(), NtUserGetRawInputBuffer(), ObDeassignSecurity(), ObDereferenceObjectEx(), ObDereferenceSecurityDescriptor(), ObFastReferenceObject(), ObFastReplaceObject(), ObpReferenceSecurityDescriptor(), ObReferenceObjectEx(), ObReferenceSecurityDescriptor(), ObSetSecurityDescriptorInfo(), CEditCompatModes::OnButton(), UcxUsbDevice::OnHcdEndpointsConfigureDone(), OnSelChange(), OnSet(), UcxEndpoint::OpenStaticStreams(), OverrideFileContent(), XhciRootHub::ParseProtocol(), PciAddResizableBarRequirements(), PciAllocateCmResourceList(), PciAllocateIoRequirementsList(), PciBuildRequirementsList(), PciDebugPrintCmResList(), PciDebugPrintIoResReqList(), PciGetDescriptionMessage(), PciQueryResources(), PciUpdateDeviceUsage(), PiInitCacheGroupInformation(), PipGetDriverTagPriority(), PiPropBuiltinTable(), PiPropCheckElements(), PiPropFindBuiltin(), PitClock(), PitDecrementCount(), PNP_GetFirstLogConf(), PNP_GetNextLogConf(), PnpRegMultiSzToUnicodeStrings(), Polygon(), POLYGONFILL_MakeEdgeList(), PortCompletionDpc(), PortInsB(), PortInsW(), PortOutsB(), PortOutsW(), PreserveRow(), PrintAllVCNs(), PrintHelpMessage(), ProcessHasDescendants(), PUEFI_LoadMemoryMap(), PushLockEnterProtectedRegion(), PushLockLeaveProtectedRegion(), PxeRead(), QueryHKCRValue(), QueryOperatingSystemInfo(), QueryPerformanceFrequency(), QueryProcessorInfo(), RamDiskLoadVirtualFile(), RamdiskQueryDeviceRelations(), RamDiskRead(), RandomFill128(), RandomFill256(), RandomFill512(), Read8253Timer(), Read8254Timer(), READ_PORT_BUFFER_UCHAR(), READ_PORT_BUFFER_ULONG(), READ_PORT_BUFFER_USHORT(), FxDevice::ReadRegisterBuffer(), REGION_CreateETandAET(), ReleaseReadLock(), RtlCopyLuidAndAttributesArray(), RtlCopySidAndAttributesArray(), RtlFillMemoryUlong(), RtlImageRvaToSection(), RtlInterlockedPushListSList(), RtlLengthSidAndAttributes(), RtlMultipleAllocateHeap(), RtlMultipleFreeHeap(), RtlpRemoveHeapFromProcessList(), RtlWalkFrameChain(), SaBlob_Create(), SaBlob_CreateFromIp4(), SamLookupIdsInDomain(), SamLookupNamesInDomain(), SampGetMembersInAlias(), SampGetNumberOfAccounts(), SamrLookupIdsInDomain(), SamrLookupNamesInDomain(), SaveFontSubstitutionSettings(), ScServiceDispatcher(), ScsiPortInitialize(), ScsiPortReadPortBufferUchar(), ScsiPortReadPortBufferUlong(), ScsiPortReadPortBufferUshort(), ScsiPortReadRegisterBufferUchar(), ScsiPortReadRegisterBufferUlong(), ScsiPortReadRegisterBufferUshort(), ScsiPortWritePortBufferUchar(), ScsiPortWritePortBufferUlong(), ScsiPortWritePortBufferUshort(), ScsiPortWriteRegisterBufferUchar(), ScsiPortWriteRegisterBufferUlong(), ScsiPortWriteRegisterBufferUshort(), SearchForLegacyDrivers(), SerenumDetectLegacyDevice(), SermouseDetectLegacyDevice(), SetParameters(), shade_vertices(), CNetConnectionPropertyUi::ShowNetworkComponentProperties(), XhciIsochRing::SizeStage(), CHString::SpanExcluding(), CHString::SpanIncluding(), SpiParseDeviceInfo(), StartApplication(), UcxUsbDevice::StartOperation(), StorPortReadPortBufferUchar(), StorPortReadPortBufferUlong(), StorPortReadPortBufferUshort(), StorPortReadRegisterBufferUchar(), StorPortReadRegisterBufferUlong(), StorPortReadRegisterBufferUshort(), StorPortWritePortBufferUchar(), StorPortWritePortBufferUlong(), StorPortWritePortBufferUshort(), StorPortWriteRegisterBufferUchar(), StorPortWriteRegisterBufferUlong(), StorPortWriteRegisterBufferUshort(), strncat(), strncmp(), strncpy(), XhciTransferRing::TakeSegments(), Test_collided_unwind(), test_ExpectFolders_imp(), test_pack_RPC_BINDING_VECTOR(), test_pack_UUID_VECTOR(), Test_SyscallPerformance(), TestDefaultFormat(), TestHDROP(), TestPairExtraction(), TestPushLockSharedOwnerDrain(), TestPushLockUncontended(), TestResourceExclusiveAccess(), TestResourceSharedAccess(), TestResourceUndocumentedShortcuts(), TextIntGetTextExtentPoint(), TuiProcessMenuKeyboardEvent(), UcxApplyStreamCountOverride(), UcxCreateStaticStreams(), UDFIndexDirectory(), UefiDiskRead(), UefiFindAcpiTable(), UnlockBuffers(), UpdateGptDiskLayout(), USBCCGP_CountAssociationDescriptors(), USBCCGP_GetAssociationDescriptorAtIndex(), USBCCGP_InitInterfaceListOfFunctionDescriptor(), USBPORT_RH_SetFeatureUSB2PortPower(), VfatWriteFileData(), VfdReinitialize(), VgaInterpretCmdStream(), VideoPortDDCMonitorHelper(), WahInsertHandleContext(), WahReferenceContextByHandle(), wmain(), Write8253Timer(), write_path_data(), WRITE_PORT_BUFFER_UCHAR(), WRITE_PORT_BUFFER_ULONG(), WRITE_PORT_BUFFER_USHORT(), WriteLineSettings(), FxDevice::WriteRegisterBuffer(), XboxGetFramebufferSize(), XboxGetMultibootMemoryMap(), XboxMemGetMemoryMap(), XhciIsochCountList(), XhciMaxPrimaryStreams(), XhciRingCountList(), XhciStreamsSize(), A< T1 >::~A(), and COpenWithMenu::~COpenWithMenu().

◆ else

else
Initial value:
{
DPRINT1("Driver key name query on %p failed 0x%lx\n", Fdo, Status)

Definition at line 178 of file userreq.cpp.

◆ Fdo

_In_ WDFDEVICE Fdo
Initial value:
{
PUSB_UNICODE_NAME Name = User.Payload<USB_UNICODE_NAME>()

Definition at line 152 of file userreq.cpp.

◆ Fits

Definition at line 703 of file userreq.cpp.

Referenced by if().

◆ IoControlCode

Initial value:

Definition at line 694 of file userreq.cpp.

◆ Length

Definition at line 235 of file userreq.cpp.

◆ MaximumLength

Definition at line 236 of file userreq.cpp.

◆ Name

Name = (PUSB_UNICODE_NAME)(Block + 1)

Definition at line 197 of file userreq.cpp.

Referenced by if().

◆ Original

◆ Output

_In_ HubPort _In_ PCANSI_STRING _In_ WDFMEMORY Output
Initial value:

Definition at line 699 of file userreq.cpp.

Referenced by ApiSetResolveToHost(), BasepDoTapeOperation(), ChkdskCallback(), CpiIsNekoProject(), CreateActionBlock(), CreateBase(), CreateBitBlt(), CreateBitCase(), CreateCounts(), CreateGetSource(), CreateOperation(), CreatePrimitive(), CreateSetSinglePixel(), CreateShiftTables(), CreateTable(), DbgPrompt(), DebugPrompt(), DECLARE_INTERFACE_(), DetectBiosDisks(), DetectBiosFloppyController(), DetectBiosFloppyPeripheral(), DetectDisplayController(), DetectParallelPorts(), DetectSerialPorts(), FindBootDisplayFromLoaderARCTree(), Generate(), GetCommonString(), GetGenerateString(), GetLocalizedSMFolderName(), i8042KbdInterruptService(), i8042MouHandle(), i8042MouInterruptService(), i8042PacketIsr(), if(), IIndirectedUnknown_fnQueryInterface(), IKsAllocator_fnQueryInterface(), IKsControl_fnQueryInterface(), IKsDevice_fnQueryInterface(), IKsFilter_fnQueryInterface(), IKsFilterFactory_fnQueryInterface(), IKsPin_fnQueryInterface(), IKsProcessingObject_fnQueryInterface(), IKsReferenceClock_fnQueryInterface(), InfpBuildFileBuffer(), INonDelegatedUnknown_fnQueryInterface(), IntCreateDICW(), IopGetDeviceNodeStatus(), KdbPrintString(), KdbPrintStringWorker(), KdbPutsN(), KdpPrintString(), LanEnumAdapters(), LockRequest(), MountMgrQueryDosVolumePath(), MountMgrQueryDosVolumePaths(), PrintRoutineName(), CControlNode::QueryInterface(), CBDADeviceControl::QueryInterface(), CBDADigitalDemodulator::QueryInterface(), CBDAFrequencyFilter::QueryInterface(), CBDALNBInfo::QueryInterface(), CBDAPinControl::QueryInterface(), CBDASignalStatistics::QueryInterface(), CKsAllocator::QueryInterface(), CKsBasicAudio::QueryInterface(), CKsClockForwarder::QueryInterface(), CVPConfig::QueryInterface(), CVPVBIConfig::QueryInterface(), CKsDataTypeHandler::QueryInterface(), CInputPin::QueryInterface(), CKsInterfaceHandler::QueryInterface(), CMediaSample::QueryInterface(), CKsNode::QueryInterface(), COutputPin::QueryInterface(), CKsProxy::QueryInterface(), CKsQualityForwarder::QueryInterface(), CNetworkProvider::QueryInterface(), CPin::QueryInterface(), CScanningTunner::QueryInterface(), CEnumTuningSpaces::QueryInterface(), CTuneRequest::QueryInterface(), CTuningSpace::QueryInterface(), CTuningSpaceContainer::QueryInterface(), CUnregisterPhysicalConnection::QueryInterface(), CDmaChannelInit::QueryInterface(), CDrmPort2::QueryInterface(), CPortFilterDMus::QueryInterface(), CPortFilterTopology::QueryInterface(), CPortFilterWaveCyclic::QueryInterface(), CPortFilterWavePci::QueryInterface(), CPortFilterWaveRT::QueryInterface(), CInterruptSync::QueryInterface(), CIrpQueue::QueryInterface(), CPortPinDMus::QueryInterface(), CPortPinWaveCyclic::QueryInterface(), CPortPinWavePci::QueryInterface(), CPortPinWaveRT::QueryInterface(), CPortDMus::QueryInterface(), CPortTopology::QueryInterface(), CPortWaveCyclic::QueryInterface(), CPortWavePci::QueryInterface(), CPortWaveRT::QueryInterface(), CPortWaveRTStreamInit::QueryInterface(), CRegistryKey::QueryInterface(), CResourceList::QueryInterface(), CServiceGroup::QueryInterface(), CUnregisterSubdevice::QueryInterface(), CPortClsVersion::QueryInterface(), ReadIniValue(), SHELL_DupSZZ(), CJournaledTestList::UnserializeFromBuffer(), XhciEvaluateAcpiMethod(), and XhciQueryAcpiIdentity().

◆ OutputBufferLength

Definition at line 693 of file userreq.cpp.

◆ ParentObject

◆ Request

_In_ WDFREQUEST Request

Definition at line 692 of file userreq.cpp.

◆ ResultLength

Definition at line 156 of file userreq.cpp.

◆ RootHub

Initial value:
{
PUSB_UNICODE_NAME Name = User.Payload<USB_UNICODE_NAME>()

Definition at line 243 of file userreq.cpp.

◆ RootHubName

Output RootHubName[0] = UNICODE_NULL

Definition at line 783 of file userreq.cpp.

Referenced by USBPORT_GetSymbolicName(), and USBPORT_UserGetRootHubName().

◆ Size

Definition at line 263 of file userreq.cpp.

Referenced by for().

◆ Skip

◆ Space

ULONG Space = User.NameSpace()

◆ Status

Definition at line 157 of file userreq.cpp.

Referenced by UcxUserRequest::SetStatus().

◆ String

WDFSTRING String

Definition at line 262 of file userreq.cpp.

◆ Stripped

* Stripped
Initial value:

Definition at line 194 of file userreq.cpp.

◆ Text

◆ UcxUserRequestSizes

const UcxUserRequestSize UcxUserRequestSizes[]
static
Initial value:
=
{
{ USBUSER_GET_CONTROLLER_INFO_0, sizeof(USB_CONTROLLER_INFO_0) },
{ USBUSER_GET_CONTROLLER_DRIVER_KEY, sizeof(USB_UNICODE_NAME) },
{ USBUSER_PASS_THRU, sizeof(USB_PASS_THRU_PARAMETERS) },
{ USBUSER_GET_POWER_STATE_MAP, sizeof(USB_POWER_INFO) },
{ USBUSER_GET_BANDWIDTH_INFORMATION, sizeof(USB_BANDWIDTH_INFO) },
{ USBUSER_GET_BUS_STATISTICS_0, sizeof(USB_BUS_STATISTICS_0) },
{ USBUSER_GET_ROOTHUB_SYMBOLIC_NAME, sizeof(USB_UNICODE_NAME) },
{ USBUSER_GET_USB_DRIVER_VERSION, sizeof(USB_DRIVER_VERSION_PARAMETERS) },
{ USBUSER_USB_REFRESH_HCT_REG, sizeof(ULONG) },
{ USBUSER_OP_SEND_ONE_PACKET, sizeof(PACKET_PARAMETERS) },
{ USBUSER_OP_RAW_RESET_PORT, sizeof(RAW_RESET_PORT_PARAMETERS) },
{ USBUSER_SET_ROOTPORT_FEATURE, sizeof(RAW_ROOTPORT_FEATURE) },
{ USBUSER_CLEAR_ROOTPORT_FEATURE, sizeof(RAW_ROOTPORT_FEATURE) },
{ USBUSER_GET_ROOTPORT_STATUS, sizeof(RAW_ROOTPORT_FEATURE) }
}

Definition at line 512 of file userreq.cpp.

Referenced by UcxLookupUserRequestSize().