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.
BOOLEAN PsGetVersion( PULONG MajorVersion, PULONG MinorVersion, PULONG BuildNumber, PUNICODE_STRING CSDVersion );
Points to a caller-supplied variable that this routine sets to the major version of the operating system. This optional parameter can be NULL.
Points to a caller-supplied variable that this routine sets to the minor version of the operating system. This optional parameter can be NULL.
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.
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.
PsGetVersion returns whether the system is a checked or free build, as follows:
||Checked build of the operating system.|
||Free build of the operating system.|
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.
|Minimum supported client||Available starting with Windows 2000.|
|Header||wdm.h (include Ntddk.h)|
|DDI compliance rules||IrqlPsPassive, PowerIrpDDis, HwStorPortProhibitedDDIs|
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.