Line 4:
Line 4:
===0x11 - UhsQueryInterfaces()===
===0x11 - UhsQueryInterfaces()===
This function is used to determine which USB device interfaces are plugged in and available. Its input is a 0x10-byte buffer containing a series of parameters to filter the interfaces by, such as class, subclass, vendor ID, and product ID. The output is an array of 0x16c-byte interface descriptors, one for each interface being read. IOS_Ioctl() with this function returns the number of attached USB interfaces permitted by the filter.
This function is used to determine which USB device interfaces are plugged in and available. Its input is a 0x10-byte buffer containing a series of parameters to filter the interfaces by, such as class, subclass, vendor ID, and product ID. The output is an array of 0x16c-byte interface descriptors, one for each interface being read. IOS_Ioctl() with this function returns the number of attached USB interfaces permitted by the filter.
+
+
<syntaxhighlight lang="C">
+
/* Determines which parameters to check */
+
#define MATCH_CLASS 0x10
+
#define MATCH_CLASS2 0x80
+
+
/* Input buffer */
+
typedef struct
+
{
+
uint16_t match_params; /* Bitmask of above flags */
+
char unknown2[0xa - 0x2];
+
uint8_t class; /* USB device class */
+
char unknownb[0xd - 0xb];
+
uint8_t class2; /* USB device class again? */
+
char unknowne[0x10 - 0xe];
+
} UhsInterfaceFilter;
+
</syntaxhighlight>