Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions DemoApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static void ExampleUsnJournal()
{
const string drive = @"\\.\C:";

Console.WriteLine(@"## Exmaple on {0} ##", drive);
Console.WriteLine(@"## Example on {0} ##", drive);
SafeFileHandle hddHandle = CreateFile(drive, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (hddHandle.IsInvalid)
Expand Down Expand Up @@ -113,7 +113,7 @@ private static void ExampleMountManager()
{
const string device = @"\\.\MountPointManager";

Console.WriteLine(@"## Exmaple on {0} ##", device);
Console.WriteLine(@"## Example on {0} ##", device);
SafeFileHandle deviceHandle = CreateFile(device, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (deviceHandle.IsInvalid)
Expand Down Expand Up @@ -153,7 +153,7 @@ private static void ExampleDiskIO()
{
const string drive = @"\\.\PhysicalDrive0";

Console.WriteLine(@"## Exmaple on {0} ##", drive);
Console.WriteLine(@"## Example on {0} ##", drive);
SafeFileHandle hddHandle = CreateFile(drive, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (hddHandle.IsInvalid)
Expand Down Expand Up @@ -193,7 +193,7 @@ private static void ExampleFileSystemIO()
{
const string drive = @"\\.\C:";

Console.WriteLine(@"## Exmaple on {0} ##", drive);
Console.WriteLine(@"## Example on {0} ##", drive);
SafeFileHandle volumeHandle = CreateFile(drive, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (volumeHandle.IsInvalid)
Expand Down Expand Up @@ -304,7 +304,7 @@ private static void ExampleDefragmentFile()
const string file = @"C:\Windows\system32\cmd.exe";
string drive = @"\\.\" + Directory.GetDirectoryRoot(file).Substring(0, 2);

Console.WriteLine(@"## Exmaple on {0} on drive {1} ##", file, drive);
Console.WriteLine(@"## Example on {0} on drive {1} ##", file, drive);

// Open file to defragment
SafeFileHandle fileHandle = CreateFile(file, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero,
Expand Down Expand Up @@ -412,7 +412,7 @@ private static void ExampleDefragmentDir()
const string dir = @"C:\Windows";
string drive = @"\\.\" + Directory.GetDirectoryRoot(dir).Substring(0, 2);

Console.WriteLine(@"## Exmaple on {0} on drive {1} ##", dir, drive);
Console.WriteLine(@"## Example on {0} on drive {1} ##", dir, drive);

// Open volume to defragment on
SafeFileHandle driveHandle = CreateFile(drive, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero,
Expand Down Expand Up @@ -560,7 +560,7 @@ private static void ExampleCdRomIO()
{
const string drive = @"\\.\CdRom0";

Console.WriteLine(@"## Exmaple on {0} ##", drive);
Console.WriteLine(@"## Example on {0} ##", drive);
SafeFileHandle cdTrayHandle = CreateFile(drive, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (cdTrayHandle.IsInvalid)
Expand Down Expand Up @@ -595,7 +595,7 @@ private static void ExampleBitmap()
{
const string drive = @"\\.\C:";

Console.WriteLine(@"## Exmaple on {0} ##", drive);
Console.WriteLine(@"## Example on {0} ##", drive);
SafeFileHandle volumeHandle = CreateFile(drive, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (volumeHandle.IsInvalid)
Expand Down Expand Up @@ -662,7 +662,7 @@ private static void ExampleSparseFile()
fs.Write(data, 0, data.Length);
}

Console.WriteLine(@"## Exmaple with {0} ##", file);
Console.WriteLine(@"## Example with {0} ##", file);
SafeFileHandle fileHandle = CreateFile(file, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (fileHandle.IsInvalid)
Expand Down Expand Up @@ -727,7 +727,7 @@ private static void ExampleCompression()
}
}

Console.WriteLine(@"## Exmaple with {0} ##", file);
Console.WriteLine(@"## Example with {0} ##", file);
SafeFileHandle fileHandle = CreateFile(file, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FileAttributes.Normal, IntPtr.Zero);

if (fileHandle.IsInvalid)
Expand Down
6 changes: 1 addition & 5 deletions DeviceIOControlLib/Objects/Disk/PARTITION_INFORMATION_GPT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@

namespace DeviceIOControlLib.Objects.Disk
{
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PARTITION_INFORMATION_GPT
{
[FieldOffset(0)]
public Guid PartitionType;
[FieldOffset(16)]
public Guid PartitionId;
[FieldOffset(32)]
[MarshalAs(UnmanagedType.U8)]
public EFIPartitionAttributes Attributes;
[FieldOffset(40)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 36)]
public string Name;
}
Expand Down