preliminary comment out the self-modifying code for RtlPrefetchMemoryNonTemporal
[reactos.git] / reactos / ntoskrnl / rtl / misc.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/rtl/misc.c
6 * PURPOSE: Various functions
7 *
8 * PROGRAMMERS: Hartmut Birr
9 */
10
11 /* INCLUDES *****************************************************************/
12
13 #include <ntoskrnl.h>
14 #define NDEBUG
15 #include <internal/debug.h>
16
17 /* GLOBALS *******************************************************************/
18
19 extern ULONG NtGlobalFlag;
20 extern ULONG NtMajorVersion;
21 extern ULONG NtMinorVersion;
22 extern ULONG NtOSCSDVersion;
23
24 /* FUNCTIONS *****************************************************************/
25
26 NTSTATUS
27 NTAPI
28 DebugPrint(IN PANSI_STRING DebugString,
29 IN ULONG ComponentId,
30 IN ULONG Level)
31 {
32 /* Temporary hack */
33 KdpPrintString(DebugString->Buffer, DebugString->Length);
34 return STATUS_SUCCESS;
35 }
36
37 /*
38 * @implemented
39 */
40 ULONG
41 STDCALL
42 RtlGetNtGlobalFlags(VOID)
43 {
44 return(NtGlobalFlag);
45 }
46
47
48 /*
49 * @implemented
50 */
51 NTSTATUS STDCALL
52 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
53 {
54 if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOW) ||
55 lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
56 {
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)
62 {
63 int i = _snwprintf(lpVersionInformation->szCSDVersion,
64 (sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0])) - 1,
65 L"Service Pack %d",
66 ((NtOSCSDVersion >> 8) & 0xFF));
67 lpVersionInformation->szCSDVersion[i] = L'\0';
68 }
69 else
70 {
71 RtlZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
72 }
73 if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
74 {
75 RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)lpVersionInformation;
76 InfoEx->wServicePackMajor = (NtOSCSDVersion >> 8) & 0xFF;
77 InfoEx->wServicePackMinor = NtOSCSDVersion & 0xFF;
78 InfoEx->wSuiteMask = SharedUserData->SuiteMask;
79 InfoEx->wProductType = SharedUserData->NtProductType;
80 }
81
82 return STATUS_SUCCESS;
83 }
84
85 return STATUS_INVALID_PARAMETER;
86 }
87