Hi,

From within a driver, I want to get the string name of the service pack, e.g.
"Service Pack 1, v.1247"

The function PsGetVersion() is supposed to do the trick, but I can't get a
string out of it, neither from within DriverEntry, nor any other point in my
driver. (I do get other version info from PsGetVersion() though, but not the
SP name.)

Is there any other way to get the service pack name string from within a
driver?


Thanks,

/ Hannes.

Re: Get service pack name from a driver? by Stephan


RE: Get service pack name from a driver? by a-danwh

a-danwh
Fri Apr 22 17:42:23 CDT 2005

------=_NextPart_0001_067DCE3D
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Greetings,

The best method, via the kernel, is to use the RTL_OSVERSIONINFOEXW via
RtlGetVersion() and RtlVerifyVersionInfo() found in the DDK.
With this method you can obtain the Major and Minor version of the
installed service pack, among other information.
These are defined in NTDDK.H

Hope this helps.

Daniel Whitaker
Microsoft DDK Team

This posting is provided "AS IS" with no warranties, and confers no rights
------=_NextPart_0001_067DCE3D
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Greetings,
\par
\par The best method, via the kernel, is to use the RTL_OSVERSIONINFOEXW via RtlGetVersion() and RtlVerifyVersionInfo() found in the DDK.
\par With this method you can obtain the Major and Minor version of the installed service pack, among other information.
\par These are defined in NTDDK.H
\par
\par Hope this helps.
\par
\par Daniel Whitaker
\par Microsoft DDK Team
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights
\par
\par }
------=_NextPart_0001_067DCE3D--


Re: Get service pack name from a driver? by Woody

Woody
Sat Apr 23 13:25:08 CDT 2005

Greetings,

Yes, there is another way. You can read the registry key at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

Look for CDSVersion. You will find a bunch of other stuff there too.
PsGetVersion() only works during system initialization and the DDK
points to this key as an alternative.

Thanks

Dan Whitkaer


Re: Get service pack name from a driver? by Maxim

Maxim
Sat Apr 23 18:53:47 CDT 2005

> Look for CDSVersion. You will find a bunch of other stuff there too.
> PsGetVersion() only works during system initialization and the DDK
> points to this key as an alternative.

CSDVersion. It contains the string name of the service pack.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Re: Get service pack name from a driver? by hannes

hannes
Mon Apr 25 10:29:04 CDT 2005

That does not return a string, it returns an enum. I need a string...


/ Hannes.

"Stephan Wolf [MVP]" wrote:

> See
>
>
> http://groups-beta.google.com/group/microsoft.public.development.device.drivers/msg/33a26c54627ac9a0
>
> Stephan
>
>

RE: Get service pack name from a driver? by hannes

hannes
Mon Apr 25 10:31:02 CDT 2005

Is RtlGetVersion accessible in Windows 2000 ? I need to run this on both
Windows 2000 and on Windows XP (and above).

ntoskrnl.lib for XP has it, but not for 2000. For 2000, it exists in
ntdll.lib, but that's usermode stuff that I'd better not use from my driver,
I guess.

/ Hannes.

"Daniel Whitaker [MSFT]" wrote:

> Greetings,
>
> The best method, via the kernel, is to use the RTL_OSVERSIONINFOEXW via
> RtlGetVersion() and RtlVerifyVersionInfo() found in the DDK.
> With this method you can obtain the Major and Minor version of the
> installed service pack, among other information.
> These are defined in NTDDK.H
>
> Hope this helps.
>
> Daniel Whitaker
> Microsoft DDK Team
>
> This posting is provided "AS IS" with no warranties, and confers no rights

Re: Get service pack name from a driver? by hannes

hannes
Mon Apr 25 10:36:02 CDT 2005

So, for Windows 2000, it seems the only way to get the service pack name is
to open up the registry.


Can anyone help me figure out why PsGetVersion() does not return the service
pack string? It is documented to do so, but for me it does not - not even
when called from my DriverEntry().


Thanks,

/ Hannes.

Re: Get service pack name from a driver? by Maxim

Maxim
Mon Apr 25 12:20:35 CDT 2005

A string? Fine! This is CSDVersion registry value.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Hannes" <hannes.news@nospam.nospam> wrote in message
news:E6AC191B-68BE-4798-8335-CEA6BFCEBD8F@microsoft.com...
> That does not return a string, it returns an enum. I need a string...
>
>
> / Hannes.
>
> "Stephan Wolf [MVP]" wrote:
>
> > See
> >
> >
> >
http://groups-beta.google.com/group/microsoft.public.development.device.drivers/msg/33a26c54627ac9a0
> >
> > Stephan
> >
> >



Re: Get service pack name from a driver? by a-danwh

a-danwh
Fri Apr 29 13:27:21 CDT 2005

------=_NextPart_0001_29A0D7FA
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Greetings,

I've been debugging PsGetVersion in order to determine why it does not
return the ServicePack string. As it turns out, the function does indeed
copy the string, but the string is always NULL. Windows itself does not
use this function to obtain the service pack string, but rather uses the
registry only.
The only remaining functionality of the function is to obtain the major,
minor, and build values. The string is a stump.

My educated guess is that this functionality is a carry over from some
previous release and now remains empty.

I hope this helps.

Thanks

Daniel Whitaker
DDK Support Team

This posting is provided "AS IS" with no warranties, and confers no rights
------=_NextPart_0001_29A0D7FA
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Greetings,
\par
\par I've been debugging PsGetVersion in order to determine why it does not return the ServicePack string. As it turns out, the function does indeed copy the string, but the string is always NULL. Windows itself does not use this function to obtain the service pack string, but rather uses the registry only.
\par The only remaining functionality of the function is to obtain the major, minor, and build values. The string is a stump.
\par
\par My educated guess is that this functionality is a carry over from some previous release and now remains empty.
\par
\par I hope this helps.
\par
\par Thanks
\par
\par Daniel Whitaker
\par DDK Support Team
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights
\par
\par }
------=_NextPart_0001_29A0D7FA--


Re: Get service pack name from a driver? by hannes

hannes
Fri Apr 29 18:30:01 CDT 2005

Thanks for sharing that. At least I know I'm not doing anything wrong.

I'll just go ahead and get it from the registry, then!


/ Hannes.