相关文章推荐
PVOID NTAPI AllocFunction ( IN ULONG ItemSize ) VOID NTAPI FreeFunction ( IN PVOID Item ) VOID NTAPI ZeroFunction ( IN PVOID Item , IN ULONG ItemSize ) VOID NTAPI CopyFunction ( IN PVOID Target , IN PVOID Source , IN ULONG Length ) VOID __cdecl DebugFunction ( IN LPCSTR FormatStr,...) BOOL WINAPI DllMain ( HINSTANCE hinstDLL, DWORD dwReason , LPVOID lpvReserved ) HIDAPI BOOLEAN WINAPI HidD_FlushQueue ( IN HANDLE HidDeviceObject) HIDAPI BOOLEAN WINAPI HidD_FreePreparsedData ( IN PHIDP_PREPARSED_DATA PreparsedData ) HIDAPI BOOLEAN WINAPI HidD_GetAttributes ( IN HANDLE HidDeviceObject, OUT PHIDD_ATTRIBUTES Attributes ) HIDAPI BOOLEAN WINAPI HidD_GetFeature ( IN HANDLE HidDeviceObject, OUT PVOID ReportBuffer, IN ULONG ReportBufferLength) HIDAPI VOID WINAPI HidD_GetHidGuid ( OUT LPGUID HidGuid) HIDAPI BOOLEAN WINAPI HidD_GetInputReport ( IN HANDLE HidDeviceObject, IN OUT PVOID ReportBuffer, IN ULONG ReportBufferLength) HIDAPI BOOLEAN WINAPI HidD_GetManufacturerString ( IN HANDLE HidDeviceObject, OUT PVOID Buffer , IN ULONG BufferLength ) HIDAPI BOOLEAN WINAPI HidD_GetNumInputBuffers ( IN HANDLE HidDeviceObject, OUT PULONG NumberBuffers) HIDAPI BOOLEAN WINAPI HidD_GetPhysicalDescriptor ( IN HANDLE HidDeviceObject, OUT PVOID Buffer , IN ULONG BufferLength ) HIDAPI BOOLEAN WINAPI HidD_GetPreparsedData ( IN HANDLE HidDeviceObject, OUT PHIDP_PREPARSED_DATA * PreparsedData ) HIDAPI BOOLEAN WINAPI HidD_GetProductString ( IN HANDLE HidDeviceObject, OUT PVOID Buffer , IN ULONG BufferLength ) HIDAPI BOOLEAN WINAPI HidD_GetSerialNumberString ( IN HANDLE HidDeviceObject, OUT PVOID Buffer , IN ULONG BufferLength ) HIDAPI ULONG WINAPI HidD_Hello ( OUT PCHAR Buffer , IN ULONG BufferLength ) HIDAPI BOOLEAN WINAPI HidD_SetFeature ( IN HANDLE HidDeviceObject, IN PVOID ReportBuffer, IN ULONG ReportBufferLength) HIDAPI BOOLEAN WINAPI HidD_SetNumInputBuffers ( IN HANDLE HidDeviceObject, IN ULONG NumberBuffers) HIDAPI BOOLEAN WINAPI HidD_SetOutputReport ( IN HANDLE HidDeviceObject, IN PVOID ReportBuffer, IN ULONG ReportBufferLength) HIDAPI BOOLEAN WINAPI HidD_GetIndexedString ( IN HANDLE HidDeviceObject, IN ULONG StringIndex , OUT PVOID Buffer , IN ULONG BufferLength ) HIDAPI BOOLEAN WINAPI HidD_GetMsGenreDescriptor ( IN HANDLE HidDeviceObject, OUT PVOID Buffer , IN ULONG BufferLength ) HIDAPI BOOLEAN WINAPI HidD_GetConfiguration ( IN HANDLE HidDeviceObject, OUT PHIDD_CONFIGURATION Configuration , IN ULONG ConfigurationLength) HIDAPI BOOLEAN WINAPI HidD_SetConfiguration ( IN HANDLE HidDeviceObject, IN PHIDD_CONFIGURATION Configuration , IN ULONG ConfigurationLength) Variables HINSTANCE hDllInstance const GUID HidClassGuid = {0x4D1E55B2, 0xF16F, 0x11CF, {0x88,0xCB,0x00,0x11,0x11,0x00,0x00,0x30}}

Macro Definition Documentation

NDEBUG

48 return LocalAlloc ( LHND , ItemSize );
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
static UCHAR ItemSize[4]
Definition: parser.c:16
#define LHND
Definition: winbase.h:382

