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

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

Thread Previous | Thread Next
Jan Dubois
July 30, 2003 07:43
Re: [PATCH] Extend Win32::GetOSVersion() to return additional information
Message ID:
On Tue, 29 Jul 2003 21:13:56 -0700, Michael G Schwern <>

>> +[CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), where the
>> +On Windows NT 4 SP6 and later this function returns the following
>This is just SCREAMING for a hash.  Perhaps instead of (or in addition to)
>extending GetOSVersion() you could supply a similar function which returns
>this information as a hash?

Why?  This function is pretty similar to POSIX::uname(), which also
returns everything as a list.  Changing Win32::GetOSVersion() is out of
the question for backward compatibility, I would think.  Just adding the
additional values to the end of the returned list seems like a good idea
to me.

>> +SUITEMASK is a bitfield identifying the product suites available on
>> +the system.  Known bits are:
>> +
>> +    VER_SUITE_SMALLBUSINESS             0x00000001
>> +    VER_SUITE_ENTERPRISE                0x00000002
>> +    VER_SUITE_BACKOFFICE                0x00000004
>> +    VER_SUITE_COMMUNICATIONS            0x00000008
>> +    VER_SUITE_TERMINAL                  0x00000010
>> +    VER_SUITE_EMBEDDEDNT                0x00000040
>> +    VER_SUITE_DATACENTER                0x00000080
>> +    VER_SUITE_SINGLEUSERTS              0x00000100
>> +    VER_SUITE_PERSONAL                  0x00000200
>> +    VER_SUITE_BLADE                     0x00000400
>> +    VER_SUITE_EMBEDDED_RESTRICTED       0x00000800
>> +    VER_SUITE_SECURITY_APPLIANCE        0x00001000
>> +
>> +The VER_SUITE_xxx names are listed here to crossreference the Microsoft
>> +documentation.  The Win32 module does not provide symbolic names for these
>> +constants.
>Any reason why not other than a lack of tuits?

I guess we _could_ add them to  The Win32 module is distributed
in a weird way: some XS functions are part of the Perl core (including
Win32::GetOSVersion()), while others are implemented in
from the libwin32 bundle on CPAN.  The combined documentation is in
Win32.pod from the Perl core again.

I don't want to add the constants above to the win32/win32.c file in Perl
core.  They will be rarely used and just constitute bloat.  But adding the
constants to would split the Win32::GetOSVersion() functionality
between the core and libwin32, which is getting even more confusing than
it already is.

I think it would be a good idea to move from libwin32 to
the core to remove this weird interdependency.  Currently the
documentation in Win32.pod from the core can easily be wrong if you don't
have the corresponding version of libwin32 installed.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About