Localize UI text and add copy progress bar
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
using Windows.Win32.Foundation;
|
||||
#pragma warning disable CA1416
|
||||
using Windows.Win32.Foundation;
|
||||
using Windows.Win32.System.Memory;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
using static Windows.Win32.PInvoke;
|
||||
using static BadBuilder.Formatter.Constants;
|
||||
|
||||
namespace BadBuilder.Formatter
|
||||
{
|
||||
[SupportedOSPlatform("windows")]
|
||||
static class Utilities
|
||||
{
|
||||
internal static byte[] StructToBytes<T>(T @struct) where T : struct
|
||||
@@ -80,7 +83,7 @@ namespace BadBuilder.Formatter
|
||||
fixed (byte* pData = &data[0])
|
||||
{
|
||||
if (!WriteFile(new HANDLE(hDevice.DangerousGetHandle()), pData, numberOfSectors * bytesPerSector, null, null))
|
||||
ExitWithError($"Unable to write sectors to FAT32 device, exiting. GetLastError: {Marshal.GetLastWin32Error()}");
|
||||
ExitWithError($"Sektoren konnten nicht auf das FAT32-Gerät geschrieben werden. Beende mit Fehler. GetLastError: {Marshal.GetLastWin32Error()}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +103,7 @@ namespace BadBuilder.Formatter
|
||||
writeSize = (numberOfSectors > burstSize) ? burstSize : numberOfSectors;
|
||||
|
||||
if (!WriteFile(new HANDLE(hDevice.DangerousGetHandle()), pZeroSector, writeSize * bytesPerSector, null, null))
|
||||
ExitWithError($"Unable to write sectors to FAT32 device, exiting. GetLastError: {Marshal.GetLastWin32Error()}");
|
||||
ExitWithError($"Sektoren konnten nicht auf das FAT32-Gerät geschrieben werden. Beende mit Fehler. GetLastError: {Marshal.GetLastWin32Error()}");
|
||||
|
||||
numberOfSectors -= writeSize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user