WDK7 custom target path

Quite a lot, I would say. Clearly, the compiler and linker and libraries are far different – and that’s just the start. If you trust header versioning, then the headers are equivalent… but they are not identical.

I terms of folks asking for alternate sanctioned build environments: I have to say that I don’t understand the requests. There’s a supported way to build drivers, which is the way they build the OS. They provide us the tool chain for free. Don’t want to use it? Don’t. Create your own build system that works the way you prefer. But the onus is on you to be sure the resulting driver works. That strikes me as infinitely reasonable…

Peter
OSR

It may not be a must but having it defined causes the driver build to fail. Previous Win7 builds did not have this issue.
-Barry

----- Original Message ----
From: “xxxxx@microsoft.com
To: Windows System Software Devs Interest List
Sent: Monday, January 19, 2009 11:35:15 PM
Subject: RE:[ntdev] WDK7 custom target path

I would agree with you that the WDK Documentation hasn’t been updated for a long time in regard to already existing macros and environment variables. TARGETPATH is not a must.

Thanks for the constructive feedback!


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

Can someone explain the steps to have binplace put things in a simple
directory ala targetpath? For instance if I wanted to be one directory
higher with TARGETPATH I simply did

TARGETPATH=…$(_OBJ_DIR)

How would I do the same with Binplace. It looks like without invoking a
fair amount of magic binplace is going to place the stuff in the WDK root
(which is the last place any of my customers will approve, and most actually
write protect that area). So what steps does one need to do this.

Note: I am trying to get as close to the steps I have used for 15 years of:

  1. Go to the start menu and select a build environment you want
    (no custom changes here allowed)
  2. CD to the directory with the project
  3. Type build.

I already now have to add a step 1a, since OACR nor setenv will not provide
an environment variable so I can set it once in my environment variables and
forget it.

1a type “oacr stop”

And really don’t want add a lot more steps. Remember the more manual steps
the more mistakes, and the more variation on previous use the more mistakes.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Have you looked at BINPLACE? That will copy the resulting bins in whatever
dir you want independent of where the compiler generated the binary. Seems
to me you can just replace targetpath with it

Binplace will put things together in a folder relative to _NTTREE.

In WDK _NTTREE is defined as $(BASEDIR).binaries, so it is a completely separate folder then WDK root.

Example:

Source code in: c:\WinDDK\base\abc\project
TARGET_DESTINATION = customfolder
Output will result in: c:\WinDDK.binaries..\customfolder

Also, binplace is not meant to replace TARGETPATH. A good example for using Binplace is the Toaster sample. To build, install and run the Toaster virtual device you would need the toaster bus, the function driver, a filter if you want, maybe some exe, etc.

With Binplace the following line in your Toaster sample projects will put all files that you need together :
TARGET_DESTINATION = customfolder

plus - you can copy the co-installers and other files that you don’t currently build - all together, in a custom folder ready for testing or packaging.

Can you achieve this with TARGETPATH?

Also, what’s the point for you to redirect TARGETPATH here and there in your source tree, don’t you want to keep it clean?

TARGETPATH macro will be restored, but we’ll put some comments in the WDK documentation explaining why you should be careful with its usage.

Since I make immediately after the install the WDK directory read only, the
examples using binplace blow up. I do not care about my source tree having
binaries in it, I care about the WDK directory. I have worked in multiple
companies would terminate someone for writing in the tools/reference
directory, and have for close to 40 years have repeated to me "the first
step in quality is reproducibility, and one of the things to make the world
reproducible is do not mess with the tools directory.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

wrote in message news:xxxxx@ntdev…
> Binplace will put things together in a folder relative to _NTTREE.
>
> In WDK _NTTREE is defined as $(BASEDIR).binaries, so it is a completely
> separate folder then WDK root.
>
> Example:
>
> Source code in: c:\WinDDK\base\abc\project
> TARGET_DESTINATION = customfolder
> Output will result in: c:\WinDDK.binaries..\customfolder
>
> Also, binplace is not meant to replace TARGETPATH. A good example for
> using Binplace is the Toaster sample. To build, install and run the
> Toaster virtual device you would need the toaster bus, the function
> driver, a filter if you want, maybe some exe, etc.
>
> With Binplace the following line in your Toaster sample projects will put
> all files that you need together :
> TARGET_DESTINATION = customfolder
>
> plus - you can copy the co-installers and other files that you don’t
> currently build - all together, in a custom folder ready for testing or
> packaging.
>
> Can you achieve this with TARGETPATH?
>
> Also, what’s the point for you to redirect TARGETPATH here and there in
> your source tree, don’t you want to keep it clean?
>
> TARGETPATH macro will be restored, but we’ll put some comments in the WDK
> documentation explaining why you should be careful with its usage.
>
>

The _NTTREE is a directory different then WDK directory, so you can make WDK read only.

So if WDK is installed in:
c:\WinDDK<build number> - read only

Your destination for Binplace is:
c:\WinDDK..binaries

If you have a source code in C:\Foo and you specify:
TARGET_DESTINATION = custometarget

The binplaced binaries will go to:
C :\WinDDK..binaries.…\customfolder

But c:\WinDDK and every sub-folder is read only. The binaries need to be
placed in a completely different folder and possibly different drive.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of xxxxx@microsoft.com
Sent: Tuesday, January 20, 2009 12:19 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WDK7 custom target path

The _NTTREE is a directory different then WDK directory, so you can make WDK
read only.

So if WDK is installed in:
c:\WinDDK<build number> - read only

Your destination for Binplace is:
c:\WinDDK..binaries

If you have a source code in C:\Foo and you specify:
TARGET_DESTINATION = custometarget

The binplaced binaries will go to:
C :\WinDDK..binaries.…\customfolder


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

Sorry for the typo:

TARGET_DESTINATION = customfolder

You can always customize the _NTTREE in setenv.bat

But it is a good idea to have a way to set it - maybe as an input parameter to setenv.bat. This feedback will be considered for the next WDK release.

Thank you!

You do not understand, it is unacceptable to write anything under C:\WinDDK
or what ever location is used for the WDK. In one case in the past I put
this data on a drive, I kept read-only (with a hardware lock) except when I
added a new version of the DDK’s.

I know Microsoft uses Razzle and pulls down the whole environment, and then
mucks with it to the developers hearts content, but for many of us
particularally comming out of quality areas (such as fault tolerant systems)
such an approach is not only unacceptable it is a sign of incredbly poor
quality.

I know from reading the docs that Binplace can move things to other
directories than just under the BASEDIR of the WDK. I know that BINPLACE
was not intended to replace TARGETPATH but it has already been suggested in
this thread to use it in place of TARGETPATH. Yes, BINPLACE will do much
more, but my clients are looking for a way to get the same actions as if
they had TARGETPATH, without having to completely change their environment.
If there is not a way to do this, I suspect that many of them will not try
the beta, will not find bugs in the beta, and are likely to not even use
this version of the WDK when it is released.

Yes I know there is discussion of putting TARGETPATH back in, but I would
like people to use the current beta!


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

wrote in message news:xxxxx@ntdev…
> The _NTTREE is a directory different then WDK directory, so you can make
> WDK read only.
>
> So if WDK is installed in:
> c:\WinDDK<build number> - read only
>
> Your destination for Binplace is:
> c:\WinDDK..binaries
>
> If you have a source code in C:\Foo and you specify:
> TARGET_DESTINATION = custometarget
>
> The binplaced binaries will go to:
> C :\WinDDK..binaries.…\customfolder
>
>
>

Don,

c:\WinDDK..binaries is not a WDK folder.

It is concantanation of names “WinDDK..binaries”

Customizing setenv is as much of a NO NO for most clients are writing to the
WDK directory. This is why some of us also reacted so strongly against
OACR, the solutions documented for turning it off require modification of
files in the WDK directory, or having to remember to invoke a command every
time we bring up a build environment.

For the environment many of us use, think of everything in the WDK including
the start menu entries as being invoked from a CD-ROM you cannot change a
file, you cannot make a directory and you cannot in any way mess with the
contents Microsoft delivered.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> You can always customize the _NTTREE in setenv.bat
>
> But it is a good idea to have a way to set it - maybe as an input
> parameter to setenv.bat. This feedback will be considered for the next
> WDK release.
>
> Thank you!
>
>

c:\WinDDK is for every environment I work with, a place where nothing should
ever be changed.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> Don,
>
> c:\WinDDK..binaries is not a WDK folder.
>
> It is concantanation of names “WinDDK..binaries”
>

