develooper Front page | perl.perl5.porters | Postings from July 2003

Re: [PATCH] Extend Win32::GetOSVersion() to return additional inf ormation

Jan Dubois
July 30, 2003 09:18
Re: [PATCH] Extend Win32::GetOSVersion() to return additional inf ormation
Message ID:
On Wed, 30 Jul 2003 15:51:01 +0100, "Orton, Yves" <> wrote:

>Also while you are on the subject GetOSName needs to be updated in,
>which I can do if you like.

I already did this, but didn't submit to p5p because it is part of libwin32.
Whenever Sarathy makes a new libwin32 release (probably when we make another
ActivePerl release) this will be included.

I've attached the trivial patch below.  I removed the links to MSDN as they
are broken once again.  It just doesn't seem to be possible to get long-living
links to that information; just use Google to search for OSVERSIONINFOEX with
a qualifier.

>Incidentally the whole idea of GetOSName is to provide a central and
>consistant way to be able to resolve the various
>version numbers from GetOSVersion() down to the "normal" concept of OS
>version. The handling of the different values isnt exactly straight forward
>and requires information not published in one location by MS.

Only the legacy stuff is non-intuitive.  Everything released after Windows NT 4
seems to be numbered sensibly.  Well, except for the RC1 of Windows .NET Server.

>If it gets moved to core by the way, will it still be possible to install it

Just like any other core module, I would think.  It will need some special code
in the libwin32 MakeMaker.PL to make sure it still gets installed into older
versions of Perl.


Change 72367 by jand@jand-tofino on 2003/07/29 17:46:54

libwin32: Add Win2003 support to Win32::GetOSName.  I decided to
          *not* change the value returned for Windows XP
          ("WinXP/.Net") to avoid breaking existing code.

Affected files ...

... src/Modules/libwin32/ edit

Differences ...

==== src/Modules/libwin32/ (text) ====
Index: src/Modules/libwin32/
--- src/Modules/libwin32/	Tue Jul 29 17:50:00 2003
+++ src/Modules/libwin32/	Tue Jul 29 17:50:00 2003
@@ -186,16 +186,11 @@
         ($desc, $major, $minor, $build, $id) = Win32::GetOSVersion();
         # If id==0 then its a win32s box -- Meaning Win3.11
-        #
         unless($id) {
             $os = 'Win32s';
 	else {
 	    # Magic numbers from MSDN documentation of OSVERSIONINFO
-	    # Here is some mickeysoft code that tells the story as well:
-	    #
-	    # Caution with the above code as it uses functions unavailable
-	    # to us in Perl.
 	    # Most version names can be parsed from just the id and minor
 	    # version
 	    $os = {
@@ -207,6 +202,7 @@
 		2 => {
 		    0  => "2000",
 		    1  => "XP/.Net",
+                    2  => "2003",
 		    51 => "NT3.51"
End of Patch. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About