HOWTO: Getting OS Version Information in a Device DriverID: Q193824
|
There is no documented way to get operating system version information from a kernel-mode device driver. There is an API in NTDDK.h called PsGetVersion that returns the Major version, Minor version, Build number, and the CSD (Corrected Service Diskette, Service Pack) number.
BOOLEAN
PsGetVersion(
PULONG MajorVersion OPTIONAL,
PULONG MinorVersion OPTIONAL,
PULONG BuildNumber OPTIONAL,
PUNICODE_STRING CSDVersion OPTIONAL
);
BOOLEAN success;
ULONG MajorVersion;
ULONG MinorVersion;
ULONG BuildNumber;
UNICODE_STRING CSDVersion;
success = PsGetVersion(
&MajorVersion,
&MinorVersion,
&BuildNumber,
&CSDVersion
);
success = PsGetVersion(
&MajorVersion,
&MinorVersion,
NULL,
NULL
);
Keywords : kbcode kbDDK kbKMode kbNTOS400
Version :
Platform :
Issue type : kbhowto
Last Reviewed: March 6, 1999