@@ -61,6 +61,53 @@ public static unsafe extern bool WinUsb_QueryPipe(
6161 byte pipeIndex ,
6262 [ Friendly ( FriendlyFlags . Out ) ] WINUSB_PIPE_INFORMATION * pipeInformation ) ;
6363
64+ /// <summary>
65+ /// The <see cref="WinUsb_FlushPipe"/> function discards any data that is cached in a pipe. This is a synchronous operation.
66+ /// </summary>
67+ /// <param name="interfaceHandle">
68+ /// An opaque handle to the interface with which the specified pipe's endpoint is associated. To clear data in a pipe that is
69+ /// associated with the endpoint on the first (default) interface, use the handle returned by <see cref="WinUsb_Initialize"/>.
70+ /// For all other interfaces, use the handle to the target interface, retrieved by <see cref="WinUsb_GetAssociatedInterface"/>.
71+ /// </param>
72+ /// <param name="pipeID">
73+ /// The identifier (ID) of the control pipe. The PipeID parameter is an 8-bit value that consists of a 7-bit address and a direction bit.
74+ /// This parameter corresponds to the bEndpointAddress field in the endpoint descriptor.
75+ /// </param>
76+ /// <returns>
77+ /// <see cref="WinUsb_FlushPipe"/> returns <see langword="true"/> if the operation succeeds. Otherwise, this routine returns
78+ /// <see langword="false"/>, and the caller can retrieve the logged error by calling <see cref="Kernel32.GetLastError"/>.
79+ /// </returns>
80+ [ DllImport ( nameof ( WinUsb ) , SetLastError = true ) ]
81+ [ return : MarshalAs ( UnmanagedType . Bool ) ]
82+ public static unsafe extern bool WinUsb_FlushPipe (
83+ SafeUsbHandle interfaceHandle ,
84+ byte pipeID ) ;
85+
86+ /// <summary>
87+ /// The <see cref="WinUsb_GetAssociatedInterface"/> function retrieves a handle for an associated interface. This is a synchronous operation.
88+ /// </summary>
89+ /// <param name="interfaceHandle">
90+ /// An opaque handle to the first (default) interface on the device, which is returned by <see cref="WinUsb_Initialize"/>.
91+ /// </param>
92+ /// <param name="associatedInterfaceIndex">
93+ /// An index that specifies the associated interface to retrieve. A value of 0 indicates the first associated interface,
94+ /// a value of 1 indicates the second associated interface, and so on.
95+ /// </param>
96+ /// <param name="associatedInterfaceHandle">
97+ /// A handle for the associated interface. Callers must pass this interface handle to WinUSB Functions exposed by <c>Winusb.dll</c>.
98+ /// To close this handle, call <see cref="WinUsb_Free"/>.
99+ /// </param>
100+ /// <returns>
101+ /// <see cref="WinUsb_GetAssociatedInterface"/> returns <see langword="true"/> if the operation succeeds. Otherwise, this routine returns
102+ /// <see langword="true"/>, and the caller can retrieve the logged error by calling <see cref="Kernel32.GetLastError"/>.
103+ /// </returns>
104+ [ DllImport ( nameof ( WinUsb ) , SetLastError = true ) ]
105+ [ return : MarshalAs ( UnmanagedType . Bool ) ]
106+ public static unsafe extern bool WinUsb_GetAssociatedInterface (
107+ SafeUsbHandle interfaceHandle ,
108+ byte associatedInterfaceIndex ,
109+ out SafeUsbHandle associatedInterfaceHandle ) ;
110+
64111 /// <summary>
65112 /// Writes data to a pipe.
66113 /// </summary>
0 commit comments