I’m using WDK 6001 to build a single driver binary that runs on Windows 2000 and later systems. I intend to limit the Windows 2000 support to machines that have had the Rollup 1 applied.
I want to link with IoEnumerateDeviceObjectList() and have the loader resolve it for me. It’s fine if it fails – that only means the system hasn’t had Rollup 1 applied and so I don’t support the current system patch level.
However, using WDK 6001, I am unable to reference that function and complete the linker step of the build process. This begs the question: Which service pack level does 6001 correspond to?
Perhaps the only solution is to not use the Windows 2000 build environment?
I’m using WDK 6001 to build a single driver binary that runs on Windows 2000
and later systems. I intend to limit the Windows 2000 support to machines
that have had the Rollup 1 applied.
I want to link with IoEnumerateDeviceObjectList() and have the loader
resolve it for me. It’s fine if it fails – that only means the system
hasn’t had Rollup 1 applied and so I don’t support the current system patch
level.
However, using WDK 6001, I am unable to reference that function and complete
the linker step of the build process. This begs the question: Which service
pack level does 6001 correspond to?
Perhaps the only solution is to not use the Windows 2000 build environment?
Yes, that’s the easy solution and what I am currently doing. But it’s entirely unnecessary since I don’t intend for the driver to load and execute on systems that do not have the function.
Any idea about the service pack level of WDK 6001, Windows 2000 build environment? Does it correspond to Windows 2000 RTM?
Yes, that’s the easy solution and what I am currently doing. But it’s
entirely unnecessary since I don’t intend for the driver to load and execute
on systems that do not have the function.
Any idea about the service pack level of WDK 6001, Windows 2000 build
environment? Does it correspond to Windows 2000 RTM?
I *think* the WDK always targets the last service pack available at
the time the WDK is released. The driver will load on all versions
though, so you *NEED* to do that check anyway.
My understanding is the driver will not load if a function in the import table is not present on the current system. At least, that’s how it is in user mode. It doesn’t make sense to load with NULL pointers in the import address table.
I am sticking with the resolve-at-runtime approach for now, but it adds a (in that module) global variable and additional calls into that subsystem during initialization…
wrote in message news:xxxxx@ntdev… > I’m using WDK 6001 to build a single driver binary that runs on Windows > 2000 and later systems. I intend to limit the Windows 2000 support to > machines that have had the Rollup 1 applied. > > I want to link with IoEnumerateDeviceObjectList() and have the loader > resolve it for me. It’s fine if it fails – that only means the system > hasn’t had Rollup 1 applied and so I don’t support the current system > patch level. > > However, using WDK 6001, I am unable to reference that function and > complete the linker step of the build process. This begs the question: > Which service pack level does 6001 correspond to? > > Perhaps the only solution is to not use the Windows 2000 build > environment? > > Regards, Otto
Declaration of IoEnumerateDeviceObjectList (ntifs.h) is braced in #if (NTDDI_VERSION >= NTDDI_WINXP)
If win2000 SP4 indeed has this API, this is a bit of problem for you. Try to workaround it in some way.
IMHO one can hope at most for a notice in WDK documentation for this issue.
wrote in message news:xxxxx@ntdev… > Thank you for replies. > > My understanding is the driver will not load if a function in the import > table is not present on the current system. At least, that’s how it is in > user mode. It doesn’t make sense to load with NULL pointers in the import > address table. > > I am sticking with the resolve-at-runtime approach for now, but it adds a > (in that module) global variable and additional calls into that subsystem > during initialization…
> wrote in message news:xxxxx@ntdev… > > I’m using WDK 6001 to build a single driver binary that runs on Windows > > 2000 and later systems. I intend to limit the Windows 2000 support to > > machines that have had the Rollup 1 applied. > > > > I want to link with IoEnumerateDeviceObjectList() and have the loader > > resolve it for me. It’s fine if it fails – that only means the system > > hasn’t had Rollup 1 applied and so I don’t support the current system > > patch level. > > > > However, using WDK 6001, I am unable to reference that function and > > complete the linker step of the build process. This begs the question: > > Which service pack level does 6001 correspond to? > > > > Perhaps the only solution is to not use the Windows 2000 build > > environment? > > > > Regards, Otto > > Declaration of IoEnumerateDeviceObjectList (ntifs.h) is braced in > #if (NTDDI_VERSION >= NTDDI_WINXP) > > If win2000 SP4 indeed has this API, this is a bit of problem for you. > Try to workaround it in some way. > > IMHO one can hope at most for a notice in WDK documentation for this issue. > > – pa
No need to declare the UNICODE_STRING s as static, that wastes global storage. Why not do this?
if ( ! pIoEnumerateDeviceObjectList ) {
UNICODE_STRING s = RTL_CONSTANT_STRING(L"IoEnumerateDeviceObjectList");
pIoEnumerateDeviceObjectList = MmGetSystemRoutineAddress(&s);
}
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Pavel A.
Sent: Friday, October 01, 2010 7:49 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] WDK 6001 service pack level
wrote in message news:xxxxx@ntdev… > Thank you for replies. > > My understanding is the driver will not load if a function in the > import table is not present on the current system. At least, that’s > how it is in user mode. It doesn’t make sense to load with NULL > pointers in the import address table. > > I am sticking with the resolve-at-runtime approach for now, but it > adds a (in that module) global variable and additional calls into that > subsystem during initialization…
“Don Burn” wrote in message news:xxxxx@ntdev… > Since the doc’s and the includes conflict including in the latest WDK, > this looks like one for the bug bash.
But WDK no longer supports win2k, so this is a non-issue? a doc bug at most? –pa
> > Don Burn (MVP, Windows DKD) > Windows Filesystem and Driver Consulting > Website: http://www.windrvr.com > Blog: http://msmvps.com/blogs/WinDrvr > > > > > “Pavel A.” wrote in message news:xxxxx@ntdev: > >> wrote in message news:xxxxx@ntdev… >> > I’m using WDK 6001 to build a single driver binary that runs on Windows >> > 2000 and later systems. I intend to limit the Windows 2000 support to >> > machines that have had the Rollup 1 applied. >> > >> > I want to link with IoEnumerateDeviceObjectList() and have the loader >> > resolve it for me. It’s fine if it fails – that only means the system >> > hasn’t had Rollup 1 applied and so I don’t support the current system >> > patch level. >> > >> > However, using WDK 6001, I am unable to reference that function and >> > complete the linker step of the build process. This begs the question: >> > Which service pack level does 6001 correspond to? >> > >> > Perhaps the only solution is to not use the Windows 2000 build >> > environment? >> > >> > Regards, Otto >> >> Declaration of IoEnumerateDeviceObjectList (ntifs.h) is braced in >> #if (NTDDI_VERSION >= NTDDI_WINXP) >> >> If win2000 SP4 indeed has this API, this is a bit of problem for you. >> Try to workaround it in some way. >> >> IMHO one can hope at most for a notice in WDK documentation for this >> issue. >> >> – pa > >
It only crashes under some edge cases, not in the majority of calls
d
dent from a phpne with no keynoard
-----Original Message-----
From: xxxxx@broadcom.com Sent: October 01, 2010 9:45 AM To: Windows System Software Devs Interest List Subject: RE:[ntdev] WDK 6001 service pack level
IIRC, MmGetSystemRoutineAddress would crash horribly in some earlier OS, if the export is not found. I don’t think it’s what you’d want.
In 6001.18002 you can get the image to compile if you link with wdmsec.lib
(or iointex.lib). This is more of a sleazy hack than an actual solution, but
it’s worth a shot considering the fact that you have absolutely zero chance
of getting ntoskrnl.lib fixed in the old kit.
wrote in message news:xxxxx@ntdev… > I’m using WDK 6001 to build a single driver binary that runs on Windows > 2000 and later systems. I intend to limit the Windows 2000 support to > machines that have had the Rollup 1 applied. > > I want to link with IoEnumerateDeviceObjectList() and have the loader > resolve it for me. It’s fine if it fails – that only means the system > hasn’t had Rollup 1 applied and so I don’t support the current system > patch level. > > However, using WDK 6001, I am unable to reference that function and > complete the linker step of the build process. This begs the question: > Which service pack level does 6001 correspond to? > > Perhaps the only solution is to not use the Windows 2000 build > environment? > > Regards, Otto >
Creating a ‘supplemental’ import library for the one routine you want seems
pretty straight forward an creating in MAKEFILE.INC with an inline DEF file
would be only a few lines of effort. The contents of the inline DEF file
could be conditioned on the build environment to only insert what you need
for WIN2K.
Maybe that is just as sleazy. It is pretty clear, however, what is going
on.
Good Luck,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Scott Noone
Sent: Friday, October 01, 2010 1:17 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] WDK 6001 service pack level
In 6001.18002 you can get the image to compile if you link with wdmsec.lib
(or iointex.lib). This is more of a sleazy hack than an actual solution, but
it’s worth a shot considering the fact that you have absolutely zero chance
of getting ntoskrnl.lib fixed in the old kit.
wrote in message news:xxxxx@ntdev… > I’m using WDK 6001 to build a single driver binary that runs on Windows > 2000 and later systems. I intend to limit the Windows 2000 support to > machines that have had the Rollup 1 applied. > > I want to link with IoEnumerateDeviceObjectList() and have the loader > resolve it for me. It’s fine if it fails – that only means the system > hasn’t had Rollup 1 applied and so I don’t support the current system > patch level. > > However, using WDK 6001, I am unable to reference that function and > complete the linker step of the build process. This begs the question: > Which service pack level does 6001 correspond to? > > Perhaps the only solution is to not use the Windows 2000 build > environment? > > Regards, Otto >
wrote in message news:xxxxx@ntdev… > IIRC, MmGetSystemRoutineAddress would crash horribly in some earlier OS, > if the export is not found. I don’t think it’s what you’d want. >
Yes. But, IIRC, in win2k SP4 it was fixed?
If the OP needs to support only SP4, the least sleazy hack is just copy the prototype of IoEnumerateDeviceObjectList from ntifs.h and not use MmGetSystemRoutineAddress at all. –pa
You still need the entry point in ntoskrnl.lib to make the linker happy.
d
dent from a phpne with no keynoard
-----Original Message-----
From: Pavel A. Sent: October 01, 2010 4:41 PM To: Windows System Software Devs Interest List Subject: Re:[ntdev] WDK 6001 service pack level
wrote in message news:xxxxx@ntdev… > IIRC, MmGetSystemRoutineAddress would crash horribly in some earlier OS, > if the export is not found. I don’t think it’s what you’d want. >
Yes. But, IIRC, in win2k SP4 it was fixed?
If the OP needs to support only SP4, the least sleazy hack is just copy the prototype of IoEnumerateDeviceObjectList from ntifs.h and not use MmGetSystemRoutineAddress at all. –pa
+1 regarding the solution for this particular case.
That being said, are you sure that MmGetSystemRoutineAddress() was fixed in
2ksp4, because it still exists in XP, at least through SP2, if memory serves
correctly. I don’t know the answer, but now you’ve got me curious.
mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pavel A.
Sent: Friday, October 01, 2010 7:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] WDK 6001 service pack level
wrote in message news:xxxxx@ntdev… > IIRC, MmGetSystemRoutineAddress would crash horribly in some earlier > OS, if the export is not found. I don’t think it’s what you’d want. >
Yes. But, IIRC, in win2k SP4 it was fixed?
If the OP needs to support only SP4, the least sleazy hack is just copy the prototype of IoEnumerateDeviceObjectList from ntifs.h and not use MmGetSystemRoutineAddress at all. –pa
“Doron Holan” wrote in message news:xxxxx@ntdev… > You still need the entry point in ntoskrnl.lib to make the linker happy. > > d > > dent from a phpne with no keynoard
Doron, you’re right as always. It is not in ntoskrnl.lib for win2k. So need to link with wdmsec.lib or iointex.lib as Scott N. suggested. – pa
> -----Original Message----- > From: Pavel A. > Sent: October 01, 2010 4:41 PM > To: Windows System Software Devs Interest List > Subject: Re:[ntdev] WDK 6001 service pack level > > > wrote in message news:xxxxx@ntdev… >> IIRC, MmGetSystemRoutineAddress would crash horribly in some earlier OS, >> if the export is not found. I don’t think it’s what you’d want. >> > > Yes. But, IIRC, in win2k SP4 it was fixed? > > If the OP needs to support only SP4, the least sleazy hack is just copy > the prototype of IoEnumerateDeviceObjectList from ntifs.h > and not use MmGetSystemRoutineAddress at all. > --pa > > > > — > NTDEV is sponsored by OSR > > For our schedule of WDF, WDM, debugging and other seminars visit: > http://www.osr.com/seminars > > To unsubscribe, visit the List Server section of OSR Online at > http://www.osronline.com/page.cfm?name=ListServer > >
As I recall, the MmGetSystemRoutineAddress problem only occurred if you
asked for a function that was lower than any existing function. The function
in question would not have hit the problem. The Cm functions could have. I
have used it without any problems in Windows 2000.
Bill Wandel
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of M. M. O’Brien
Sent: Friday, October 01, 2010 7:47 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] WDK 6001 service pack level
+1 regarding the solution for this particular case.
That being said, are you sure that MmGetSystemRoutineAddress() was fixed in
2ksp4, because it still exists in XP, at least through SP2, if memory serves
correctly. I don’t know the answer, but now you’ve got me curious.
mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pavel A.
Sent: Friday, October 01, 2010 7:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] WDK 6001 service pack level
wrote in message news:xxxxx@ntdev… > IIRC, MmGetSystemRoutineAddress would crash horribly in some earlier > OS, if the export is not found. I don’t think it’s what you’d want. >
Yes. But, IIRC, in win2k SP4 it was fixed?
If the OP needs to support only SP4, the least sleazy hack is just copy the prototype of IoEnumerateDeviceObjectList from ntifs.h and not use MmGetSystemRoutineAddress at all. –pa