3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/rtl/misc.c
6 * PURPOSE: Various functions
11 /* INCLUDES *****************************************************************/
15 #include <internal/debug.h>
17 /* GLOBALS *******************************************************************/
19 extern ULONG NtMajorVersion
;
20 extern ULONG NtMinorVersion
;
21 extern ULONG CmNtCSDVersion
;
23 /* FUNCTIONS *****************************************************************/
30 RtlGetNtGlobalFlags(VOID
)
40 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation
)
42 if (lpVersionInformation
->dwOSVersionInfoSize
== sizeof(RTL_OSVERSIONINFOW
) ||
43 lpVersionInformation
->dwOSVersionInfoSize
== sizeof(RTL_OSVERSIONINFOEXW
))
45 lpVersionInformation
->dwMajorVersion
= NtMajorVersion
;
46 lpVersionInformation
->dwMinorVersion
= NtMinorVersion
;
47 lpVersionInformation
->dwBuildNumber
= NtBuildNumber
;
48 lpVersionInformation
->dwPlatformId
= VER_PLATFORM_WIN32_NT
;
49 if(((CmNtCSDVersion
>> 8) & 0xFF) != 0)
51 int i
= _snwprintf(lpVersionInformation
->szCSDVersion
,
52 (sizeof(lpVersionInformation
->szCSDVersion
) / sizeof(lpVersionInformation
->szCSDVersion
[0])) - 1,
54 ((CmNtCSDVersion
>> 8) & 0xFF));
55 lpVersionInformation
->szCSDVersion
[i
] = L
'\0';
59 RtlZeroMemory(lpVersionInformation
->szCSDVersion
, sizeof(lpVersionInformation
->szCSDVersion
));
61 if (lpVersionInformation
->dwOSVersionInfoSize
== sizeof(OSVERSIONINFOEXW
))
63 RTL_OSVERSIONINFOEXW
*InfoEx
= (RTL_OSVERSIONINFOEXW
*)lpVersionInformation
;
64 InfoEx
->wServicePackMajor
= (USHORT
)(CmNtCSDVersion
>> 8) & 0xFF;
65 InfoEx
->wServicePackMinor
= (USHORT
)(CmNtCSDVersion
& 0xFF);
66 InfoEx
->wSuiteMask
= (USHORT
)SharedUserData
->SuiteMask
;
67 InfoEx
->wProductType
= SharedUserData
->NtProductType
;
70 return STATUS_SUCCESS
;
73 return STATUS_INVALID_PARAMETER
;