Referenced by BuildUSBAudioFilterTopology() , FilterAudioVolumeHandler() , HidParser_AddCollection() , HidParser_AddReportToCollection() , HidParser_AllocateCollection() , HidParser_AllocateReport() , HidParser_BuildContext() , HidParser_GetCollectionDescription() , HidParser_ParseReportDescriptor() , HidParser_ReserveReportItems() , InitCapturePin() , InitStreamPin() , RenderInitializeUrbAndIrp() , UsbAudioAllocCaptureUrbIso() , USBAudioCreateFilterContext() , USBAudioFilterCreate() , UsbAudioGetDataRanges() , USBAudioGetDescriptor() , UsbAudioGetSetProperty() , USBAudioPinBuildDescriptors() , USBAudioPinCreate() , USBAudioPnPStart() , USBAudioSelectAudioStreamingInterface() , USBAudioSelectConfiguration() , UsbAudioSetFormat() , and USBAudioStartDevice() .

#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define va_arg(ap, T)
Definition: acmsvcex.h:89
NTSYSAPI ULONG NTAPI vDbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ PCCH Format, _In_ va_list ap)
list
#define list
Definition: rosglue.h:35

Referenced by HidParser_AllocateCollection() , HidParser_GetCollection() , HidParser_GetCollectionDescription() , and HidParser_ParseReportDescriptor() .

112 }
DWORD dwReason
Definition: misc.cpp:154
#define TRUE
Definition: types.h:120
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define DLL_THREAD_ATTACH
Definition: compat.h:132
HINSTANCE hDllInstance
Definition: hid.c:38
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

Referenced by FilterAudioVolumeHandler() , HidParser_AddCollection() , HidParser_AddReportToCollection() , HidParser_FreeCollectionDescription() , HidParser_GetCollectionDescription() , HidParser_GetReport() , HidParser_ParseReportDescriptor() , USBAudioCreateFilterContext() , USBAudioGetDescriptor() , UsbAudioGetSetProperty() , USBAudioInitComponentId() , UsbAudioRenderComplete() , USBAudioSelectAudioStreamingInterface() , USBAudioSelectConfiguration() , UsbAudioSetFormat() , and USBAudioStartDevice() .

123 {
124 DWORD RetLen;
125 return DeviceIoControl (HidDeviceObject, IOCTL_HID_FLUSH_QUEUE ,
126 NULL , 0,
127 NULL , 0,
128 &RetLen, NULL ) != 0;
129 }
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IOCTL_HID_FLUSH_QUEUE
Definition: hidclass.h:57

Definition at line 139 of file hid.c .

140 {
142 }
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG _In_ PHIDP_PREPARSED_DATA PreparsedData
Definition: hidpi.h:335

Referenced by get_device() , test_device_info() , test_get_input_report() , and test_read_device() .

156 DWORD RetLen;
159 NULL , 0,
160 &hci, sizeof ( HID_COLLECTION_INFORMATION ),
161 &RetLen, NULL ))
162 {
163 return FALSE ;
164 }
166 /* copy the fields */
167 Attributes ->Size = sizeof ( HIDD_ATTRIBUTES );
168 Attributes ->VendorID = hci. VendorID ;
169 Attributes ->ProductID = hci. ProductID ;
170 Attributes ->VersionNumber = hci. VersionNumber ;
172 return TRUE ;
173 }
FALSE
#define FALSE
Definition: types.h:117
#define IOCTL_HID_GET_COLLECTION_INFORMATION
Definition: hidclass.h:59
struct _HIDD_ATTRIBUTES HIDD_ATTRIBUTES
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes

Referenced by test_device_info() .

511 0, 0,
512 & Configuration ->size, ConfigurationLength - sizeof ( ULONG ),
513 ( PULONG )& Configuration ->cookie, NULL ) != 0;
514 }
HIDAPI BOOLEAN WINAPI HidD_GetConfiguration(IN HANDLE HidDeviceObject, OUT PHIDD_CONFIGURATION Configuration, IN ULONG ConfigurationLength)
Definition: hid.c:502
#define IOCTL_HID_GET_DRIVER_CONFIG
Definition: hidclass.h:74
uint32_t * PULONG
Definition: typedefs.h:59
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration

Referenced by HidD_GetConfiguration() , and HidD_SetConfiguration() .

186 {
187 DWORD RetLen;
188 return DeviceIoControl (HidDeviceObject, IOCTL_HID_GET_FEATURE ,
189 NULL , 0,
190 ReportBuffer, ReportBufferLength,
191 &RetLen, NULL ) != 0;
192 }
#define IOCTL_HID_GET_FEATURE
Definition: hidclass.h:60
204 *HidGuid = HidClassGuid ;
205 }
const GUID HidClassGuid
Definition: hid.c:41

Referenced by get_device() , and run_for_each_device() .

