trouble with SOURCES

The tmh files should be included in the subdir / lib that generates
them.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Tuesday, August 29, 2006 10:12 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

So what about the issue of the the TMH files? How do I include those?
Thanks,
–Jeremy

Danilo Almeida wrote:

Jeremy,

The simplest way to achieve what you want is to build several static
libs
that you link together into a driver.

For example:

->Project
—>App (sources file here)
—>Driver
----->Reader (sources file here -> static lib)
----->Writer (sources file here -> static lib)
----->Utils (sources file here -> static lib)
----->Main (sources file here -> .sys)

Now, to simplify things, you can have a sources.inc file in some
directory
that contains the boilerplate that you want to include in the various
other
sources files. You can pull that in with !include.

Note is that the tools that MS provides to driver writers to build
device
drivers are what MS developers use to build Windows itself (including
all of
the user and kernel mode code).

I hope this helps.

  • Danilo

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

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

Dude… it obviously comes down to personal preference. You don’t like build cuz it won’t let you organize your project precisely the way you want to organize them. Whatever. The free utility that is apparently flexible enough to build every driver and application in the entire Windows operating system, isn’t flexible enough for you. So, OK, use something else and stop whining.

We’ve been through this all here before, as you know from reading the archives. Personally, I don’t have any problem with build. Personally, except for the fact that nmake (and hence build) is too f;ing stupid to understand path names with spaces, I think build is pretty clever. OTOH, I personally think VS in general and C++ in particular are total shite. Again… whatever.

Peter
OSR

David R. Cattley wrote:

Geez Tim, are we really insignificant? :slight_smile:

Oh, no, quite the contrary! The industry luminaries we encounter here
are the veritable pillars of the development community. However, our
NUMBERS are insignificant.

A colleague of mine was once introduced as a “fixture in the graphics
industry”. He wasn’t sure that was a compliment, since toilets are
usually described as “fixtures”.


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

I don’t understand why you need tmh file to link against your libraries.
TMH files are only for each .c /.cpp file. When static libraries are once built, TMH files are no longer necessary.

Executable files (.exe or .sys) only need its WPP_CONTROL_GUIDS to enable WPP in static libraries.

We use separate header files WPP control GUIDs to use static libraries in multiple executable files. Here is an example:

---- mylib.wpp.h

#define MYLIB_WPP_CONTROL_GUIDS \
WPP_DEFINES_CONTROL_GUID(MyLibTraceGuid,(…)) …

---- mysys.wpp.h

#define MYSYS_WPP_CONTROL_GUIDS \
WPP_DEFINES_CONTROL_GUID(MySysTraceGuid,(…)) …

---- trace.h (in mysys directory)

#include
#include

#define WPP_CONTROL_GUIDS <br> MYLIB_WPP_CONTROL_GUIDS <br> MYSYS_WPP_CONTROL_GUIDS

As for me, I like build.exe very much. It’s so powerful and good enough for us to build entire project (including all user-mode components) very efficiently. There are lots of requirements to use build.exe. But once we decided to use build.exe in ddk for all of our projects, we should adjust several project directory structures. Not the build itself but the consumer of build, are to be modified. I invested tons of hours in makefile.def and makefile.new to understand and to deploy in our projects. What lacks are some tools (like, and documentation in SOURCES, though, not the capabilities in build.exe.

Regards,

Chesong Lee

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Tuesday, August 29, 2006 1:12 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

So what about the issue of the the TMH files? How do I include those?
Thanks,
–Jeremy

Danilo Almeida wrote:
> Jeremy,
>
> The simplest way to achieve what you want is to build several static libs
> that you link together into a driver.
>
> For example:
>
> ->Project
> —>App (sources file here)
> —>Driver
> ----->Reader (sources file here -> static lib)
> ----->Writer (sources file here -> static lib)
> ----->Utils (sources file here -> static lib)
> ----->Main (sources file here -> .sys)
>
> Now, to simplify things, you can have a sources.inc file in some directory
> that contains the boilerplate that you want to include in the various other
> sources files. You can pull that in with !include.
>
> Note is that the tools that MS provides to driver writers to build device
> drivers are what MS developers use to build Windows itself (including all of
> the user and kernel mode code).
>
> I hope this helps.
>
> - Danilo
>
>


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

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

I think his complaint was that he wasn’t getting any tmh files for his
libraries. I checked my libraries that I build with tracing and they get
their tmh files, so I don’t know what his problem is. There are other issues
with libraries and ETW, but generating the tmh files has not been one for
me.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chesong Lee
Sent: Tuesday, August 29, 2006 5:24 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] trouble with SOURCES

I don’t understand why you need tmh file to link against your
libraries.
TMH files are only for each .c /.cpp file. When static
libraries are once built, TMH files are no longer necessary.

Executable files (.exe or .sys) only need its
WPP_CONTROL_GUIDS to enable WPP in static libraries.

We use separate header files WPP control GUIDs to use static
libraries in multiple executable files. Here is an example:

---- mylib.wpp.h

#define MYLIB_WPP_CONTROL_GUIDS \
WPP_DEFINES_CONTROL_GUID(MyLibTraceGuid,(…)) …

---- mysys.wpp.h

#define MYSYS_WPP_CONTROL_GUIDS \
WPP_DEFINES_CONTROL_GUID(MySysTraceGuid,(…)) …

---- trace.h (in mysys directory)

#include
> #include
>
> #define WPP_CONTROL_GUIDS <br>> MYLIB_WPP_CONTROL_GUIDS <br>> MYSYS_WPP_CONTROL_GUIDS
>
>
> As for me, I like build.exe very much. It’s so powerful and
> good enough for us to build entire project (including all
> user-mode components) very efficiently. There are lots of
> requirements to use build.exe. But once we decided to use
> build.exe in ddk for all of our projects, we should adjust
> several project directory structures. Not the build itself
> but the consumer of build, are to be modified. I invested
> tons of hours in makefile.def and makefile.new to understand
> and to deploy in our projects. What lacks are some tools
> (like, and documentation in SOURCES, though, not the
> capabilities in build.exe.
>
> Regards,
>
> Chesong Lee
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
> Sent: Tuesday, August 29, 2006 1:12 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] trouble with SOURCES
>
> So what about the issue of the the TMH files? How do I include those?
> Thanks,
> --Jeremy
>
>
> Danilo Almeida wrote:
> > Jeremy,
> >
> > The simplest way to achieve what you want is to build
> several static
> > libs that you link together into a driver.
> >
> > For example:
> >
> > ->Project
> > —>App (sources file here)
> > —>Driver
> > ----->Reader (sources file here -> static lib) Writer (sources file
> > ----->here -> static lib) Utils (sources file here ->
> static lib) Main
> > ----->(sources file here -> .sys)
> >
> > Now, to simplify things, you can have a sources.inc file in some
> > directory that contains the boilerplate that you want to include in
> > the various other sources files. You can pull that in with
> !include.
> >
> > Note is that the tools that MS provides to driver writers to build
> > device drivers are what MS developers use to build Windows itself
> > (including all of the user and kernel mode code).
> >
> > I hope this helps.
> >
> > - Danilo
> >
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online
> at http://www.osronline.com/page.cfm?name=ListServer
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online
> at http://www.osronline.com/page.cfm?name=ListServer
>

It turns out that I was missing a “localwpp.ini” file in my library
directories. This was causing the TMH file not to be generated. My
project started from the nonpnp sample, and I guess it uses some
extensions to WPP that make the file required??? I can’t remember if I
was this overwhelmed when I started programming win32 a decade ago, but
writing a driver is tough. It seems like there are so many rules and
gotcha’s, and no resources to explain what is going on from the bottom
up. I’ve found mountains of documentation that explain specific features
in great detail, but nothing that describes the relationships between
the features, or that build up the overall concepts starting from the
most basic level. I think I’ll be signing up for the Intro to Driver
Development OSR seminar in November.

