-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RtlGetVersion not found in NtDll #421
Comments
See Vanara/PInvoke/Kernel32/SysInfoApi.cs Line 2162 in da04510
|
public static class NtDll
{
[SecurityCritical]
[DllImport(Lib.NTdll, SetLastError = true, CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern int RtlGetVersion(out OSVERSIONINFOEX versionInfo);
}
[StructLayout(LayoutKind.Sequential)]
public struct OSVERSIONINFOEX
{
public int OSVersionInfoSize;
public int MajorVersion;
public int MinorVersion;
public int BuildNumber;
public int Revision;
public int PlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string CSDVersion;
public ushort ServicePackMajor;
public ushort ServicePackMinor;
public short SuiteMask;
public byte ProductType;
public byte Reserved;
} Could you reopen the issuse? |
Both those methods (GetVersionEx and RtlGetVersion) are marked as obsolete in lieu of the functions in VersionHelpers.h. You can find the Varana equivalents at PInvoke/Kernel32/VersionHelpers.cs |
To use var ver = OSVERSIONINFOEX.Default;
if (!GetVersionEx(ref ver)) ... |
Addtional infos: My TargetFramework like following and I don't use any <TargetFramework>net7.0-windows10.0.22621.0</TargetFramework> // in my exe csproj
<TargetFramework>net7.0-windows</TargetFramework> // in my lib csproj |
RtlGetVersion not found in NtDll.
The text was updated successfully, but these errors were encountered: