Export (0) Print
Expand All

PsGetVersion function

This function is obsolete in Windows XP and later versions of the Windows operating system. Use RtlGetVersion instead.

PsGetVersion returns caller-selected information about the current version of the NT-based operating system.

Syntax


BOOLEAN PsGetVersion(
  _Out_opt_  PULONG MajorVersion,
  _Out_opt_  PULONG MinorVersion,
  _Out_opt_  PULONG BuildNumber,
  _Out_opt_  PUNICODE_STRING CSDVersion
);

Parameters

MajorVersion [out, optional]

Points to a caller-supplied variable that this routine sets to the major version of the operating system. This optional parameter can be NULL.

MinorVersion [out, optional]

Points to a caller-supplied variable that this routine sets to the minor version of the operating system. This optional parameter can be NULL.

BuildNumber [out, optional]

Points to a caller-supplied variable that this routine sets to the current build number of the operating system. This optional parameter can be NULL.

CSDVersion [out, optional]

Points to a caller-allocated buffer in which this routine returns the current service-pack version as a Unicode string only during system driver initialization. This optional parameter can be NULL.

Return value

PsGetVersion returns whether the system is a checked or free build, as follows:

Return codeDescription
TRUE (1)

Checked build of the operating system.

FALSE (0)

Free build of the operating system.

 

Remarks

PsGetVersion returns the requested information, depending on which optional parameter(s) the caller supplies.

To retrieve the current service-pack number, it is easier and more efficient to make an application-level call within the Win32 environment than to call PsGetVersion during system driver initialization, which then must parse the string it returns at CSDVersion. When the registry is initialized, a driver cannot obtain this string from PsGetVersion, but must read the CmCSDVersionString value from the registry.

Requirements

Version

Available starting with Windows 2000.

Header

Ntddk.h (include Ntddk.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

IrqlPsPassive, PowerIrpDDis, HwStorPortProhibitedDDIs

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft