This repository was archived by the owner on Jul 26, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 228
Add unit test for DeviceIOControl #503
Merged
AArnott
merged 4 commits into
dotnet:master
from
qmfrederik:fixes/device-io-control-unit-test
Jul 12, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright © .NET Foundation and Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace PInvoke | ||
{ | ||
/// <content> | ||
/// Contains the <see cref="DISK_GEOMETRY"/> nested type. | ||
/// </content> | ||
public partial class Kernel32 | ||
{ | ||
/// <summary> | ||
/// Describes the geometry of disk devices and media. | ||
/// </summary> | ||
/// <seealso href="https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-disk_geometry"/> | ||
public struct DISK_GEOMETRY | ||
{ | ||
/// <summary> | ||
/// The number of cylinders. | ||
/// </summary> | ||
public long Cylinders; | ||
AArnott marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// <summary> | ||
/// The type of media. | ||
/// </summary> | ||
public MEDIA_TYPE MediaType; | ||
|
||
/// <summary> | ||
/// The number of tracks per cylinder. | ||
/// </summary> | ||
public uint TracksPerCylinder; | ||
|
||
/// <summary> | ||
/// The number of sectors per track. | ||
/// </summary> | ||
public uint SectorsPerTrack; | ||
|
||
/// <summary> | ||
/// The number of bytes per sector. | ||
/// </summary> | ||
public uint BytesPerSector; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
// Copyright © .NET Foundation and Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace PInvoke | ||
{ | ||
/// <content> | ||
/// Contains the <see cref="MEDIA_TYPE"/> nested type. | ||
/// </content> | ||
public partial class Kernel32 | ||
{ | ||
/// <summary> | ||
/// Represents the various forms of device media. | ||
/// </summary> | ||
/// <seealso href="https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-media_type"/> | ||
public enum MEDIA_TYPE | ||
{ | ||
/// <summary> | ||
/// Format is unknown | ||
/// </summary> | ||
Unknown, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 1.2MB and 512 bytes/sector. | ||
/// </summary> | ||
F5_1Pt2_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 1.44MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_1Pt44_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 2.88MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_2Pt88_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 20.8MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_20Pt8_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 720KB and 512 bytes/sector. | ||
/// </summary> | ||
F3_720_512, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 360KB and 512 bytes/sector. | ||
/// </summary> | ||
F5_360_512, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 320KB and 512 bytes/sector. | ||
/// </summary> | ||
F5_320_512, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 320KB and 1024 bytes/sector. | ||
/// </summary> | ||
F5_320_1024, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 180KB and 512 bytes/sector. | ||
/// </summary> | ||
F5_180_512, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 160KB and 512 bytes/sector. | ||
/// </summary> | ||
F5_160_512, | ||
|
||
/// <summary> | ||
/// Removable media other than floppy. | ||
/// </summary> | ||
RemovableMedia, | ||
|
||
/// <summary> | ||
/// Fixed hard disk media. | ||
/// </summary> | ||
FixedMedia, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 120MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_120M_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 640KB and 512 bytes/sector. | ||
/// </summary> | ||
F3_640_512, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 640KB and 512 bytes/sector. | ||
/// </summary> | ||
F5_640_512, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 720KB and 512 bytes/sector. | ||
/// </summary> | ||
F5_720_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 1.2MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_1Pt2_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 1.23MB and 1024 bytes/sector. | ||
/// </summary> | ||
F3_1Pt23_1024, | ||
|
||
/// <summary> | ||
/// A 5.25" floppy, with 1.23MB and 1024 bytes/sector. | ||
/// </summary> | ||
F5_1Pt23_1024, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 128MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_128Mb_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 230MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_230Mb_512, | ||
|
||
/// <summary> | ||
/// An 8" floppy, with 256KB and 128 bytes/sector. | ||
/// </summary> | ||
F8_256_128, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 200MB and 512 bytes/sector. (HiFD). | ||
/// </summary> | ||
F3_200Mb_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 240MB and 512 bytes/sector. (HiFD). | ||
/// </summary> | ||
F3_240M_512, | ||
|
||
/// <summary> | ||
/// A 3.5" floppy, with 32MB and 512 bytes/sector. | ||
/// </summary> | ||
F3_32M_512, | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common I/O codes are defined in https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ , might make sense to add them to dotnet/pinvoke (as a separate effort)