WDK RTM - will WDM driver built under the Vista build window run on XP?

hi

If I have an existing WDM 0x86 driver (it doesn’t have an WDF code in it) that was developed on the DDK, can I compile it in under the WDK Vista (x86) build once to generate a binary that runs on both Vista and XP machines?

Or do I need to build the driver in the WDK XP build window to build a binary to run on XP and then build it again under the WDK Vista build window to build another binary that runs on Vista?

Ideally, I’d like to only have to build it once.

I’m going to try it as well, but just want to make sure there aren’t any obvious issues.

thanks in advance

Nothing comes to mind (barring cases where you’re using something new to Vista, which wouldn’t be true, since this is an existing driver).

But it also isn’t necessary. The x86 driver built for XP would work on Vista, anyway.

You can use NT_TARGET_VERSION macros in a sources file to specify back-level compatibility from uplevel builds. But most of the compatibility problems I can remember at the moment were in user mode, not the kernel.

The guidelines are:

  1. Use the latest available kit (WDK is the latest one)
  2. Use the build environment for the earliest version of Windows you plan to support. This will create a binary of your driver compatible with all versions of Windows from that version forward.

In your case, if you use Windows XP build environment of WDK, the binary will be compatible with XP and newer versions (Server 2003, Vista). You don’t have to compile them for each individual version of Windows.

-Kumar

“S. Drasnin” wrote in message news:xxxxx@ntdev…
hi

If I have an existing WDM 0x86 driver (it doesn’t have an WDF code in it) that was developed on the DDK, can I compile it in under the WDK Vista (x86) build once to generate a binary that runs on both Vista and XP machines?

Or do I need to build the driver in the WDK XP build window to build a binary to run on XP and then build it again under the WDK Vista build window to build another binary that runs on Vista?

Ideally, I’d like to only have to build it once.

I’m going to try it as well, but just want to make sure there aren’t any obvious issues.

thanks in advance

S. Drasnin wrote:

If I have an existing WDM 0x86 driver (it doesn’t have an WDF code in
it) that was developed on the DDK, can I compile it in under the WDK
Vista (x86) build once to generate a binary that runs on both Vista
and XP machines?

Or do I need to build the driver in the WDK XP build window to build a
binary to run on XP and then build it again under the WDK Vista build
window to build another binary that runs on Vista?

Ideally, I’d like to only have to build it once.

If you build using the “Windows XP Build Environment” in the WDK, the
binary will run on XP and above. If you build using the “Windows 2000
Build Environment”, it will run on 2K and above.

If you build using the “Windows Vista Build Environment”, it will run on
XP as long as you haven’t used any Vista-only APIs.

I’ve already switched my KMDF project to the RTM WDK, and it is running
just fine on XP. It wasn’t even a hassle to use the new KMDF
co-installer. OK, it was a little bit of a hassle, because I had to
uninstall and reinstall the INF, but I have batch files to do that.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks everyone for the reply back.

Tim -in regard to your co-installer issue, I assume you are talking about running the KMDF under XP because of the need to install the new KMDF co-installer. Can you give more detail on what has to happen to do this under XP? (Does it involve pulling hair out?)

I assume that under Vista, you don’t have to deal with installing any co-installers or do anything else special, but if that’s not true, please let me know. I’m going to start using KMDF (too bad the OSR book on it isn’t out yet).

thanks

----- Original Message -----
From: Tim Robertsmailto:xxxxx
To: Windows System Software Devs Interest Listmailto:xxxxx
Sent: November 09, 2006 12:24 PM
Subject: Re: [ntdev] WDK RTM - will WDM driver built under the Vista build window run on XP?

S. Drasnin wrote:
>
> If I have an existing WDM 0x86 driver (it doesn’t have an WDF code in
> it) that was developed on the DDK, can I compile it in under the WDK
> Vista (x86) build once to generate a binary that runs on both Vista
> and XP machines?
>
> Or do I need to build the driver in the WDK XP build window to build a
> binary to run on XP and then build it again under the WDK Vista build
> window to build another binary that runs on Vista?
>
> Ideally, I’d like to only have to build it once.

If you build using the “Windows XP Build Environment” in the WDK, the
binary will run on XP and above. If you build using the “Windows 2000
Build Environment”, it will run on 2K and above.

If you build using the “Windows Vista Build Environment”, it will run on
XP as long as you haven’t used any Vista-only APIs.

I’ve already switched my KMDF project to the RTM WDK, and it is running
just fine on XP. It wasn’t even a hassle to use the new KMDF
co-installer. OK, it was a little bit of a hassle, because I had to
uninstall and reinstall the INF, but I have batch files to do that.


Tim Roberts, xxxxx@probo.commailto:xxxxx
Providenza & Boekelheide, Inc.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256http:

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServerhttp:</http:></http:></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

You should always provide the coinstaller for the KMDF version you built with any KMDF driver. No matter where you expect it to get installed.

S. Drasnin wrote:

Tim -in regard to your co-installer issue, I assume you are talking
about running the KMDF under XP because of the need to install the new
KMDF co-installer. Can you give more detail on what has to happen to
do this under XP? (Does it involve pulling hair out?)

It involved hair-pulling when I first did it, because I stubbornly
thought I didn’t need to follow the rules.

Just copy the co-installer sections from one of the KMDF sample INF
files (it’s only about 10 lines) and include wdfcoinstaller01005.dll
with your distribution. Nothing additional is required. All I had to
do to move from 3790.1830+KMDF to WDF was change wdfcoinstaller01001.dll
to wdfcoinstaller01005.dll, uninstall the old driver, and reinstall.

I assume that under Vista, you don’t have to deal with installing any
co-installers or do anything else special, but if that’s not
true, please let me know.

I don’t know whether the co-installer is included with Vista or not. It
doesn’t really change anything; we’ll have to include it with our driver
packages so that they can be used on XP. If the co-installer already
exists, either in-the-box or because it was installed by a previous
driver, the one in our package won’t be used.

I don’t really understand why the co-installer is needed, but it isn’t
that much of a burden.

I’m going to start using KMDF (too bad the OSR book on it isn’t out yet).

KMDF is a dream. The documentation is excellent, and the sample drivers
are enough to get you going.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>>

I don’t know whether the co-installer is included with Vista or not.

<<

No, it isn’t. While KMDF is used by many of the in-box drivers, they are “installed” without the coinstaller.

>I don’t really understand why the co-installer is needed, but it isn’t
that much of a burden.<<

I’ll try to take a swing at that [if it’s a miss, some of the other KMDF folks can surely do better]. The coinstaller’s purpose is to ensure that a version of KMDF that supports your driver is ready and waiting when the device installation is over. If an earlier version is present and in use, it replaces it with the required version, and tells the device manager you need a reboot (because the old version, still in memory, won’t run your driver). If a newer version or the one you need is already there, then it does nothing.

For the moment, you *could* install any KMDF driver on Vista without a coinstaller, but as you noted, the package wouldn’t work on anything earlier. Also, you may eventually go to some version from 1.6 to 1.999 (or 1.ZZZ if we’re still thinking about going that far), and then even on Vista you will want a coinstaller. So you should just always use it.

There may also be slight probability someone configures a Vista machine without KMDF [I don’t think this is feasible anymore, but at one point it was].