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 NtGlobalFlag
;
20 extern ULONG NtMajorVersion
;
21 extern ULONG NtMinorVersion
;
22 extern ULONG NtOSCSDVersion
;
24 /* FUNCTIONS *****************************************************************/
28 DebugPrint(IN PANSI_STRING DebugString
,
33 KdpPrintString(DebugString
->Buffer
, DebugString
->Length
);
34 return STATUS_SUCCESS
;
42 RtlGetNtGlobalFlags(VOID
)
52 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation
)
54 if (lpVersionInformation
->dwOSVersionInfoSize
== sizeof(RTL_OSVERSIONINFOW
) ||
55 lpVersionInformation
->dwOSVersionInfoSize
== sizeof(RTL_OSVERSIONINFOEXW
))
57 lpVersionInformation
->dwMajorVersion
= NtMajorVersion
;
58 lpVersionInformation
->dwMinorVersion
= NtMinorVersion
;
59 lpVersionInformation
->dwBuildNumber
= NtBuildNumber
;
60 lpVersionInformation
->dwPlatformId
= VER_PLATFORM_WIN32_NT
;
61 if(((NtOSCSDVersion
>> 8) & 0xFF) != 0)
63 int i
= _snwprintf(lpVersionInformation
->szCSDVersion
,
64 (sizeof(lpVersionInformation
->szCSDVersion
) / sizeof(lpVersionInformation
->szCSDVersion
[0])) - 1,
66 ((NtOSCSDVersion
>> 8) & 0xFF));
67 lpVersionInformation
->szCSDVersion
[i
] = L
'\0';
71 RtlZeroMemory(lpVersionInformation
->szCSDVersion
, sizeof(lpVersionInformation
->szCSDVersion
));
73 if (lpVersionInformation
->dwOSVersionInfoSize
== sizeof(OSVERSIONINFOEXW
))
75 RTL_OSVERSIONINFOEXW
*InfoEx
= (RTL_OSVERSIONINFOEXW
*)lpVersionInformation
;
76 InfoEx
->wServicePackMajor
= (USHORT
)(NtOSCSDVersion
>> 8) & 0xFF;
77 InfoEx
->wServicePackMinor
= (USHORT
)(NtOSCSDVersion
& 0xFF);
78 InfoEx
->wSuiteMask
= (USHORT
)SharedUserData
->SuiteMask
;
79 InfoEx
->wProductType
= SharedUserData
->NtProductType
;
82 return STATUS_SUCCESS
;
85 return STATUS_INVALID_PARAMETER
;