–Jeremy

Mark Roddy wrote:

I think his complaint was that he wasn’t getting any tmh files for his
libraries. I checked my libraries that I build with tracing and they get
their tmh files, so I don’t know what his problem is. There are other issues
with libraries and ETW, but generating the tmh files has not been one for
me.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Chesong Lee
> Sent: Tuesday, August 29, 2006 5:24 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] trouble with SOURCES
>
>
> I don’t understand why you need tmh file to link against your
> libraries.
> TMH files are only for each .c /.cpp file. When static
> libraries are once built, TMH files are no longer necessary.
>
> Executable files (.exe or .sys) only need its
> WPP_CONTROL_GUIDS to enable WPP in static libraries.
>
> We use separate header files WPP control GUIDs to use static
> libraries in multiple executable files. Here is an example:
>
> ---- mylib.wpp.h
>
> #define MYLIB_WPP_CONTROL_GUIDS \
> WPP_DEFINES_CONTROL_GUID(MyLibTraceGuid,(…)) …
>
> ---- mysys.wpp.h
>
> #define MYSYS_WPP_CONTROL_GUIDS \
> WPP_DEFINES_CONTROL_GUID(MySysTraceGuid,(…)) …
>
> ---- trace.h (in mysys directory)
>
> #include
>> #include
>>
>> #define WPP_CONTROL_GUIDS <br>>> MYLIB_WPP_CONTROL_GUIDS <br>>> MYSYS_WPP_CONTROL_GUIDS
>>
>>
>> As for me, I like build.exe very much. It’s so powerful and
>> good enough for us to build entire project (including all
>> user-mode components) very efficiently. There are lots of
>> requirements to use build.exe. But once we decided to use
>> build.exe in ddk for all of our projects, we should adjust
>> several project directory structures. Not the build itself
>> but the consumer of build, are to be modified. I invested
>> tons of hours in makefile.def and makefile.new to understand
>> and to deploy in our projects. What lacks are some tools
>> (like, and documentation in SOURCES, though, not the
>> capabilities in build.exe.
>>
>> Regards,
>>
>> Chesong Lee
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
>> Sent: Tuesday, August 29, 2006 1:12 PM
>> To: Windows System Software Devs Interest List
>> Subject: Re:[ntdev] trouble with SOURCES
>>
>> So what about the issue of the the TMH files? How do I include those?
>> Thanks,
>> --Jeremy
>>
>>
>> Danilo Almeida wrote:
>>> Jeremy,
>>>
>>> The simplest way to achieve what you want is to build
>> several static
>>> libs that you link together into a driver.
>>>
>>> For example:
>>>
>>> ->Project
>>> —>App (sources file here)
>>> —>Driver
>>> ----->Reader (sources file here -> static lib) Writer (sources file
>>> ----->here -> static lib) Utils (sources file here ->
>> static lib) Main
>>> ----->(sources file here -> .sys)
>>>
>>> Now, to simplify things, you can have a sources.inc file in some
>>> directory that contains the boilerplate that you want to include in
>>> the various other sources files. You can pull that in with
>> !include.
>>> Note is that the tools that MS provides to driver writers to build
>>> device drivers are what MS developers use to build Windows itself
>>> (including all of the user and kernel mode code).
>>>
>>> I hope this helps.
>>>
>>> - Danilo
>>>
>>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online
>> at http://www.osronline.com/page.cfm?name=ListServer
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online
>> at http://www.osronline.com/page.cfm?name=ListServer
>>
>
>

> Geez Tim, are we really insignificant? :slight_smile:

-dc

No, quite the opposite – we are responsible for the majority (%70-%80?) of
BSODs out there!

Dmitriy Budko
VMware

No, it’s Microsoft. I doubt a properly designed OS should crash simply
because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?) of
BSODs out there!

