Dear all:
I am writing a disk class filter driver. I need to
distinguish if I am running Windows 2000 or Windows XP
in the DriverEntry routine. I’ve tried to query, using
RtlQueryRegistryValue, the key:
\registry\machine\Software\Microsoft\Windows
NT\CurrentVersion\CurentBuildNumber, but it returns
status code 34. Apparentlly, I can’t query anything
under the microsoft registry key.
Can someone tell are there any other ways which can
tell what os that I am running with?
Thanks,
Chin Wu
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Try using RtlGetVersion()
From the Windows DDK:
RtlGetVersion returns version information about the currently running
operating system.
NTSTATUS
RtlGetVersion(
IN OUT PRTL_OSVERSIONINFOW lpVersionInformation
);
Please refer to the DDK for more details on this function
Regards,
Ravi.
-----Original Message-----
From: Chin Ng [mailto:xxxxx@yahoo.com]
Sent: Tuesday, May 29, 2001 10:53 AM
To: NT Developers Interest List
Subject: [ntdev] How to determine Windows Version in a disk
filter driver?
Dear all:
I am writing a disk class filter driver. I need to
distinguish if I am running Windows 2000 or Windows XP
in the DriverEntry routine. I’ve tried to query, using
RtlQueryRegistryValue, the key:
\registry\machine\Software\Microsoft\Windows
NT\CurrentVersion\CurentBuildNumber, but it returns
status code 34. Apparentlly, I can’t query anything
under the microsoft registry key.
Can someone tell are there any other ways which can
tell what os that I am running with?
Thanks,
Chin Wu
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
You are currently subscribed
to ntdev as: xxxxx@microsoft.com To unsubscribe send a blank
email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
// Get the version of NT.
if ((gNtChecked = PsGetVersion(&gNtMajorVersion, &gNtMinorVersion, NULL,
NULL)) == TRUE)
{
KdPrint((“MESSAGE: Running under the checked build.\n”));
}
// Check version of NT.
if (gNtMajorVersion < 3)
{
// Can not support majors versions that are less than 3.
KdPrint((“ERROR: Unsupported major version of NT %x\n”,
gNtMajorVersion));
return STATUS_DRIVER_UNABLE_TO_LOAD;
}
if (gNtMajorVersion == 3 && gNtMinorVersion < 51)
{
// Can not support minor versions of 3 that are less than 5.1.
KdPrint((“ERROR: Unsupported minor version of NT %x\n”,
gNtMinorVersion));
return STATUS_DRIVER_UNABLE_TO_LOAD;
}
if (gNtMajorVersion >= 5)
{
// Load up some pointers for compatibilty.
PoCallDriver = KmGetProcAddress(“ntoskrnl.exe”, “PoCallDriver”);
PoStartNextPowerIrp = KmGetProcAddress(“ntoskrnl.exe”,
“PoStartNextPowerIrp”);
// One last check.
if (PoCallDriver == NULL || PoStartNextPowerIrp == NULL)
{
// Can’t get Power functions. Must fail to load.
KdPrint((“ERROR: Can’t get Power functions\n”));
return STATUS_DRIVER_UNABLE_TO_LOAD;
}
}
So, I suspect if you know the version numbers where XP starts, it is an
easy task.
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Chin Ng
Sent: Tuesday, May 29, 2001 10:53 AM
To: NT Developers Interest List
Subject: [ntdev] How to determine Windows Version in a disk filter
driver?
Dear all:
I am writing a disk class filter driver. I need to
distinguish if I am running Windows 2000 or Windows XP
in the DriverEntry routine. I’ve tried to query, using
RtlQueryRegistryValue, the key:
\registry\machine\Software\Microsoft\Windows
NT\CurrentVersion\CurentBuildNumber, but it returns
status code 34. Apparentlly, I can’t query anything
under the microsoft registry key.
Can someone tell are there any other ways which can
tell what os that I am running with?
Thanks,
Chin Wu
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Just use the function PsGetVersion or RtlGetVersion.
-Eliyas
-----Original Message-----
From: Chin Ng [mailto:xxxxx@yahoo.com]
Sent: Tuesday, May 29, 2001 10:53 AM
To: NT Developers Interest List
Subject: [ntdev] How to determine Windows Version in a disk filter
driver?
Dear all:
I am writing a disk class filter driver. I need to
distinguish if I am running Windows 2000 or Windows XP
in the DriverEntry routine. I’ve tried to query, using
RtlQueryRegistryValue, the key:
\registry\machine\Software\Microsoft\Windows
NT\CurrentVersion\CurentBuildNumber, but it returns
status code 34. Apparentlly, I can’t query anything
under the microsoft registry key.
Can someone tell are there any other ways which can
tell what os that I am running with?
Thanks,
Chin Wu
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com