MmGetSystemRoutineAddress in Win 2K system

Hi All,

I wrote some code which uses IoGetDeviceAttachmentBaseRef API and the specific code is working fine (in XP), yesterday when a teammate tries to build that in 2K it gave him linker error. WDK docs says that this is available on W2K SP4 and onwards. I understand that the WIn2k libs included in WDK are not having this API and hence causing this linker error. So I decided to use MmGetSystemRoutineAddress to get a pointer.

I was all set when I just reached to these links stating that this DDI is broken,

http://www.osronline.com/article.cfm?article=494 and
http://www.osronline.com/showThread.cfm?link=101536

Now I am thinking of using RtlIsNtDdiVersionAvailable and than RtlIsServicePackVersionInstalled and if it is 2K sp4 or above than I will call MmGetSystemRoutineAddress for the desired API.

Actually I am amazed as I was not expecting too much information and the + and - on a simple topic like this. Is it a fine approach or is there exist a better alternative?

As I need to support all SP of WIN2K should I loop with IoGetLowerDeviceObject to reach the achieve same result as IoGetDeviceAttachmentBaseRef.

Thanks,
Aditya

Correction

*to reach the achieve same result as IoGetDeviceAttachmentBaseRef.

to achieve the same result as IoGetDeviceAttachmentBaseRef.

IoGetLowerDeviceObject is also supported from 2K SP4 only.