Dmitriy Budko
VMware

>

No, quite the opposite – we are responsible for the majority
(%70-%80?)
of
BSODs out there!

Dmitriy Budko
VMware

My Power MAC never crashes. It never holds my screen, mouse
unresponsive. It has all the fancy 3D effects that Vista has long time
ago. I never have to re-install the OS… hence, I came to the
conclusion that the MAC driver developers must be way way smarter than
us.

Calvin Guan (DDK MVP)
Sr. Staff Engineer
NetXtreme NTX Miniport
Broadcom Corporation, Irvine CA 92618
Connecting Everything(r)

Calvin (Hao) Guan wrote:

> No, quite the opposite – we are responsible for the majority
(%70-%80?)
> of
> BSODs out there!
>
>
> Dmitriy Budko
> VMware

My Power MAC never crashes. It never holds my screen, mouse
unresponsive. It has all the fancy 3D effects that Vista has long time
ago. I never have to re-install the OS… hence, I came to the
conclusion that the MAC driver developers must be way way smarter than
us.

Did you actually turn it on?

Calvin Guan (DDK MVP)
Sr. Staff Engineer
NetXtreme NTX Miniport
Broadcom Corporation, Irvine CA 92618
Connecting Everything(r)


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

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


Ian Costello
SGI Australia

Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know that
the state of its structures and of the other drivers’ structures are
still correct? How do you know why the driver crashed? Is it b/c it
touched a random value? Or it was touching pool that it already freed,
corrupting somebody else’s data?

I more then happy to hear how you think a modern OS which loads all the
drivers in one address space (so let’s skip mach in this instance) can
achieve this.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Tuesday, August 29, 2006 8:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

No, it’s Microsoft. I doubt a properly designed OS should crash simply
because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?)
of
BSODs out there!

Dmitriy Budko
VMware


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

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

And just b/c I am feeling punchy…what modern OS continues to let a
“hello world” app run when it touches invalid memory or closes a bogus
handle value? Yes, you can wrap everything in SEH, but that just masks
your problems and gives you the tremendously false sense of still being
able to execute properly.

d

– I can spell, I just can’t type.

-----Original Message-----
From: Doron Holan
Sent: Tuesday, August 29, 2006 9:05 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] trouble with SOURCES

Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know that
the state of its structures and of the other drivers’ structures are
still correct? How do you know why the driver crashed? Is it b/c it
touched a random value? Or it was touching pool that it already freed,
corrupting somebody else’s data?

I more then happy to hear how you think a modern OS which loads all the
drivers in one address space (so let’s skip mach in this instance) can
achieve this.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Tuesday, August 29, 2006 8:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

No, it’s Microsoft. I doubt a properly designed OS should crash simply
because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?)
of
BSODs out there!

Dmitriy Budko
VMware


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

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

> > My Power MAC never crashes. It never holds my screen, mouse

> unresponsive. It has all the fancy 3D effects that Vista has long
time
> ago. I never have to re-install the OS… hence, I came to the
> conclusion that the MAC driver developers must be way way smarter
than
> us.

Did you actually turn it on?

Hey dude, you’ve got to be kidding… While at work, I use it to “remote
desktop” to my work machine to read email, build my Windows drivers on a
daily basis. The bad thing is there is no MAC version of Windbg.

Calvin Guan (DDK MVP)
Sr. Staff Engineer
NetXtreme NTX Miniport
Broadcom Corporation, Irvine CA 92618
Connecting Everything(r)

> From: Calvin (Hao) Guan

My Power MAC never crashes. It never holds my screen, mouse
unresponsive. It has all the fancy 3D effects that Vista has long time
ago. I never have to re-install the OS… hence, I came to the
conclusion that the MAC driver developers must be way way smarter than
us.

Do you have any third-party HW or device drivers installed on your Mac?

