Home › Forums › Discussions › General › How to get Service Pack Number of OS from Kernel Mode
- This topic has 3 replies, 2 voices, and was last updated 17 years, 6 months ago by Vadim Smirnov.
-
AuthorPosts
-
June 26, 2007 at 7:46 am #5111
Hi All,
I need a way to get the service pack number of OS from Kernel mode as i have to support my driver for all the serice packs of xp , 2k and server 2003.
Is there any exported variable in windows to do so or any kernel api is there or not.
Please reply soon
Kind Regards
DeepakJune 26, 2007 at 8:45 am #6344RTFM DDK
Windows XP and below:
BOOLEAN
PsGetVersion(
PULONG MajorVersion OPTIONAL,
PULONG MinorVersion OPTIONAL,
PULONG BuildNumber OPTIONAL,
PUNICODE_STRING CSDVersion OPTIONAL
);
Parameters
MajorVersion
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
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
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
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.Windows XP and above
NTSTATUS
RtlGetVersion(
IN OUT PRTL_OSVERSIONINFOW lpVersionInformation
);
Parameters
lpVersionInformation
Pointer to either a RTL_OSVERSIONINFOW structure or a RTL_OSVERSIONINFOEXW structure that contains the version information about the currently running operating system. A caller specifies which input structure is used by setting the dwOSVersionInfoSize member of the structure to the size in bytes of the structure that is used.typedef struct _OSVERSIONINFOEXW {
ULONG dwOSVersionInfoSize;
ULONG dwMajorVersion;
ULONG dwMinorVersion;
ULONG dwBuildNumber;
ULONG dwPlatformId;
WCHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage
USHORT wServicePackMajor;
USHORT wServicePackMinor;
USHORT wSuiteMask;
UCHAR wProductType;
UCHAR wReserved;
} RTL_OSVERSIONINFOEXW;June 26, 2007 at 8:52 am #6345thnx a ton buddy.
I think it will work for my case.
Is there any exported variable like “NtBuildNumber” which keeps the Version Number and CSD String.
Asking just out of curiosity.
Kind Regards
DeepakJune 29, 2007 at 8:36 am #6346Is there any exported variable like “NtBuildNumber” which keeps the Version Number and CSD String.
NtBuildNumber is exported by kernel, CSD string with service pack not.
-
AuthorPosts
- You must be logged in to reply to this topic.