xxxxx@msn.com wrote:
Yes, it specifies it to MAKEFILE.NEW. It does not specify it to your
code.
That is up to you.
Do you mean to imply that you can (and *reasonably* can, in terms of how
you would go about using the build system) specify you are building say
a kernel mode static library, and then go off and use that code in user-
mode?
Go read MAKEFILE.NEW. It is fascinatingly educational. The distinction
between LIBRARY and DRIVER_LIBRARY is what you are somehow expecting ‘help’
from.
Yes.
The distinction is really quite small. Indeed, 1/3 of the way
through the file, MAKEFILE.NEW just morfs TARGETTYPE of DRIVER_LIBRARY into
TARGETTYPE of LIBRARY. About the only thing that it did beforehand was to
add the DDK includes and set CBSTRING=-cbstring (for reasons I don’t care to
go figure out).
(Rhetorical question) So why does TARGETTYPE even *have* a difference
between the two?
I will look at MAKEFILE.NEW in the morning and see what I find.
Taken to an even further extreme, the ‘little cousin’ OS Windows CE
actually
runs drivers in UM. Here there are driver build environments like NDIS that
build just like KM code yet are actually UM.
What I am after is knowing which platform I am building on, for example
which set of header files I will be including. In that sense, the issue
isn’t an issue.
It’s not like it cannot be done (in fact, it is trivially easy). Your
issue
seems to be that ‘somebody’ did not anticipate your expectation as being
higher priority and not do it your way. Oh well.
No. You are projecting on to me.
I don’t have an issue, not in the way you think.
I think what is happening is wrong. I think this because it seems so to
me, by my standards of what I would expect a sane compiler to perform.
I may be wrong, but I get the impression you, ah, seem to picture me
here with a pout on my face having a little tantrum.
I have a USER_C_FLAGS and it works. Problem solved in an acceptable
manner. I still of course think what is happening is technically
incorrect.
And as far as the size of the objects go - I suspect you will find that the
library has a rather full complement of FORCEINLINE functions embedded in
it.
It has a few, yes. But why would these cause obesity in a kernel-mode
build and not in a user-mode build? the two builds are identical,
except that the abstraction function for aligned memory allocation in
the user-mode build is calling _aligned_malloc() and in the kernel-mode
build, ExAllocatePoolWithTag() (and similarly for the abstraction
function to free).
But then again, why would it matter as long as it links correctly.
It’s reasonable when noticing that kernel-mode object files are ten
times the size of user-mode, for identical code, to be concerned it
indicates a problem or mistake somewhere.
Right, eye-drops have dried, time for the second lot and back to bed