Code update

- WPinternals is now a .NET Core 3.0 application
- Implemented new unlock process for Spec A devices
- Updated logic for unlocking Spec B devices
- Implemented MMOS support for Spec B devices
- Implemented battery status in Flash Mode
- Implemented Fuse configuration information in Flash Mode
- Implemented Reboot from mass storage for Spec A and some Spec B devices
- Implemented shutdown from flash mode (preliminary)
- Fixed label mode support for Spec B
This commit is contained in:
Gus
2019-07-26 17:15:20 +02:00
parent b062efab52
commit 5dae1da560
58 changed files with 5522 additions and 66864 deletions
+8
View File
@@ -384,6 +384,14 @@ namespace MadWizard.WinUSBNet.API
}
public void ResetPipe(int ifaceIndex, byte pipeID)
{
bool success = WinUsb_ResetPipe(InterfaceHandle(ifaceIndex), pipeID);
if (!success)
throw APIException.Win32("Failed to reset pipe on WinUSB device.");
}
public void WritePipe(int ifaceIndex, byte pipeID, byte[] buffer, int offset, int length)
{
uint bytesWritten;
+3
View File
@@ -170,6 +170,9 @@ namespace MadWizard.WinUSBNet.API
[DllImport("kernel32.dll", SetLastError = true)]
private static unsafe extern bool CancelIoEx(IntPtr hFile, NativeOverlapped* pOverlapped);
[DllImport("winusb.dll", SetLastError = true)]
private static unsafe extern bool WinUsb_ResetPipe(IntPtr InterfaceHandle, byte PipeID);
+16
View File
@@ -380,6 +380,22 @@ namespace MadWizard.WinUSBNet
}
}
/// <summary>
/// Resets all pending transfers for this pipe.
/// </summary>
public void Reset()
{
try
{
_device.InternalDevice.ResetPipe(Interface.InterfaceIndex, _pipeInfo.PipeId);
}
catch (API.APIException e)
{
// throw new USBException("Failed to reset pipe.", e);
LogAndThrowException(new USBException("Failed to reset pipe.", e));
}
}
/// <summary>
/// Flushes the pipe, discarding any data that is cached. Only available on IN direction pipes.
/// </summary>