您的位置:首页 > 其它

Windows内核-显示OS的版本

2021-07-18 20:15 10 查看 https://www.cnblogs.com/sna1lg

Windows内核-显示OS的版本

显示OS的major,minor,build版本Number:

#include <ntddk.h>

void SampleUnload(_In_ PDRIVER_OBJECT DriverObject)
{
UNREFERENCED_PARAMETER(DriverObject);
KdPrint(("Sample driver Unload called! \n"));
}
void PrintOsVersion(PRTL_OSVERSIONINFOW lp)
{
DbgPrint("The major OS version number = %u\n", lp->dwMajorVersion);
DbgPrint("The minor OS version number = %u\n", lp->dwMinorVersion);
DbgPrint("The build OS version number = %u\n", lp->dwBuildNumber);
DbgPrint(("Print is over"));
}


extern "C"
NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath) {
DriverObject->DriverUnload = SampleUnload;
UNREFERENCED_PARAMETER(RegistryPath);
OSVERSIONINFOW test;
test.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
RtlGetVersion(&test);
PrintOsVersion(&test);
KdPrint(("Sample driver initialized successfully\n !"));

return STATUS_SUCCESS;
}

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