![]() |
Quote:
But I agree it is getting more and more strange at all... |
Quote:
Actually, the "enforced compatibility mode" has great potential to breaking things. If, e.g., my application relies on the correct documented behavior of GetVersionEx(), it will stop working in Windows 8.1. So, following the M$ method, I will need to "fix" my application by adding the required GUID. But on Windows 10 it will break, once again. And I will need to "fix" my application, once again. For every new Windows version I will have to "fix" my application – again and again! Without all the "compatibility" mess and if they do not mindlessly break existing documented behavior, the very same binary that was originally compiled for Windows XP could still be working perfectly fine in Windows 10. BTW: If I want to accurately emulate the behavior of Windows N on Windows N+1, there is a solution known for decades - virtualization. Quote:
Really, you can't punish every application out there, just because a few applications do stupid things. If at all, the "compatibility" hacks must be optional (disabled by default!), so they can be enabled if and only if they are actually needed and/or helpful. Heck, if they think users are too dumb for enabling compat mode themselves, they could have implemented a Blacklist for known "broken" applications. Quote:
|
I'm still a little confused as to what the issue is here. If you need to detect that you are running Windows 10, add the GUID. Otherwise on Windows 10 as far as your app knows it is running on Windows 8.1. Why is this such a big issue?
I can see this being an issue for logging or reporting purposes but surely it's not difficult to add the GUID and send out an updated version of your app? That is the only case that there is an issue and it is a very minor one. Also I'm not sure how this "punishes" the application by giving it the false version. As I've said before, the app will not support newer Windows 10 features until you add them anyway - at which point you can add the GUID... Stu |
as for not working with newer OS features, most cases you need to update to support the newer OS so then adding the guid at that point is a non-issue imho.
tbh the argument that comes across is almost like "why should I have to keep updating things". and with the compatibility issues, MS can also insert a shim to correct / revert things if needed (often without you knowing about it in the first place) so that's a bit of a non-issue as well. sure it's not great if the OS changes things but it's not just an issue specific to Windows and any developed system can 'break' things or change the rules (which am sure are not changed unless there's a reason to do so). either way, I can why for some cases it's not great about this change, then again just magically expecting things to work like before is a bit naive and I don't mind the guid aspect as it's not like things with Windows haven't changed / been broken before and any change in OS means having to do some sort of update if you really need to know the OS version anyway (as how can you magically know in advance the name for the OS?). if anything, a reliance on the OS version for identification is an old way of thinking about things (yes I know it'd be needed to gauge what OS a crash report comes from) but the more web-like way of querying for functionality than assuming it on the OS is better imho (and is something that has definitely been needed since XP such as for SP2 vs SP3 additions). |
Quote:
Now you can say: "I don't care about future OS versions" or "getting the correct version isn't all that important for me". But for some people it is! Suppose I have shipped a program 6 months ago and today I get a bug report from a customer. If the log file says "Windows 8.1" this could mean he really is on "Windows 8.1", but it could also means he is on "Windows 10" (because the info in the log is wrong). Of course I need to know the exact system specification to try to replicate his problem! So I will have to ask him what OS he really uses. Now suppose he is located on the opposite side of the globe. Means I will have to wait (at least) until the next workday to get an answer. Thank you M$! --- Also there is another very important point: Very often you are writing library code! This means you can not influence the Manifest of the program, which will contain your code, at all! And, in my experience, most program files don't contain any of these compatibility GUID's – programmers barely know that such thing exists. So, for library code, you have to assume that no particular GUID will be included in the program. Therefore, you won't even be able to distinguish those Windows versions that exited by the time you created your code !!! Quote:
Quote:
--- I will not try to further convince you that it's important to have a reliable method to detect the exact OS version that we are running on – current and future. But I surely need this functionality. And it appears a lot of other people do too. So whoever finds the GetRealOSVersion and GetRealOSName functions useful may use them – now on Windows 10 too. The rest of the world can just happily ignore them ;) |
As already stated, I agree with LoRd_MuldeR on this topic in any and all possible ways. If I need to determine the exact real version that my app is running on a regular basis, I do so for a reason, and I need a way to do so that is not influenced by some compatibility hack that Microsoft created for certain OS versions.
So I am glad that that the GetRealOSVersion function exists, and I hope that it'll be updated if Microsoft should break their own documented APIs again. |
Quote:
|
BTW: Now that GetRealOSVersion, GetRealOSName, and VerifyOSVersion work correctly again on all (yet-released) Windows versions (thanks again!), what is the current state of GetRealOSBuildNo and VerifyOSBuildNo? I guess that is not as easy to fix, right?
|
Quote:
BTW: GetRealOSName naturally cannot give you the correct name of future Windows version, because this name is not even decided yet. Still it should return "unknown" instead of returning an invalid Windows version, like GetVersionEx() would do - and knowing that you are actually running on some unknown OS version (by the time your product was released) can already be a valuable information, I think. |
Ok, thanks for the detailed information. This is exactly what I was looking for: So, on a future OS, I will still receive the correct major/minor version and build number regardless of any compatibility mode that might be in effect (at least until MS breaks things again). Of course the OS name cannot be known in advance, so "unknown" is a good choice.
|
You could read version information from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion (SetRegView 64) if that is sufficient as a last resort.
Edit: Or WMI of course... wmic os get caption Stu |
Here is a new version of StdUtils, which contains an improved GetRealOSVersion function:
https://github.com/lordmulder/stduti...eases/tag/1.10 This one no longer relies on investigating the file version of KERNEL32.DLL to detect Windows 10+. Does not rely on WMI (COM) or dubious Registry hacks either. Instead we call the "native" RtlGetVersion() function directly, instead of the "crippled" equivalent. |
FYI RtlGetVersion is affected by the compatibility tab so it might not report the real version.
|
Quote:
RealOSVersion.2016-05-14.zip |
If it is not affected, why do you bother looping with VerifyVersionInfo?
Anyway, I have seen RtlGetVersion on Vista SP2 return 5.1.2600 if you set compatibility to XP (don't remember if AcLayers was involved though). On Windows 8 RtlGetVersion returns the correct value but then a hook overwrites parts of the result: Quote:
http://i.imgur.com/xt0TN2x.png PHP Code:
|
Quote:
Windows 10 without compat mode: http://pastie.org/10838499 Windows 10 with Win9x compat mode: http://pastie.org/10838500 Windows 10 with WinXP compat mode: http://pastie.org/10838502 In the last case even RtlGetVersion() lies, but RtlVerifyVersionInfo can reveal the expected result. RealOSVersion.2016-05-15.zip |
RtlVerifyVersionInfo probably helps because its internal call to RtlGetVersion is not hooked, this might change in the future of course because MS will discover that people are doing this. Our only hope is that it is a layering violation for NTDLL to call back up to the shim dll's so they might let this one slide, fingers crossed...
|
Quote:
https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx From what I remember this functions did not changed since eons. Currently I also do not expect this functions will be changed, Microsoft will surely not making the driver development more difficuilt. And since most drivers are capable to be used on more than one OS this functions are very essential for driver development. |
Quote:
Quote:
|
1 Attachment(s)
And as a cruel joke, here I'm breaking your GetRealOSVersion detection:
http://i.imgur.com/NZVlIlv.png :D @th_mi: Oh look, the user-mode implementation is not the same as the kernel implementation! |
Quote:
|
Quote:
|
Besides: Is StdUtils still able to extract the real OS version even if Microsoft now also fakes file version information?
See: http://forums.winamp.com/showpost.ph...38&postcount=7 |
Quote:
|
| All times are GMT. The time now is 17:28. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.