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

Add Kernel32.GetNativeSystemInfo #499

Merged
merged 2 commits into from Jul 8, 2020
Merged

Add Kernel32.GetNativeSystemInfo #499

merged 2 commits into from Jul 8, 2020

Conversation

qmfrederik
Copy link
Contributor

No description provided.

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.

Looks good. Thanks for contributing. just a couple of touch-ups, please.

/// A mask representing the set of processors configured into the system.
/// Bit 0 is processor 0; bit 31 is processor 31.
/// </summary>
public int* dwActiveProcessorMask;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't really a pointer. It's just a pointer-sized field. Let's use IntPtr here to make that clear.

/// <summary>
/// The architecture-dependent processor level. It should be used only for display purposes.
/// </summary>
public short wProcessorLevel;
Copy link
Collaborator

Choose a reason for hiding this comment

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

ushort is more appropriate here since it's an (unsigned) WORD in native code. We'll sometimes use int instead of uint where the value is likely to be used in other .NET APIs that take int, but as a short/ushort, it's already non-standard. And I suspect ushort is accepted by int APIs implicitly anyway since the range just grows.

/// <summary>
/// The architecture-dependent processor revision.
/// </summary>
public short wProcessorRevision;
Copy link
Collaborator

Choose a reason for hiding this comment

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

ushort is more appropriate here since it's an (unsigned) WORD in native code.

@AArnott AArnott merged commit 071f3fc into dotnet:master Jul 8, 2020
@qmfrederik qmfrederik deleted the features/kernel32-native-system-info branch July 8, 2020 13:35
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