blob: 6eb5533e3bd447d90909f3e7a549a4f7c8359dea [file] [log] [blame] [raw]
#include <windows.h>
#include <nt.h>
long int __stdcall RtlGetVersion(RTL_OSVERSIONINFO *VersionInformation) {
PROCESS_BASIC_INFORMATION pbi;
long int r = NtQueryInformationProcess((void *)-1, ProcessBasicInformation, &pbi, sizeof pbi, NULL);
if(r < 0) return r;
PEB *peb = pbi.PebBaseAddress;
VersionInformation->dwMajorVersion = peb->OSMajorVersion;
VersionInformation->dwMinorVersion = peb->OSMinorVersion;
VersionInformation->dwBuildNumber = peb->OSBuildNumber;
VersionInformation->dwPlatformId = peb->OSPlatformId;
return 0;
}