Dmitriy Budko
VMware

> From Doron Holan

Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know that
the state of its structures and of the other drivers’ structures are
still correct?

It doesn’t but it doesn’t have to produce BSOD/kernel panic. It can just kill
the thread/process. Windows kernel implements very rigid policy (BSOD)
instead of a configurable one (do nothing / try orderly reboot the system /
BSOD immediately). BTW, Linux (more-or-less modern OS) just kills the process
and the kernel makes a best-effort attempt to continue operation:
http://en.wikipedia.org/wiki/Linux_kernel_oops

Dmitriy Budko
VMware

Calvin (Hao) Guan wrote:

>> My Power MAC never crashes. It never holds my screen, mouse
>> unresponsive. It has all the fancy 3D effects that Vista has long
time
>> ago. I never have to re-install the OS… hence, I came to the
>> conclusion that the MAC driver developers must be way way smarter
than
>> us.
> Did you actually turn it on?
>

Hey dude, you’ve got to be kidding… While at work, I use it to “remote
desktop” to my work machine to read email, build my Windows drivers on a
daily basis. The bad thing is there is no MAC version of Windbg.

That is particularly fortunate for you. Unfortunately for the developers
here, this is not the experience I have seen through the different
revisions of MacOSX…

Then again I didn’t take into account the massive amount of hardware
that Apple actually supports ;). Just about all the 3rd party H/W and
S/W including drivers that Apple developed paniced the machines
(admittedly HBA based drivers) at some time… This is not including
the point releases of the OS which caused some interesting “things” to
occur.


Ian Costello
R&D Software Engineer
CXFS MultiOS - Windows Port
SGI Australia

I see, so let’s take this scenario. DriverEntry() is called on a work
item thread. The caller (IopLoadUnloadDriver) has state associated with
it that is only cleaned up on return from DriverEntry(). DriverEntry()
blows up and we kill the thread. All that state is gone. Let’s say
that state as associated with removing the PDRIVER_OBJECT from the
object directory on failed DriverEntry(), but now it is still in the
directoy. Next time we try to load the driver, we fail b/c we think the
driver is already loaded (b/c it is in the object tree).

Let’s say you are in the storage stack and you blow up during paging
i/o. Do you kill the entire FS thread, including the Mm pager? Will
you ever page again? What about resolving the pagein request in the
first place?

Let’s say the error occurred in an ISR. Do you kill the entire thread,
including the random context that the ISR is running in just b/c the ISR
touched invalid memory? What stops the ISR from doing the same thing on
each interrupt? Man, that means I can take down any app I want to
pretty damn fast (not to mention, all the apps pretty quickly as well).

…once things have gone wrong, you cannot definitively know your state.
This means the disk could be corrupted, the FS is in a wrong state and
will start trashing your data, etc etc. From a user perspective in
terms of data integrity, you want to limit what happens to their data.
Yes, a bluescreen causes some data loss. Continuing from a driver error
means that the current data is potentially corrupted and all future data
will be corrupted, just taking down more and more state as time goes on
until you are in a state where even continuing from the error is not
possible.

No thanks. I’ll take a glitch in my work and not worry about further
corruption vs. just marching fwd.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dmitriy Budko
Sent: Tuesday, August 29, 2006 9:53 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] trouble with SOURCES

From Doron Holan

Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know
that the state of its structures and of the other drivers’ structures
are still correct?

It doesn’t but it doesn’t have to produce BSOD/kernel panic. It can just
kill the thread/process. Windows kernel implements very rigid policy
(BSOD) instead of a configurable one (do nothing / try orderly reboot
the system / BSOD immediately). BTW, Linux (more-or-less modern OS) just
kills the process and the kernel makes a best-effort attempt to continue
operation:
http://en.wikipedia.org/wiki/Linux_kernel_oops

Dmitriy Budko
VMware


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

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

“Martin O’Brien” wrote in message
news:xxxxx@ntdev…
> JEREMY:
>
> As far as SOURCES/DIRS/BUILD goes, no you’ve got it right - it really,
> really sucks. To do what you wish you have three basic options:
>
> 1. The one you have already described
> 2. Include the .C/.CPP files from the folder in which you compile
> 3. Don’t use BUILD
>
> Personally, I think that people who chose (2) are insane, as it breaks
> basically every fundamental rule and/or convention governing separate
> compilation, and still results in a far from transparent hack to
> workaround around a build system.
>
> I’ve used something I’ve written (just a set of makefiles and a couple
> of perl scripts) for about seven years. As long as you check that the
> compiler and linker settings are still valid with each new DDK/WDK that
> you use, you shouldn’t have any trouble. The only nice feature of BUILD
> that gets lost here (assuming you use only CL, LINK, and NMAKE) is
> automatic dependency information.

Cant agree any more with it. GNU Make ( and its Windows port Mingw ) works
for me but it has its own restrictions.
Particularly the topic of recursive build can be a hairy one that modern
build systems
like Makepp/ JAM do better at. The topic of contention being do you
createprocess (make.exe or whatever your tool is )
once for each directory or do you include your sub directory Makefiles into
the parent makefile and run Make just once.
Apart from the createprocess overhead, continous directory recursion is bad
for build level parallelism.

I think in one of the replies somebody from Microsoft mentioned parallel
builds. I was not aware whether build.exe / nmake
is capable of parallel build / dependency tree walking capability. Or is it?

Anyways, I think build.exe is a good tool for small scale drivers and for
getting started project. But as the size of your driver increase
and you start having auto code/header/ Makefile generation, you ll need to
pull back with a traditional build system.

> I can’t help you with your second question (WPP), as I know nothing
> about it. I looked at it once, and decided that KdPrint was just fine.
>
> Good luck,
>
> MM
>
>
>
>>>> xxxxx@telestream.net 2006-08-28 17:56:02 >>>
> I would like to organize my driver source code into subdirectories
> based
> on the codes primary function and I’m having a lot of trouble. I’ve
> read
> through OSR Online, Google, and the DDK Docs and I’ve found that the
> only good way to do this is to make each subfolder a library, and then
>
> link them all together. First, I just want to say that I think this
> sucks. It is frustrating enough that I have to jump through so many
> hoops to just use basic C++, and then to add insult to injury, I can’t
>
> even organize my source files in an object oriented way. Has everyone
> just gotten used to the ridiculous restrictions in SOURCES files, or am
>
> I just missing out on some import concept?
>
> Anyway, enough ranting. My new problem is trying to include *.tmh files
>
> in my library. I tried adding the RUN_WPP code to my libraries SOURCES
>
> file, but nothing was generated. Should I try to include the *.tmh file
>
> from my parent project? How do I add the correct include path to my
> libraries SOURCES file?
>
> Thanks,
> --Jeremy
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Actually, build.exe supports parallel build and also quite scalable to large projects.

build.exe -M option specifies how many processors the build may use. Build.exe creates a child process for nmake.exe as many as specified/possible. Header and library dependencies are automatically checked in most cases (?). It also provides BUILD_{CONSUMES|PRODUCTES}, SYNCHRONIZE_{BLOCK|DRAIN} macros as synchronization primitives. See topics in “Building on a Multiprocessor Computer” in DDK help if you are interested.

As for other non traditional outputs (.exe or .sys), you can always directs to include your makefile.inc by specifying NTTARGETFILE{0,1,S} in SOURCES.

Another helpful hint is “project.mk”. In parent directories in your source tree, if “project.mk” is found, it is automatically included by makefile.def (defined in makefile.plt). You can define your project-wide nmake macros there such as library directories, common header directories, etc.

But lots of features are still undocumented and I hope that Microsoft provides more documentation, such as user-mode WPP, SIGNCODE_CMD, SXS, etc.

Regards,

Chesong Lee

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of bank kus
Sent: Wednesday, August 30, 2006 4:51 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

“Martin O’Brien” wrote in message
news:xxxxx@ntdev…
> JEREMY:
>
> As far as SOURCES/DIRS/BUILD goes, no you’ve got it right - it really,
> really sucks. To do what you wish you have three basic options:
>
> 1. The one you have already described
> 2. Include the .C/.CPP files from the folder in which you compile
> 3. Don’t use BUILD
>
> Personally, I think that people who chose (2) are insane, as it breaks
> basically every fundamental rule and/or convention governing separate
> compilation, and still results in a far from transparent hack to
> workaround around a build system.
>
> I’ve used something I’ve written (just a set of makefiles and a couple
> of perl scripts) for about seven years. As long as you check that the
> compiler and linker settings are still valid with each new DDK/WDK that
> you use, you shouldn’t have any trouble. The only nice feature of BUILD
> that gets lost here (assuming you use only CL, LINK, and NMAKE) is
> automatic dependency information.

Cant agree any more with it. GNU Make ( and its Windows port Mingw ) works
for me but it has its own restrictions.
Particularly the topic of recursive build can be a hairy one that modern
build systems
like Makepp/ JAM do better at. The topic of contention being do you
createprocess (make.exe or whatever your tool is )
once for each directory or do you include your sub directory Makefiles into
the parent makefile and run Make just once.
Apart from the createprocess overhead, continous directory recursion is bad
for build level parallelism.

I think in one of the replies somebody from Microsoft mentioned parallel
builds. I was not aware whether build.exe / nmake
is capable of parallel build / dependency tree walking capability. Or is it?

Anyways, I think build.exe is a good tool for small scale drivers and for
getting started project. But as the size of your driver increase
and you start having auto code/header/ Makefile generation, you ll need to
pull back with a traditional build system.

> I can’t help you with your second question (WPP), as I know nothing
> about it. I looked at it once, and decided that KdPrint was just fine.
>
> Good luck,
>
> MM
>
>
>
>>>> xxxxx@telestream.net 2006-08-28 17:56:02 >>>
> I would like to organize my driver source code into subdirectories
> based
> on the codes primary function and I’m having a lot of trouble. I’ve
> read
> through OSR Online, Google, and the DDK Docs and I’ve found that the
> only good way to do this is to make each subfolder a library, and then
>
> link them all together. First, I just want to say that I think this
> sucks. It is frustrating enough that I have to jump through so many
> hoops to just use basic C++, and then to add insult to injury, I can’t
>
> even organize my source files in an object oriented way. Has everyone
> just gotten used to the ridiculous restrictions in SOURCES files, or am
>
> I just missing out on some import concept?
>
> Anyway, enough ranting. My new problem is trying to include *.tmh files
>
> in my library. I tried adding the RUN_WPP code to my libraries SOURCES
>
> file, but nothing was generated. Should I try to include the *.tmh file
>
> from my parent project? How do I add the correct include path to my
> libraries SOURCES file?
>
> Thanks,
> --Jeremy
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


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

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

Cool - that’s the same policy that Windows 95 used to use. DOS too …
but then there was only one process.

:slight_smile:

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dmitriy Budko
Sent: Tuesday, August 29, 2006 9:53 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] trouble with SOURCES

From Doron Holan

Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know
that the state of its structures and of the other drivers’ structures
are still correct?

It doesn’t but it doesn’t have to produce BSOD/kernel panic. It can just
kill the thread/process. Windows kernel implements very rigid policy
(BSOD) instead of a configurable one (do nothing / try orderly reboot
the system / BSOD immediately). BTW, Linux (more-or-less modern OS) just
kills the process and the kernel makes a best-effort attempt to continue
operation:
http://en.wikipedia.org/wiki/Linux_kernel_oops

Dmitriy Budko
VMware


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

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