Change reactos identification

Ask your support questions in here

Moderator: Moderator Team

gabrielilardi
Moderator Team
Posts: 873
Joined: Sat Sep 02, 2006 1:30 am
Location: Italy

Post by gabrielilardi »

Z98 wrote:Okay, now we're getting contradictory information. I first said it was in the Registry, Ged claimed it was a function, and now Greatlord says it's Registry again. How about we all make up our minds?
There's no contradiction, there are several ways to know what system you're on. There are apis () and there are registry keys, here we should know how that program checks wether it's an xp rather than w2k, etc.

See:
point 1.7 at http://msdn2.microsoft.com/en-us/library/ms954313.aspx
http://msdn.microsoft.com/library/defau ... ystems.asp
http://forum.sysinternals.com/forum_posts.asp?TID=1902

Ged
Developer
Posts: 925
Joined: Thu Sep 29, 2005 3:00 pm
Location: UK

Post by Ged »

Z98 wrote:Okay, now we're getting contradictory information. I first said it was in the Registry, Ged claimed it was a function, and now Greatlord says it's Registry again. How about we all make up our minds?
I've already made up my mind. This information is hardcoded into the kernel. It's retrived via the API's I mentioned.

Any app which is pulling this information from the registry is wrong. Windows provides API's to hide underlying implementations. People who don't use these API's risk breaking their applications.

Nmn
Posts: 170
Joined: Wed Dec 07, 2005 10:20 pm
Location: In front of my pc maybe?

Post by Nmn »

Sure they risk API breaking. They just don't care, its a laziness issue. Its well known that many applications cheat and use the registry.
Programmers: Help us put Vista graphics drivers on Linux! The WDOL Project Homepage

GreatLord
Developer
Posts: 926
Joined: Tue Nov 30, 2004 10:26 am
Location: Sweden

Post by GreatLord »

Lets make it is clear once for all how it works
in the system register in reactos and windows it exists a register setting to tell which windows it is.

The public api that ged refens to is using that register key to read the os version. it is so it works in windows and did work in reactos last time I checked.

Ged
Developer
Posts: 925
Joined: Thu Sep 29, 2005 3:00 pm
Location: UK

Post by Ged »

GreatLord wrote:Lets make it is clear once for all how it works
in the system register in reactos and windows it exists a register setting to tell which windows it is.

The public api that ged refens to is using that register key to read the os version. it is so it works in windows and did work in reactos last time I checked.
I hate to disagree with a fellow dev, but you are wrong.
Have you even checked the code before writing this?

GetVersionEx and VerifyVersionInfo both rely on RtlGetVersion in ntoskrnl to do the work. For clarity I'll paste that API here

Code: Select all

NTSTATUS STDCALL
RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
{
   if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOW) ||
       lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
   {
      lpVersionInformation->dwMajorVersion = NtMajorVersion;
      lpVersionInformation->dwMinorVersion = NtMinorVersion;
      lpVersionInformation->dwBuildNumber = NtBuildNumber;
      lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
      if(((CmNtCSDVersion >> 8) & 0xFF) != 0)
      {
        int i = _snwprintf(lpVersionInformation->szCSDVersion,
                           (sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0])) - 1,
                           L"Service Pack %d",
                           ((CmNtCSDVersion >> 8) & 0xFF));
        lpVersionInformation->szCSDVersion[i] = L'\0';
      }
      else
      {
        RtlZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
      }
      if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
      {
         RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)lpVersionInformation;
         InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF;
         InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF);
         InfoEx->wSuiteMask = (USHORT)SharedUserData->SuiteMask;
         InfoEx->wProductType = SharedUserData->NtProductType;
      }

      return STATUS_SUCCESS;
   }

   return STATUS_INVALID_PARAMETER;
}
This code relies on the following private data in ntoskrnl :

Code: Select all

/* NT Version Info */
ULONG NtMajorVersion = VER_PRODUCTMAJORVERSION;
ULONG NtMinorVersion = VER_PRODUCTMINORVERSION;
#if DBG
ULONG NtBuildNumber = VER_PRODUCTBUILD | 0xC0000000;
#else
ULONG NtBuildNumber = VER_PRODUCTBUILD;
#endif
VER_PRODUCTMAJORVERSION is set to 5
VER_PRODUCTMINORVERSION is set to 2

As you can see, this information is hardcoded into the kernel. It is not taken from the registry.
Using the registry is wrong

GreatLord
Developer
Posts: 926
Joined: Tue Nov 30, 2004 10:26 am
Location: Sweden

Post by GreatLord »

okay that have change seen I last checked :)
what a miss from my side.

then it is two part need be change
the regsetting and the hard value.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests