Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenmisc.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS kernel 00004 * FILE: ntoskrnl/rtl/misc.c 00005 * PURPOSE: Various functions 00006 * 00007 * PROGRAMMERS: 00008 */ 00009 00010 /* INCLUDES *****************************************************************/ 00011 00012 #include <ntoskrnl.h> 00013 #define NDEBUG 00014 #include <debug.h> 00015 00016 /* GLOBALS *******************************************************************/ 00017 00018 extern ULONG NtGlobalFlag; 00019 extern ULONG NtMajorVersion; 00020 extern ULONG NtMinorVersion; 00021 extern ULONG NtOSCSDVersion; 00022 00023 /* FUNCTIONS *****************************************************************/ 00024 00025 /* 00026 * @implemented 00027 */ 00028 ULONG 00029 NTAPI 00030 RtlGetNtGlobalFlags(VOID) 00031 { 00032 return(NtGlobalFlag); 00033 } 00034 00035 00036 /* 00037 * @implemented 00038 */ 00039 NTSTATUS NTAPI 00040 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation) 00041 { 00042 LONG i; 00043 ULONG MaxLength; 00044 if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOW) || 00045 lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW)) 00046 { 00047 lpVersionInformation->dwMajorVersion = NtMajorVersion; 00048 lpVersionInformation->dwMinorVersion = NtMinorVersion; 00049 lpVersionInformation->dwBuildNumber = NtBuildNumber; 00050 lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT; 00051 RtlZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion)); 00052 if(((CmNtCSDVersion >> 8) & 0xFF) != 0) 00053 { 00054 MaxLength = (sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0])) - 1; 00055 i = _snwprintf(lpVersionInformation->szCSDVersion, 00056 MaxLength, 00057 L"Service Pack %d", 00058 ((CmNtCSDVersion >> 8) & 0xFF)); 00059 if (i < 0) 00060 { 00061 /* null-terminate if it was overflowed */ 00062 lpVersionInformation->szCSDVersion[MaxLength] = L'\0'; 00063 } 00064 } 00065 if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW)) 00066 { 00067 RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)lpVersionInformation; 00068 InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF; 00069 InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF); 00070 InfoEx->wSuiteMask = (USHORT)SharedUserData->SuiteMask; 00071 InfoEx->wProductType = SharedUserData->NtProductType; 00072 } 00073 00074 return STATUS_SUCCESS; 00075 } 00076 00077 return STATUS_INVALID_PARAMETER; 00078 } 00079 Generated on Sat May 26 2012 04:15:49 for ReactOS by
1.7.6.1
|