X-Git-Url: http://git.jankratochvil.net/?p=reactos.git;a=blobdiff_plain;f=lib%2Fntdll%2Frtl%2Fmisc.c;fp=lib%2Fntdll%2Frtl%2Fmisc.c;h=bc01605b6f3d8f5770b32677d9a8650d35d0f7c6;hp=4b9cf76226e42f507845a2ba284ba25ea5f92529;hb=a3df8bf1429570e0bd6c6428f6ed80073578cf4b;hpb=7c0db166f81fbe8c8b913d7f26048e337d383605 diff --git a/lib/ntdll/rtl/misc.c b/lib/ntdll/rtl/misc.c index 4b9cf76..bc01605 100644 --- a/lib/ntdll/rtl/misc.c +++ b/lib/ntdll/rtl/misc.c @@ -11,6 +11,7 @@ /* INCLUDES *****************************************************************/ +#include #include #include @@ -65,6 +66,8 @@ RtlGetNtGlobalFlags(VOID) * * REVISIONS * 2000-08-10 ekohl + * + * @implemented */ BOOLEAN STDCALL @@ -74,4 +77,51 @@ RtlGetNtProductType(PNT_PRODUCT_TYPE ProductType) return(TRUE); } +/********************************************************************** + * NAME EXPORTED + * RtlGetNtVersionNumbers + * + * DESCRIPTION + * Get the version numbers of the run time library. + * + * ARGUMENTS + * major [OUT] Destination for the Major version + * minor [OUT] Destination for the Minor version + * build [OUT] Destination for the Build version + * + * RETURN VALUE + * Nothing. + * + * NOTE + * Introduced in Windows XP (NT5.1) + * + * @implemented + */ + +void STDCALL +RtlGetNtVersionNumbers(LPDWORD major, LPDWORD minor, LPDWORD build) +{ + PPEB pPeb = NtCurrentPeb(); + + if (major) + { + /* msvcrt.dll as released with XP Home fails in DLLMain() if the + * major version is not 5. So, we should never set a version < 5 ... + * This makes sense since this call didn't exist before XP anyway. + */ + *major = pPeb->OSMajorVersion < 5 ? 5 : pPeb->OSMajorVersion; + } + + if (minor) + { + *minor = pPeb->OSMinorVersion; + } + + if (build) + { + /* FIXME: Does anybody know the real formula? */ + *build = (0xF0000000 | pPeb->OSBuildNumber); + } +} + /* EOF */