Author: hbelusca Date: Fri Jul 1 19:45:39 2016 New Revision: 71714
URL: http://svn.reactos.org/svn/reactos?rev=71714&view=rev Log: [NTOS] The "BuildLab" string now contains the build number (date + revision number), together with the compiler version used to compile ReactOS. CORE-6611 CORE-7889 CORE-8877
[WIN32K] Now use the "BuildLab" string that is read from the registry to be displayed in the desktop watermark, instead of building it at run-time. Addendum to r71504, CORE-11349
Based on an idea by Mark Jansen (learn_more).
Modified: trunk/reactos/ntoskrnl/ex/init.c trunk/reactos/win32ss/user/ntuser/desktop.c
Modified: trunk/reactos/ntoskrnl/ex/init.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=7171... ============================================================================== --- trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] Fri Jul 1 19:45:39 2016 @@ -57,7 +57,9 @@ ULONG CmNtCSDReleaseType; UNICODE_STRING CmVersionString; UNICODE_STRING CmCSDVersionString; -CHAR NtBuildLab[] = KERNEL_VERSION_BUILD_STR; + +CHAR NtBuildLab[] = KERNEL_VERSION_BUILD_STR "." + REACTOS_COMPILER_NAME "_" REACTOS_COMPILER_VERSION;
/* Init flags and settings */ ULONG ExpInitializationPhase;
Modified: trunk/reactos/win32ss/user/ntuser/desktop.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/desktop... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] Fri Jul 1 19:45:39 2016 @@ -255,12 +255,17 @@ NTSTATUS Status;
RTL_OSVERSIONINFOEXW VerInfo; + UNICODE_STRING BuildLabString; UNICODE_STRING CSDVersionString; -#if 0 - UNICODE_STRING CurBuildNmString; -#endif - RTL_QUERY_REGISTRY_TABLE VersionConfigurationTable[2] = - { + RTL_QUERY_REGISTRY_TABLE VersionConfigurationTable[] = + { + { + NULL, + RTL_QUERY_REGISTRY_DIRECT, + L"BuildLab", + &BuildLabString, + REG_NONE, NULL, 0 + }, { NULL, RTL_QUERY_REGISTRY_DIRECT, @@ -269,19 +274,10 @@ REG_NONE, NULL, 0 },
-#if 0 - { - NULL, - RTL_QUERY_REGISTRY_DIRECT, - L"CurrentBuildNumber", - &CurBuildNmString, - REG_NONE, NULL, 0 - }, -#endif - {0} };
+ WCHAR BuildLabBuffer[256]; WCHAR VersionBuffer[256]; PWCHAR EndBuffer;
@@ -295,9 +291,14 @@ RtlGetVersion((PRTL_OSVERSIONINFOW)&VerInfo);
/* - * In kernel-mode, szCSDVersion is not initialized. Initialize it - * and query its value from the registry. + * - Retrieve the BuildLab string from the registry (set by the kernel). + * - In kernel-mode, szCSDVersion is not initialized. Initialize it + * and query its value from the registry. */ + RtlZeroMemory(BuildLabBuffer, sizeof(BuildLabBuffer)); + RtlInitEmptyUnicodeString(&BuildLabString, + BuildLabBuffer, + sizeof(BuildLabBuffer)); RtlZeroMemory(VerInfo.szCSDVersion, sizeof(VerInfo.szCSDVersion)); RtlInitEmptyUnicodeString(&CSDVersionString, VerInfo.szCSDVersion, @@ -310,9 +311,11 @@ if (!NT_SUCCESS(Status)) { /* Indicate nothing is there */ + BuildLabString.Length = 0; CSDVersionString.Length = 0; } - /* NULL-terminate */ + /* NULL-terminate the strings */ + BuildLabString.Buffer[BuildLabString.Length / sizeof(WCHAR)] = UNICODE_NULL; CSDVersionString.Buffer[CSDVersionString.Length / sizeof(WCHAR)] = UNICODE_NULL;
EndBuffer = VersionBuffer; @@ -343,11 +346,9 @@ /* String for Safe Mode */ Status = RtlStringCchPrintfW(pwszzVersion, cchDest, - L"ReactOS Version %S %S.%S_%S (NT %u.%u Build %u%s)\n", + L"ReactOS Version %S %wZ (NT %u.%u Build %u%s)\n", KERNEL_VERSION_STR, - KERNEL_VERSION_BUILD_STR, // Same as the "BuildLab" string in the registry - REACTOS_COMPILER_NAME, - REACTOS_COMPILER_VERSION, + &BuildLabString, SharedUserData->NtMajorVersion, SharedUserData->NtMinorVersion, (VerInfo.dwBuildNumber & 0xFFFF), @@ -386,12 +387,10 @@ Status = RtlStringCchPrintfW(pwszzVersion, cchDest, L"ReactOS Version %S\n" - L"Build %S.%S_%S\n" + L"Build %wZ\n" L"Reporting NT %u.%u (Build %u%s)\n", KERNEL_VERSION_STR, - KERNEL_VERSION_BUILD_STR, // Same as the "BuildLab" string in the registry - REACTOS_COMPILER_NAME, - REACTOS_COMPILER_VERSION, + &BuildLabString, SharedUserData->NtMajorVersion, SharedUserData->NtMinorVersion, (VerInfo.dwBuildNumber & 0xFFFF), @@ -420,11 +419,9 @@ /* Fall-back string */ Status = RtlStringCchPrintfW(pwszzVersion, cchDest, - L"ReactOS Version %S %S.%S_%S\n", + L"ReactOS Version %S %wZ\n", KERNEL_VERSION_STR, - KERNEL_VERSION_BUILD_STR, // Same as the "BuildLab" string in the registry - REACTOS_COMPILER_NAME, - REACTOS_COMPILER_VERSION); + &BuildLabString); if (!NT_SUCCESS(Status)) { /* General failure, NULL-terminate the string */