Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Add unit test for DeviceIOControl #503

Merged
merged 4 commits into from
Jul 12, 2020
Merged

Add unit test for DeviceIOControl #503

merged 4 commits into from
Jul 12, 2020

Conversation

qmfrederik
Copy link
Contributor

And DISK_GEOMETRY, MEDIA_TYPE struct & enum along the way.

[Fact]
public unsafe void DeviceIOControl_Works()
{
const uint IOCTL_DISK_GET_DRIVE_GEOMETRY = 0x070000;
Copy link
Contributor Author

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)

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. We can merge as-is, but if you don't mind making the int->uint change I suggest, I think that would be slightly better.

src/Kernel32/storebanned/Kernel32+DISK_GEOMETRY.cs Outdated Show resolved Hide resolved
@qmfrederik
Copy link
Contributor Author

@AArnott Thanks, I made the uint -> intchange, hope this PR is good to go.

@AArnott AArnott merged commit 171b717 into dotnet:master Jul 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants