This function is obsolete in Windows XP and later versions of the operating system. Use RtlGetVersion instead.
PsGetVersion returns caller-selected information about the current version of the NT-based operating system.
BOOLEAN
PsGetVersion(
PULONG MajorVersion OPTIONAL,
PULONG MinorVersion OPTIONAL,
PULONG BuildNumber OPTIONAL,
PUNICODE_STRING CSDVersion OPTIONAL
);
ntddk.h
PsGetVersion returns whether the system is a checked or free build, as follows:
| Value | Meaning |
|---|---|
| TRUE (1) | Checked build of the operating system. |
| FALSE (0) | Free build of the operating system. |
PsGetVersion returns the requested information, depending on which optional parameter(s) the caller supplies.
To retrieve the current sevice-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.
Callers of PsGetVersion must be running at IRQL PASSIVE_LEVEL.