ReactOS  0.4.14-dev-317-g96040ec
misc.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: ntoskrnl/rtl/misc.c
5  * PURPOSE: Various functions
6  *
7  * PROGRAMMERS:
8  */
9 
10 /* INCLUDES *****************************************************************/
11 
12 #include <ntoskrnl.h>
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* GLOBALS *******************************************************************/
17 
18 extern ULONG NtGlobalFlag;
19 extern ULONG NtMajorVersion;
20 extern ULONG NtMinorVersion;
21 extern ULONG NtOSCSDVersion;
22 
23 /* FUNCTIONS *****************************************************************/
24 
25 /*
26 * @implemented
27 */
28 ULONG
29 NTAPI
31 {
32  return NtGlobalFlag;
33 }
34 
35 /*
36  * @implemented
37  */
38 NTSTATUS
39 NTAPI
40 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
41 {
42  PAGED_CODE();
43 
44  /* Return the basics */
45  lpVersionInformation->dwMajorVersion = NtMajorVersion;
46  lpVersionInformation->dwMinorVersion = NtMinorVersion;
47  lpVersionInformation->dwBuildNumber = NtBuildNumber & 0x3FFF;
48  lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
49 
50  /* Check if this is the extended version */
51  if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
52  {
53  PRTL_OSVERSIONINFOEXW InfoEx = (PRTL_OSVERSIONINFOEXW)lpVersionInformation;
54  InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF;
55  InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF);
56  InfoEx->wSuiteMask = (USHORT)(SharedUserData->SuiteMask & 0xFFFF);
57  InfoEx->wProductType = SharedUserData->NtProductType;
58  InfoEx->wReserved = 0;
59  }
60 
61  /* Always succeed */
62  return STATUS_SUCCESS;
63 }
64 
65 #if !defined(_M_IX86)
66 //
67 // Stub for architectures which don't have this implemented
68 //
69 VOID
73 {
74  //
75  // Do nothing
76  //
79 }
80 #endif
81 
82 /* EOF */
UCHAR wProductType
Definition: rtltypes.h:274
#define IN
Definition: typedefs.h:38
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:236
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
#define FASTCALL
Definition: nt_native.h:50
USHORT wSuiteMask
Definition: rtltypes.h:273
#define PAGED_CODE()
Definition: video.h:57
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ULONG NtGlobalFlag
Definition: init.c:51
ULONG NTAPI RtlGetNtGlobalFlags(VOID)
Definition: misc.c:30
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: misc.c:40
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ULONG NtBuildNumber
Definition: init.c:47
#define SharedUserData
ULONG NtMinorVersion
Definition: init.c:43
ULONG NtMajorVersion
Definition: init.c:42
ULONG_PTR SIZE_T
Definition: typedefs.h:78
unsigned short USHORT
Definition: pedump.c:61
USHORT wServicePackMajor
Definition: rtltypes.h:271
struct _OSVERSIONINFOEXW * PRTL_OSVERSIONINFOEXW
ULONG NtOSCSDVersion
#define OUT
Definition: typedefs.h:39
ULONG CmNtCSDVersion
Definition: init.c:56
unsigned int ULONG
Definition: retypes.h:1
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
return STATUS_SUCCESS
Definition: btrfs.c:2938
USHORT wServicePackMinor
Definition: rtltypes.h:272
VOID FASTCALL RtlPrefetchMemoryNonTemporal(IN PVOID Source, IN SIZE_T Length)
Definition: misc.c:71