I think that using c:\winddk..binaries was a bad example.
c:\winddk..binaries is not the same as c:\Winddk. It looks
like _NTTREE can be set to anything.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of Don Burn
Sent: Tuesday, January 20, 2009 12:36 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] WDK7 custom target path

c:\WinDDK is for every environment I work with, a place where nothing should
ever be changed.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> Don,
>
> c:\WinDDK..binaries is not a WDK folder.
>
> It is concantanation of names “WinDDK..binaries”
>


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

Bill

How does one set it. It looks so far like the only way is to hack
setenv. That is not an acceptable solutuon in most companies.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Bill Wandel” wrote in message news:xxxxx@ntdev…
>I think that using c:\winddk..binaries was a bad example.
> c:\winddk..binaries is not the same as c:\Winddk. It looks
> like _NTTREE can be set to anything.
>
> Bill Wandel
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]
> On Behalf Of Don Burn
> Sent: Tuesday, January 20, 2009 12:36 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] WDK7 custom target path
>
> c:\WinDDK is for every environment I work with, a place where nothing
> should
> ever be changed.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>
>
> wrote in message news:xxxxx@ntdev…
>> Don,
>>
>> c:\WinDDK..binaries is not a WDK folder.
>>
>> It is concantanation of names “WinDDK..binaries”
>>
>
>
>
> —
> 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
>
>

Tanya,

How does one control the ‘drive’ on which this is placed?

This can go on and on and I for one would just like to say here is my short
list of ‘inputs’ and ‘outputs’ placement:

  1. The Tools (WDK) shall be deployable by ‘copy’ (no registry settings) and
    self-relative (can be copied to any sub-folder of the file system). [The
    Mark requirement]

  2. The Tools shall operate if all files are ‘read-only’ (like they might be
    by some SCM systems on checkout) or from a ‘read-only’ file system. [The
    Don requirement]

  3. The source code (input) shall be consumable from a ‘read-only’
    file-system. In other words, *all* intermediate output ought to be
    redirectable (and it may well be but I don’t know how to make the log-files
    and $O end up outside of the source tree yet).

  4. Any intermediate output or final output from a build shall be able to be
    directed to a file-system distinct from the Tools and Source files systems.
    [Another Don requirement]

  5. All the stuff I forgot that others will undoubtedly add…

Quite simply, I wish to have a tool-chain that can be version managed by my
SCM, not require that it be installed, not required that is (self)
modifiable, not require that the source file system is writeable, etc.

And on the ‘wish list’ would be having some rational way to have the source
tree separate from the ‘build control’ tree (where the
DIRS/SOURCES/MAKEFILE.XXX are).

Thanks,
-dave

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@microsoft.com
Sent: Tuesday, January 20, 2009 12:36 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WDK7 custom target path

Don,

c:\WinDDK..binaries is not a WDK folder.

It is concantanation of names “WinDDK..binaries”


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

Sure, Don, but the point is that “foo” and “foo.123” are different
directories. So, by naming the output directory something different
they’ve given you an alternative path.

I didn’t check to see if the current WDK insists on installing on the
system drive (admittedly, it WAS fun building a mount point, installing
it to a different volume and then using a separate drive letter. But
only from the perspective of “who thought this was a bright idea?”) But
if they want to build on “c:\winddk.7000.mumble” it shouldn’t pollute
anything in the “c:\winddk” directory, since it’s a different directory.
If you have the entire drive write-protected (as in your CD-ROM example)
then nothing short of using a completely separate path is going to work.

Ultimately, of course, it is their OS and their build environment. They
get to define how it will work and we can “deal with it.” It’s been
made abundantly clear over the years that the rank and file for the Base
OS group that interact with our community DO care, but the management
above them would really rather if we just shut up and didn’t bother them

  • after all, it’s not like we generate REVENUE for Microsoft. We’re
    just whiners, living off the table scraps they cast our way (it really
    would be a better business if it weren’t for all those pesky driver
    writers, after all.)

So, the answer to your customers may end up being “this is the way
Microsoft tells us to work. If you don’t like it, see (Microsoft’s)
Figure 1.”

Tony
OSR

Tony,

It may be they refer me to figure 1, but then I will say anyone who
uses binplace refer to figure 1. There is nothing in the tool according to
the documentation from allowing me to do what I want, but at present it
looks like a lot of custom stuff in a makefile.inc to achieve it. I was
hoping that since the recommended this as a replacement for TARGETPATH there
was a way without a big (and therefore likely to have bugs) set of changes
to use BINPLACE instead of TARGETPATH,


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

