This repository has been archived by the owner on Jul 26, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #498 from qmfrederik/features/ntdll-rtlgetversion
Add NTDll.RtlGetVersion
- Loading branch information
Showing
10 changed files
with
185 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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,34 @@ | ||
// 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 | ||
{ | ||
using System.Runtime.InteropServices; | ||
|
||
/// <summary> | ||
/// Contains the <see cref="OSPlatformId"/> nested type. | ||
/// </summary> | ||
public static partial class Kernel32 | ||
{ | ||
/// <summary> | ||
/// The <see cref="OSPlatformId"/> structure contains operating system version information. | ||
/// </summary> | ||
public enum OSPlatformId | ||
{ | ||
/// <summary> | ||
/// The operating system is Microsoft Windows 3.1. | ||
/// </summary> | ||
VER_PLATFORM_WIN32s = 0, | ||
|
||
/// <summary> | ||
/// The operating system is Windows 95, Windows 98, or operating systems descended from them. | ||
/// </summary> | ||
VER_PLATFORM_WIN32_WINDOWS = 1, | ||
|
||
/// <summary> | ||
/// The operating system is Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, or Windows 2000. | ||
/// </summary> | ||
VER_PLATFORM_WIN32_NT = 2, | ||
} | ||
} | ||
} |
This file contains 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,60 @@ | ||
// 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 | ||
{ | ||
using System.Runtime.InteropServices; | ||
|
||
/// <summary> | ||
/// Contains the <see cref="OSVERSIONINFO"/> nested type. | ||
/// </summary> | ||
public static partial class Kernel32 | ||
{ | ||
/// <summary> | ||
/// The <see cref="OSVERSIONINFO"/> structure contains operating system version information. | ||
/// </summary> | ||
/// <see href="https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfow"/> | ||
public unsafe struct OSVERSIONINFO | ||
{ | ||
/// <summary> | ||
/// The size of the <see cref="OSVERSIONINFO"/> structure in bytes. | ||
/// </summary> | ||
public int dwOSVersionInfoSize; | ||
|
||
/// <summary> | ||
/// The major OS version. | ||
/// </summary> | ||
public int dwMajorVersion; | ||
|
||
/// <summary> | ||
/// The minor OS version. | ||
/// </summary> | ||
public int dwMinorVersion; | ||
|
||
/// <summary> | ||
/// The build number of the OS. | ||
/// </summary> | ||
public int dwBuildNumber; | ||
|
||
/// <summary> | ||
/// The OS platform. | ||
/// </summary> | ||
public OSPlatformId dwPlatformId; | ||
|
||
/// <summary> | ||
/// A null-terminated string, such as "Service Pack 3", that indicates the latest Service Pack installed on the system. | ||
/// If no Service Pack has been installed, the string is empty. | ||
/// </summary> | ||
public fixed char szCSDVersion[128]; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="OSVERSIONINFO" /> struct | ||
/// with <see cref="dwOSVersionInfoSize" /> set to the correct value. | ||
/// </summary> | ||
/// <returns> | ||
/// A newly initialized instance of <see cref="OSVERSIONINFO"/> | ||
/// </returns> | ||
public static OSVERSIONINFO Create() => new OSVERSIONINFO { dwOSVersionInfoSize = sizeof(OSVERSIONINFO) }; | ||
} | ||
} | ||
} |
This file contains 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 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 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 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 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 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,17 @@ | ||
// 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> | ||
/// Methods and nested types that are not strictly P/Invokes but provide | ||
/// a slightly higher level of functionality to ease calling into native code. | ||
/// </content> | ||
public static partial class NTDll | ||
{ | ||
// This is where you define methods that assist in calling P/Invoke methods. | ||
// For example, if a P/Invoke method requires allocating unmanaged memory | ||
// and freeing it up after the call, a helper method in this file would | ||
// make "P/Invoking" for most callers much easier and is a welcome addition. | ||
} | ||
} |
This file contains 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 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