Index: boot/bootdata/hivesys_amd64.inf =================================================================== --- boot/bootdata/hivesys_amd64.inf (révision 57294) +++ boot/bootdata/hivesys_amd64.inf (copie de travail) @@ -1130,15 +1130,16 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Print\Monitors\Local Port","Driver",2,"localspl.dll" HKLM,"SYSTEM\CurrentControlSet\Control\Print\Printers",,0x00000012 -HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType",2,"WinNT" -HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductSuite",0x00010002,"" +HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType",2,"ServerNT" +HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductSuite",0x00010002,"Terminal Server" +; ReactOS specific - by default we report ourselves as Workstation for the user +HKLM,"SYSTEM\CurrentControlSet\Control\ReactOS\Settings\Version","ReportAsWorkstation",0x00010001,0x00000001 +; Some installers check for SP2 +HKLM,"SYSTEM\CurrentControlSet\Control\Windows","CSDVersion",0x00010001,0x00000200 HKLM,"SYSTEM\CurrentControlSet\Control\SecurityProviders","SecurityProviders",2,"schannel.dll" HKLM,"SYSTEM\CurrentControlSet\Control\SecurityProviders\SaslProfiles",,0x00000012 -; Some installers check for SP6 -HKLM,"SYSTEM\CurrentControlSet\Control\Windows","CSDVersion",0x00010001,0x00000600 - ; Service groups HKLM,"SYSTEM\CurrentControlSet\Control\ServiceGroupOrder","List",0x00010000, \ "Boot Bus Extender", \ Index: boot/bootdata/hivesys_arm.inf =================================================================== --- boot/bootdata/hivesys_arm.inf (révision 57294) +++ boot/bootdata/hivesys_arm.inf (copie de travail) @@ -693,8 +693,8 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Nls\Locale\Alternate Sorts","00021404",0x00000000,"" HKLM,"SYSTEM\CurrentControlSet\Control\Nls\Locale\Alternate Sorts","00030404",0x00000000,"" -; Some installers check for SP6 -HKLM,"SYSTEM\CurrentControlSet\Control\Windows","CSDVersion",0x00010001,0x00000600 +; Some installers check for SP2 +HKLM,"SYSTEM\CurrentControlSet\Control\Windows","CSDVersion",0x00010001,0x00000200 ; Service groups HKLM,"SYSTEM\CurrentControlSet\Control\ServiceGroupOrder","List",0x00010000, \ Index: boot/bootdata/hivesys_i386.inf =================================================================== --- boot/bootdata/hivesys_i386.inf (révision 57294) +++ boot/bootdata/hivesys_i386.inf (copie de travail) @@ -1130,15 +1130,16 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Print\Monitors\Local Port","Driver",2,"localspl.dll" HKLM,"SYSTEM\CurrentControlSet\Control\Print\Printers",,0x00000012 -HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType",2,"WinNT" -HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductSuite",0x00010002,"" +HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType",2,"ServerNT" +HKLM,"SYSTEM\CurrentControlSet\Control\ProductOptions","ProductSuite",0x00010002,"Terminal Server" +; ReactOS specific - by default we report ourselves as Workstation for the user +HKLM,"SYSTEM\CurrentControlSet\Control\ReactOS\Settings\Version","ReportAsWorkstation",0x00010001,0x00000001 +; Some installers check for SP2 +HKLM,"SYSTEM\CurrentControlSet\Control\Windows","CSDVersion",0x00010001,0x00000200 HKLM,"SYSTEM\CurrentControlSet\Control\SecurityProviders","SecurityProviders",2,"schannel.dll" HKLM,"SYSTEM\CurrentControlSet\Control\SecurityProviders\SaslProfiles",,0x00000012 -; Some installers check for SP6 -HKLM,"SYSTEM\CurrentControlSet\Control\Windows","CSDVersion",0x00010001,0x00000600 - ; Service groups HKLM,"SYSTEM\CurrentControlSet\Control\ServiceGroupOrder","List",0x00010000, \ "Boot Bus Extender", \ Index: dll/ntdll/rtl/version.c =================================================================== --- dll/ntdll/rtl/version.c (révision 57294) +++ dll/ntdll/rtl/version.c (copie de travail) @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * FILE: lib/ntdll/rtl/process.c * PURPOSE: Process functions - * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) + * PROGRAMMER: Ariadne (ariadne@xs4all.nl) * UPDATE HISTORY: * Created 01/11/98 */ @@ -31,9 +31,9 @@ * * NOTE * ProductType can be one of the following values: - * 1 Workstation (Winnt) - * 2 Server (Lanmannt) - * 3 Advanced Server (Servernt) + * 1 Workstation (WinNT) + * 2 Server (LanmanNT) + * 3 Advanced Server (ServerNT) * * REVISIONS * 2000-08-10 ekohl @@ -56,45 +56,47 @@ * Get the version numbers of the run time library. * * ARGUMENTS - * major [OUT] Destination for the Major version - * minor [OUT] Destination for the Minor version - * build [OUT] Destination for the Build version + * pdwMajorVersion [OUT] Destination for the Major version + * pdwMinorVersion [OUT] Destination for the Minor version + * pdwBuildNumber [OUT] Destination for the Build version * * RETURN VALUE * Nothing. * - * NOTE - * Introduced in Windows XP (NT5.1) + * NOTES + * - Introduced in Windows XP (NT 5.1) + * - Since this call didn't exist before XP, we report at least the version + * 5.1. This fixes the loading of msvcrt.dll as released with XP Home, + * which fails in DLLMain() if the major version isn't 5. * * @implemented */ -void NTAPI -RtlGetNtVersionNumbers(LPDWORD major, LPDWORD minor, LPDWORD build) +VOID NTAPI +RtlGetNtVersionNumbers(OUT LPDWORD pdwMajorVersion, + OUT LPDWORD pdwMinorVersion, + OUT LPDWORD pdwBuildNumber) { PPEB pPeb = NtCurrentPeb(); - if (major) + if (pdwMajorVersion) { - /* msvcrt.dll as released with XP Home fails in DLLMain() if the - * major version is not 5. So, we should never set a version < 5 ... - * This makes sense since this call didn't exist before XP anyway. - */ - *major = pPeb->OSMajorVersion < 5 ? 5 : pPeb->OSMajorVersion; + *pdwMajorVersion = pPeb->OSMajorVersion < 5 ? 5 : pPeb->OSMajorVersion; } - if (minor) + if (pdwMinorVersion) { - if (pPeb->OSMinorVersion <= 5) - *minor = pPeb->OSMinorVersion < 1 ? 1 : pPeb->OSMinorVersion; + if ( (pPeb->OSMajorVersion < 5) || + ((pPeb->OSMajorVersion == 5) && (pPeb->OSMinorVersion < 1)) ) + *pdwMinorVersion = 1; else - *minor = pPeb->OSMinorVersion; + *pdwMinorVersion = pPeb->OSMinorVersion; } - if (build) + if (pdwBuildNumber) { - /* FIXME: Does anybody know the real formula? */ - *build = (0xF0000000 | pPeb->OSBuildNumber); + /* Windows really does this! */ + *pdwBuildNumber = (0xF0000000 | pPeb->OSBuildNumber); } } @@ -134,7 +136,7 @@ RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)Info; InfoEx->wServicePackMajor = (Peb->OSCSDVersion >> 8) & 0xFF; InfoEx->wServicePackMinor = Peb->OSCSDVersion & 0xFF; - InfoEx->wSuiteMask = SharedUserData->SuiteMask; + InfoEx->wSuiteMask = SharedUserData->SuiteMask & 0xFFFF; InfoEx->wProductType = SharedUserData->NtProductType; } Index: dll/win32/kernel32/client/version.c =================================================================== --- dll/win32/kernel32/client/version.c (révision 57294) +++ dll/win32/kernel32/client/version.c (copie de travail) @@ -73,12 +73,11 @@ GetVersion(VOID) { PPEB Peb = NtCurrentPeb(); - DWORD Result; - Result = MAKELONG(MAKEWORD(Peb->OSMajorVersion, Peb->OSMinorVersion), - (Peb->OSPlatformId ^ 2) << 14); - Result |= LOWORD(Peb->OSBuildNumber) << 16; - return Result; + return (DWORD)( ((Peb->OSPlatformId ^ 2) << 30) | + (Peb->OSBuildNumber << 16) | + (Peb->OSMinorVersion << 8 ) | + Peb->OSMajorVersion ); } /* Index: include/psdk/ntverp.h =================================================================== --- include/psdk/ntverp.h (révision 57294) +++ include/psdk/ntverp.h (copie de travail) @@ -9,15 +9,15 @@ * The VER_PRODUCTBUILD lines must contain the product * comments and end with the build#. * The VER_PRODUCTBETA_STR lines must contain the product - * comments and end with "somestring". * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ // -// Windows NT Build 3790.1830 +// Windows NT Build 3790.3959 // #define VER_PRODUCTBUILD 3790 -#define VER_PRODUCTBUILD_QFE 1830 +#define VER_PRODUCTBUILD_QFE 3959 // // Windows NT Version 5.2 Index: lib/rtl/version.c =================================================================== --- lib/rtl/version.c (révision 57294) +++ lib/rtl/version.c (copie de travail) @@ -1,8 +1,10 @@ -/* COPYRIGHT: See COPYING in the top level directory +/* + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * PURPOSE: Runtime code * FILE: lib/rtl/version.c - * PROGRAMER: Filip Navara + * PROGRAMERS: Filip Navara + * Hermes BELUSCA - MAITO */ /* INCLUDES *****************************************************************/ @@ -22,28 +24,29 @@ /* FUNCTIONS ****************************************************************/ -static inline NTSTATUS version_compare_values(ULONG left, ULONG right, UCHAR condition) +static UCHAR +RtlpVerGetCondition(IN ULONGLONG dwlConditionMask, + IN ULONG dwTypeBitMask); + +static inline BOOLEAN +RtlpVerCompare(ULONG left, ULONG right, UCHAR condition) { - switch (condition) { + switch (condition) + { case VER_EQUAL: - if (left != right) return STATUS_REVISION_MISMATCH; - break; + return (left == right); case VER_GREATER: - if (left <= right) return STATUS_REVISION_MISMATCH; - break; + return (left > right); case VER_GREATER_EQUAL: - if (left < right) return STATUS_REVISION_MISMATCH; - break; + return (left >= right); case VER_LESS: - if (left >= right) return STATUS_REVISION_MISMATCH; - break; + return (left < right); case VER_LESS_EQUAL: - if (left > right) return STATUS_REVISION_MISMATCH; + return (left <= right); + default: break; - default: - return STATUS_REVISION_MISMATCH; } - return STATUS_SUCCESS; + return FALSE; } /* @@ -58,7 +61,7 @@ ) { RTL_OSVERSIONINFOEXW ver; - NTSTATUS status; + NTSTATUS Status; /* FIXME: - Check the following special case on Windows (various versions): @@ -68,89 +71,135 @@ */ ver.dwOSVersionInfoSize = sizeof(ver); - status = RtlGetVersion( (PRTL_OSVERSIONINFOW)&ver ); - if (status != STATUS_SUCCESS) return status; + Status = RtlGetVersion((PRTL_OSVERSIONINFOW)&ver); + if (Status != STATUS_SUCCESS) + return Status; - if(!(TypeMask && ConditionMask)) return STATUS_INVALID_PARAMETER; + if ((TypeMask == 0) || (ConditionMask == 0)) + return STATUS_INVALID_PARAMETER; - if(TypeMask & VER_PRODUCT_TYPE) + if ((TypeMask & VER_PRODUCT_TYPE) && + RtlpVerCompare(ver.wProductType, + VersionInfo->wProductType, + RtlpVerGetCondition(ConditionMask, VER_PRODUCT_TYPE)) == FALSE) { - status = version_compare_values(ver.wProductType, VersionInfo->wProductType, ConditionMask >> 7 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK); - if (status != STATUS_SUCCESS) - return status; + return STATUS_REVISION_MISMATCH; } - if(TypeMask & VER_SUITENAME) + + if (TypeMask & VER_SUITENAME) { - switch(ConditionMask >> 6 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK) + switch (RtlpVerGetCondition(ConditionMask, VER_SUITENAME)) { case VER_AND: - if((VersionInfo->wSuiteMask & ver.wSuiteMask) != VersionInfo->wSuiteMask) + if ((VersionInfo->wSuiteMask & ver.wSuiteMask) != VersionInfo->wSuiteMask) + { return STATUS_REVISION_MISMATCH; + } break; case VER_OR: - if(!(VersionInfo->wSuiteMask & ver.wSuiteMask) && VersionInfo->wSuiteMask) + if (!(VersionInfo->wSuiteMask & ver.wSuiteMask) && VersionInfo->wSuiteMask) + { return STATUS_REVISION_MISMATCH; + } break; default: return STATUS_INVALID_PARAMETER; } } - if(TypeMask & VER_PLATFORMID) + + if ((TypeMask & VER_PLATFORMID) && + RtlpVerCompare(ver.dwPlatformId, + VersionInfo->dwPlatformId, + RtlpVerGetCondition(ConditionMask, VER_PLATFORMID)) == FALSE) { - status = version_compare_values(ver.dwPlatformId, VersionInfo->dwPlatformId, ConditionMask >> 3 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK); - if (status != STATUS_SUCCESS) - return status; + return STATUS_REVISION_MISMATCH; } - if(TypeMask & VER_BUILDNUMBER) + + if ((TypeMask & VER_BUILDNUMBER) && + RtlpVerCompare(ver.dwBuildNumber, + VersionInfo->dwBuildNumber, + RtlpVerGetCondition(ConditionMask, VER_BUILDNUMBER)) == FALSE) { - status = version_compare_values(ver.dwBuildNumber, VersionInfo->dwBuildNumber, ConditionMask >> 2 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK); - if (status != STATUS_SUCCESS) - return status; + return STATUS_REVISION_MISMATCH; } - if(TypeMask & (VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR|VER_SERVICEPACKMINOR)) + + if (TypeMask & (VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR|VER_SERVICEPACKMINOR)) { - unsigned char condition = 0; - BOOLEAN do_next_check = TRUE; + BOOLEAN comparison = TRUE, do_next_check = TRUE; + /* + * Select the leading comparison operator (for example, the comparison + * operator for VER_MAJORVERSION supersedes the others for VER_MINORVERSION, + * VER_SERVICEPACKMAJOR and VER_SERVICEPACKMINOR). + */ + UCHAR condition = RtlpVerGetCondition(ConditionMask, TypeMask); - if(TypeMask & VER_MAJORVERSION) - condition = ConditionMask >> 1 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK; - else if(TypeMask & VER_MINORVERSION) - condition = ConditionMask >> 0 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK; - else if(TypeMask & VER_SERVICEPACKMAJOR) - condition = ConditionMask >> 5 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK; - else if(TypeMask & VER_SERVICEPACKMINOR) - condition = ConditionMask >> 4 * VER_NUM_BITS_PER_CONDITION_MASK & VER_CONDITION_MASK; - - if(TypeMask & VER_MAJORVERSION) + if (TypeMask & VER_MAJORVERSION) { - status = version_compare_values(ver.dwMajorVersion, VersionInfo->dwMajorVersion, condition); + comparison = RtlpVerCompare(ver.dwMajorVersion, VersionInfo->dwMajorVersion, condition); do_next_check = (ver.dwMajorVersion == VersionInfo->dwMajorVersion) && - ((condition != VER_EQUAL) || (status == STATUS_SUCCESS)); + ((condition != VER_EQUAL) || comparison); } - if((TypeMask & VER_MINORVERSION) && do_next_check) + if ((TypeMask & VER_MINORVERSION) && do_next_check) { - status = version_compare_values(ver.dwMinorVersion, VersionInfo->dwMinorVersion, condition); + comparison = RtlpVerCompare(ver.dwMinorVersion, VersionInfo->dwMinorVersion, condition); do_next_check = (ver.dwMinorVersion == VersionInfo->dwMinorVersion) && - ((condition != VER_EQUAL) || (status == STATUS_SUCCESS)); + ((condition != VER_EQUAL) || comparison); } - if((TypeMask & VER_SERVICEPACKMAJOR) && do_next_check) + if ((TypeMask & VER_SERVICEPACKMAJOR) && do_next_check) { - status = version_compare_values(ver.wServicePackMajor, VersionInfo->wServicePackMajor, condition); + comparison = RtlpVerCompare(ver.wServicePackMajor, VersionInfo->wServicePackMajor, condition); do_next_check = (ver.wServicePackMajor == VersionInfo->wServicePackMajor) && - ((condition != VER_EQUAL) || (status == STATUS_SUCCESS)); + ((condition != VER_EQUAL) || comparison); } - if((TypeMask & VER_SERVICEPACKMINOR) && do_next_check) + if ((TypeMask & VER_SERVICEPACKMINOR) && do_next_check) { - status = version_compare_values(ver.wServicePackMinor, VersionInfo->wServicePackMinor, condition); + comparison = RtlpVerCompare(ver.wServicePackMinor, VersionInfo->wServicePackMinor, condition); } - if (status != STATUS_SUCCESS) - return status; + if (comparison == FALSE) + return STATUS_REVISION_MISMATCH; } return STATUS_SUCCESS; } +static UCHAR +RtlpVerGetCondition(IN ULONGLONG dwlConditionMask, + IN ULONG dwTypeBitMask) +{ + UCHAR dwConditionMask = 0; + + if (dwTypeBitMask == 0) + return 0; + + if (dwTypeBitMask & VER_PRODUCT_TYPE) + dwConditionMask |= dwlConditionMask >> (7 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_SUITENAME) + dwConditionMask |= dwlConditionMask >> (6 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_PLATFORMID) + dwConditionMask |= dwlConditionMask >> (3 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_BUILDNUMBER) + dwConditionMask |= dwlConditionMask >> (2 * VER_NUM_BITS_PER_CONDITION_MASK); + /* + * We choose here the lexicographical order on the 4D space + * {(Major ; Minor ; SP Major ; SP Minor)} to select the + * appropriate comparison operator. + * Therefore the following 'else if' instructions must be in this order. + */ + else if (dwTypeBitMask & VER_MAJORVERSION) + dwConditionMask |= dwlConditionMask >> (1 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_MINORVERSION) + dwConditionMask |= dwlConditionMask >> (0 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_SERVICEPACKMAJOR) + dwConditionMask |= dwlConditionMask >> (5 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_SERVICEPACKMINOR) + dwConditionMask |= dwlConditionMask >> (4 * VER_NUM_BITS_PER_CONDITION_MASK); + + dwConditionMask &= VER_CONDITION_MASK; + + return dwConditionMask; +} + /* * @implemented */ @@ -159,32 +208,32 @@ IN DWORD dwTypeBitMask, IN BYTE dwConditionMask) { - if(dwTypeBitMask == 0) - return dwlConditionMask; + if (dwTypeBitMask == 0) + return dwlConditionMask; - dwConditionMask &= VER_CONDITION_MASK; + dwConditionMask &= VER_CONDITION_MASK; - if(dwConditionMask == 0) - return dwlConditionMask; + if (dwConditionMask == 0) + return dwlConditionMask; - if(dwTypeBitMask & VER_PRODUCT_TYPE) - dwlConditionMask |= dwConditionMask << 7 * VER_NUM_BITS_PER_CONDITION_MASK; - else if(dwTypeBitMask & VER_SUITENAME) - dwlConditionMask |= dwConditionMask << 6 * VER_NUM_BITS_PER_CONDITION_MASK; - else if(dwTypeBitMask & VER_SERVICEPACKMAJOR) - dwlConditionMask |= dwConditionMask << 5 * VER_NUM_BITS_PER_CONDITION_MASK; - else if(dwTypeBitMask & VER_SERVICEPACKMINOR) - dwlConditionMask |= dwConditionMask << 4 * VER_NUM_BITS_PER_CONDITION_MASK; - else if(dwTypeBitMask & VER_PLATFORMID) - dwlConditionMask |= dwConditionMask << 3 * VER_NUM_BITS_PER_CONDITION_MASK; - else if(dwTypeBitMask & VER_BUILDNUMBER) - dwlConditionMask |= dwConditionMask << 2 * VER_NUM_BITS_PER_CONDITION_MASK; - else if(dwTypeBitMask & VER_MAJORVERSION) - dwlConditionMask |= dwConditionMask << 1 * VER_NUM_BITS_PER_CONDITION_MASK; - else if(dwTypeBitMask & VER_MINORVERSION) - dwlConditionMask |= dwConditionMask << 0 * VER_NUM_BITS_PER_CONDITION_MASK; + if (dwTypeBitMask & VER_PRODUCT_TYPE) + dwlConditionMask |= dwConditionMask << (7 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_SUITENAME) + dwlConditionMask |= dwConditionMask << (6 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_SERVICEPACKMAJOR) + dwlConditionMask |= dwConditionMask << (5 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_SERVICEPACKMINOR) + dwlConditionMask |= dwConditionMask << (4 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_PLATFORMID) + dwlConditionMask |= dwConditionMask << (3 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_BUILDNUMBER) + dwlConditionMask |= dwConditionMask << (2 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_MAJORVERSION) + dwlConditionMask |= dwConditionMask << (1 * VER_NUM_BITS_PER_CONDITION_MASK); + else if (dwTypeBitMask & VER_MINORVERSION) + dwlConditionMask |= dwConditionMask << (0 * VER_NUM_BITS_PER_CONDITION_MASK); - return dwlConditionMask; + return dwlConditionMask; } /* EOF */ Index: ntoskrnl/ex/init.c =================================================================== --- ntoskrnl/ex/init.c (révision 57294) +++ ntoskrnl/ex/init.c (copie de travail) @@ -1076,16 +1076,17 @@ /* Setup initial system settings */ CmGetSystemControlValues(LoaderBlock->RegistryBase, CmControlVector); - /* Load static defaults for Service Pack 1 and add our SVN revision */ - CmNtCSDVersion = 0x100 | (KERNEL_VERSION_BUILD_HEX << 16); + /* Load static defaults for Service Pack 2 and add our SVN revision */ + /* Format of CSD : SPMajor - SPMinor */ + CmNtCSDVersion = 0x200 | (KERNEL_VERSION_BUILD_HEX << 16); CmNtCSDReleaseType = 0; - /* Set Service Pack data for Service Pack 1 */ - CmNtSpBuildNumber = 1830; + /* Set Service Pack data for Service Pack 2 */ + CmNtSpBuildNumber = VER_PRODUCTBUILD_QFE; if (!(CmNtCSDVersion & 0xFFFF0000)) { /* Check the release type */ - if (CmNtCSDReleaseType == 1) CmNtSpBuildNumber |= 1830 << 16; + if (CmNtCSDReleaseType == 1) CmNtSpBuildNumber |= VER_PRODUCTBUILD_QFE << 16; } /* Add loaded CmNtGlobalFlag value */ Index: ntoskrnl/mm/ARM3/mminit.c =================================================================== --- ntoskrnl/mm/ARM3/mminit.c (révision 57294) +++ ntoskrnl/mm/ARM3/mminit.c (copie de travail) @@ -2398,7 +2398,7 @@ } else { - /* Check for LanMan server */ + /* Check for LanMan server (La for LanmanNT) */ if (MmProductType == '\0a\0L') { /* This is a domain controller */ @@ -2406,7 +2406,7 @@ } else { - /* Otherwise it must be a normal server */ + /* Otherwise it must be a normal server (Se for ServerNT) */ SharedUserData->NtProductType = NtProductServer; } Index: ntoskrnl/rtl/misc.c =================================================================== --- ntoskrnl/rtl/misc.c (révision 57294) +++ ntoskrnl/rtl/misc.c (copie de travail) @@ -67,7 +67,7 @@ RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)lpVersionInformation; InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF; InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF); - InfoEx->wSuiteMask = (USHORT)SharedUserData->SuiteMask; + InfoEx->wSuiteMask = (USHORT)(SharedUserData->SuiteMask & 0xFFFF); InfoEx->wProductType = SharedUserData->NtProductType; }