“Tony Mason” wrote in message news:xxxxx@ntdev…
Sure, Don, but the point is that “foo” and “foo.123” are different
directories. So, by naming the output directory something different
they’ve given you an alternative path.

I didn’t check to see if the current WDK insists on installing on the
system drive (admittedly, it WAS fun building a mount point, installing
it to a different volume and then using a separate drive letter. But
only from the perspective of “who thought this was a bright idea?”) But
if they want to build on “c:\winddk.7000.mumble” it shouldn’t pollute
anything in the “c:\winddk” directory, since it’s a different directory.
If you have the entire drive write-protected (as in your CD-ROM example)
then nothing short of using a completely separate path is going to work.

Ultimately, of course, it is their OS and their build environment. They
get to define how it will work and we can “deal with it.” It’s been
made abundantly clear over the years that the rank and file for the Base
OS group that interact with our community DO care, but the management
above them would really rather if we just shut up and didn’t bother them
- after all, it’s not like we generate REVENUE for Microsoft. We’re
just whiners, living off the table scraps they cast our way (it really
would be a better business if it weren’t for all those pesky driver
writers, after all.)

So, the answer to your customers may end up being “this is the way
Microsoft tells us to work. If you don’t like it, see (Microsoft’s)
Figure 1.”

Tony
OSR

Note that what has been missing here is the concept of “backward
compatibility” .

That is, BinPlace will do so much more. But this is not justification for
breaking all existing builds. So people who need the new features can use
them, and people who don’t need them don’t need to do anything special,
their builds keep running.

This is something that has to be kept in mind when such changes are
contemplated. Just because there is a *better* way to do things does not
justify making features that worked well (but may not have been nearly as
powerful) go away just because someone thought there was a need to make them
go away. So in principle, TARGETPATH= is simply defined as a way to get a
subset of the BinPlace functionality. When people complain that it can’t do
this-or-that, then they have reason to use the new technology.

In recent years, there has been a strange set of attitudes within Microsoft.
All kinds of weird kludges in the OS to allow, for example, old video games
to continue to work in spite of the fact that they actually contain serious
bugs that should never have been allowed to exist in the first place, but in
the developer world or Office world, it is felt acceptable to completely
break everything on a new release. Up to and including the user interface.

Apparently, only video game developers deserve backward compatibility, an
attitude which indicates either indifference or hostility to the Rest Of Us.
As someone who is both a developer and a user, but not a videogame player, I
feel I’m getting the short end of the stick in the only ways that matter to
me.

(I would love a feature in WinDbg that says “Never allow undocking”; I watch
new users try to use it and the undocking actively interferes with the
usability of this program. A messagebox popping up under an undocked window
is hard for them to identify, all they see is that the debugger has hung)
joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@microsoft.com
Sent: Tuesday, January 20, 2009 11:51 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WDK7 custom target path

Binplace will put things together in a folder relative to _NTTREE.

In WDK _NTTREE is defined as $(BASEDIR).binaries, so it is a completely
separate folder then WDK root.

Example:

Source code in: c:\WinDDK\base\abc\project TARGET_DESTINATION = customfolder
Output will result in: c:\WinDDK.binaries..\customfolder

Also, binplace is not meant to replace TARGETPATH. A good example for using
Binplace is the Toaster sample. To build, install and run the Toaster
virtual device you would need the toaster bus, the function driver, a filter
if you want, maybe some exe, etc.

With Binplace the following line in your Toaster sample projects will put
all files that you need together :
TARGET_DESTINATION = customfolder

plus - you can copy the co-installers and other files that you don’t
currently build - all together, in a custom folder ready for testing or
packaging.

Can you achieve this with TARGETPATH?

Also, what’s the point for you to redirect TARGETPATH here and there in your
source tree, don’t you want to keep it clean?

TARGETPATH macro will be restored, but we’ll put some comments in the WDK
documentation explaining why you should be careful with its usage.


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


This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

Thanks all for the feedback!

Binplace can do more, TARGETPATH will be restored. We will consider customizing the _NTTREE and intemediate output so they can be redirected as desired. Right now they are predefined in setenv.bat (_NTTREE and OBJECT_ROOT).