469 {
470 DWORD RetLen;
472 & StringIndex , sizeof ( ULONG ),
474 &RetLen, NULL ) != 0;
475 }
#define IOCTL_HID_GET_INDEXED_STRING
Definition: hidclass.h:76
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR StringIndex
Definition: wdfusb.h:1080
218 {
219 DWORD RetLen;
220 return DeviceIoControl (HidDeviceObject, IOCTL_HID_GET_INPUT_REPORT ,
221 NULL , 0,
222 ReportBuffer, ReportBufferLength,
223 &RetLen, NULL ) != 0;
224 }
#define IOCTL_HID_GET_INPUT_REPORT
Definition: hidclass.h:63

Referenced by test_get_input_report() .

237 {
238 DWORD RetLen;
240 NULL , 0,
242 &RetLen, NULL ) != 0;
243 }
#define IOCTL_HID_GET_MANUFACTURER_STRING
Definition: hidclass.h:64
487 {
488 DWORD RetLen;
490 0, 0,
492 &RetLen, NULL ) != 0;
493 }
#define IOCTL_HID_GET_MS_GENRE_DESCRIPTOR
Definition: hidclass.h:77
255 {
256 DWORD RetLen;
258 NULL , 0,
259 NumberBuffers, sizeof ( ULONG ),
260 &RetLen, NULL ) != 0;
261 }
#define IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS
Definition: hidclass.h:65
274 {
275 DWORD RetLen;
277 NULL , 0,
279 &RetLen, NULL ) != 0;
280 }
#define IOCTL_GET_PHYSICAL_DESCRIPTOR
Definition: hidclass.h:56
300 }
303 NULL , 0,
304 &hci, sizeof ( HID_COLLECTION_INFORMATION ),
305 &RetLen, NULL ))
306 {
307 return FALSE ;
308 }
311 if (* PreparsedData == NULL )
312 {
314 return FALSE ;
315 }
318 NULL , 0,
320 &RetLen, NULL ) != 0;
322 if (!Ret)
323 {
324 /* FIXME - Free the buffer in case we failed to get the descriptor? */
326 }
327 #if 0
328 else
329 {
330 /* should we truncate the memory in case RetLen < hci.DescriptorSize? */
331 }
332 #endif
334 return Ret;
335 }
unsigned char BOOLEAN
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define SetLastError(x)
Definition: compat.h:752
#define IOCTL_HID_GET_COLLECTION_DESCRIPTOR
Definition: hidclass.h:58

Referenced by get_device() , test_device_info() , test_get_input_report() , and test_read_device() .

348 {
349 DWORD RetLen;
351 NULL , 0,
353 &RetLen, NULL ) != 0;
354 }
#define IOCTL_HID_GET_PRODUCT_STRING
Definition: hidclass.h:67

Referenced by test_device_info() , test_get_input_report() , and test_read_device() .

367 {
368 DWORD RetLen;
370 NULL , 0,
372 &RetLen, NULL ) != 0;
373 }
#define IOCTL_HID_GET_SERIALNUMBER_STRING
Definition: hidclass.h:68
394 if ( BufferLength > 0)
395 {
396 memcpy ( Buffer , HelloString, min ( sizeof (HelloString), BufferLength ));
397 }
399 return sizeof (HelloString);
400 }
#define min(a, b)
Definition: monoChain.cc:55
char CHAR
Definition: xmlstorage.h:175
527 BOOLEAN Ret = FALSE ;
530 {
532 0, 0,
533 ( PVOID )& Configuration ->size, ConfigurationLength - sizeof ( ULONG ),
534 ( PULONG )& Configuration ->cookie, NULL ) != 0;
535 }
536 else
537 {
539 }
541 return Ret;
542 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define IOCTL_HID_SET_DRIVER_CONFIG
Definition: hidclass.h:75
413 {
414 DWORD RetLen;
415 return DeviceIoControl (HidDeviceObject, IOCTL_HID_SET_FEATURE ,
416 ReportBuffer, ReportBufferLength,
417 NULL , 0,
418 &RetLen, NULL ) != 0;
419 }
#define IOCTL_HID_SET_FEATURE
Definition: hidclass.h:69
431 {
432 DWORD RetLen;
434 &NumberBuffers, sizeof ( ULONG ),
435 NULL , 0,
436 &RetLen, NULL ) != 0;
437 }
#define IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS
Definition: hidclass.h:70
450 {
451 DWORD RetLen;
453 ReportBuffer, ReportBufferLength,
454 NULL , 0,
455 &RetLen, NULL ) != 0;
456 }
#define IOCTL_HID_SET_OUTPUT_REPORT
Definition: hidclass.h:71
#define memset(x, y, z)
Definition: compat.h:39

Referenced by HidParser_GetCaps() , HidParser_GetCollectionDescription() , HidParser_GetSpecificValueCapsWithReport() , HidParser_GetUsagesWithReport() , and HidParser_ParseReportDescriptor() .

Variable Documentation

hDllInstance

 
推荐文章