KMDF required for Vista certification?

Are you really saying that concern about the potential for problems with
DLL versioning and the related problem of installation are silly? If
so, I would encourage you to try to compile and run anything using the
newest versions of MSVCRT on a machine that does not have VS installed;
for example, a WinDbg extension based on the new CPP framework. In my
opinion, having to create a "Setup" project in VS (which I still
couldn't get to work) is not a reasonable alternative or tradeoff for
statically linking something. Or look at the thread a couple of weeks
ago about getting a KMDF driver installed and running, which, if I
recall correctly, started by the dev being assured that KMDF would
somehow be easier, and ended weeks later by his or her having to
manually delete the KMDF library before installing. For that matter,
take a look at the MSVCRT problem in pretty much any version of Windows
at any point in time. This includes such pleasures as
CRTDLL/MSVCRT20/MSVCRT40/MSVCRT, some of which had incorrect version
resources.

mm

>> xxxxx@synaptics.spamblock.com 2006-10-04 20:20:34 >>>
cristalink wrote:
The trouble is, kernel32 is present in 99.99% Windows installations,
while
KMDF must be redistributed, with all the hassles of installing it.

Microsoft could fix that problem tomorrow using Windows Update if they

wanted to... hmmm... why don't they? Of course, that wouldn't get to
that high a fraction, but people that don't get updates probably aren't

installing your driver either.

> They fix bugs in that thing all the time and that doesn't seem to
bother
> anyone.

Yeah, right. For me, bugs in Windows are the *major* source of
problems. I

Of course. What I meant was that many people complain that KMDF will
change out from under their driver the next time MS fixes a bug in it,

and that's why they want to statically link to it (because, the theory

goes, I guess, they've already SQA'd that version). They also complain

that they can't step through KMDF or analyze the source to figure out
what is wrong with their driver. I was merely saying that the rest of
Windows works that way too, what's special about this?

> They don't give you the source either, and that doesn't seem to
bother
> anyone.

Yes, it does.

Ok, fine... point made... but irrelevant to this discussion...

Ray
(If you want to reply to me off list, please remove "spamblock." from
my
email address)


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

True. But when it does happen, you can’t. Also, how recently was the
Recovery Console added? Before that, as in maybe for ten years, you
were SOL without the use of stuff from SysInternals, which is probably
what catalyzed RCs introduction in the first place. NTFS also has
repeatedly exhibited the pattern of (1) no worries, no need for concern,
nothing to see here (Disk Defragmenting); followed by (2) introduction
of a third party tool (ExecutiveSoftware) based on, it would appear, RE;
and finally by (3) the introduction of an API and a crippled MS
implementation (Disk Manager with its inability to handle page files,
MFT, et. c.). Its irritating.

>> xxxxx@gmail.com 2006-10-05 08:56:12 >>>
I felt the same way about NTFS vs FAT32 until I realized that
repairing it was seldom necessary with NTFS and frequently necessary
with FAT32. In fact, I can’t remember the last time I had to repair a
NTFS volume.

Beverly

On 10/5/06, David J. Craig wrote:
> I agree. I see something similar in that Vista requires (?) the use
of NTFS
> for the boot/system partition. I always prefer to use FAT32 for my
boot
> drive and all the partitions on it. I use NTFS for other drives to
get
> around the 4GB file size limit of FAT32. I can repair FAT32 with a
hex
> editor, while NTFS is not documented sufficiently to enable me to do
the
> same.
>
> wrote in message news:xxxxx@ntdev…
> >
> >
> > Arrrghh…
> >
> > For ME, it’s not about whether you like KMDF, or if it’s more like
> > kernel32 or MFC (though I really didn’t get that point), or whether
you
> > would trust Doron personally to write your driver or babysit your
kid.
> >
> > For ME, it’s not even about whether you think KMDF is a good tool.
I
> > think it 's a GREAT tool. Shit, let’s assume just for the sake of
argument
> > it’s inspired with Gxd-like qualities and it’s a PERFECT tool.
> >
> > For ME, it’s about every single dev in the community being told –
> > entirely arbitrarily – what tool they HAVE to use to accomplish a
job. I
> > just think that’s about 48 flavors of wrong. It’s about taking
away my
> > ability to make my own engineering decisions, and my company’s
ability to
> > make its own business decisions. It’s about telling me: “You’ve
got a
> > keyboard driver that works for Win2K and XP? That’s too bad for
you mate,
> > cuz you’ve gotta write a new one in KMDF that supports Vista and
your
> > company has to support them BOTH.”
> >
> > Let me reiterate: I’m not against using KMDF or UMDF. I have, in
actual
> > fact, chosen to use KMDF in every single (potentially applicable,
not
> > filesystems obviously) project that OSR has undertaken since even
BEFORE
> > KMDF’s release. I will continue to do so, because I believe in
the
> > technology and (yes) the people who build it.
> >
> > But tell me I have to use it? That makes me wanna do anything
but…
> >
> >
> >
> > P
> >
> >
>
>
>
> —
> 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

Martin O'Brien wrote:

Are you really saying that concern about the potential for problems with
DLL versioning and the related problem of installation are silly? If

I'm not saying that at all.

What I'm saying is that it's exactly as silly as worrying about the DLL
versioning issues of kernel32.dll, which gets patched too. No more, no
less. There's nothing special about KMDF in that regard.

Ray
(If you want to reply to me off list, please remove "spamblock." from my
email address)

I can’t really parse this paragraph, but I think Martin’s asking if I
think it would be all right for Microsoft to require you write your
drivers in WDM.

Depending on exactly what is meant by “WDM”, and exactly what kinds of
drivers you’re talking about, Microsoft has been requiring exactly that
for a long time, at least for drivers that you want them to certify.
Ummm, can’t say I’m all that unhappy… considering the alternatives…

What’s the point, exactly?

WHQL requires that you install your drivers using PnP methods rather
than patching the registry too (which you could do using lower-level,
but otherwise perfectly valid APIs)… is that equally offensive?

Martin O’Brien wrote:

My basic question to xxxxx@synaptics.com is, based on what he actually
quoted, how happy he or she would have been if Microsoft had made the
same stipulation requiring WDM? Its existence, and, in this sense, the
existence of KMDF itself, would seem to nullify arguments to the extent
that some of us are overreacting to the situation, as if it couldn’t
possibly occur, or even that is unlikely. It already has. I don’t mean
that critically, as that’s just part of the software development cycle,
until there exists stipulations that one must use it. As I see it, it is
a hard requirement, because “It’s not like Microsoft is saying you
*can’t* write a WDM mouse/keyboard driver, or even ship it to your
customers, they’re just saying that Microsoft doesn’t want to have
anything to do with it if you do” doesn’t, and shouldn’t mean anything
to them.

>>> xxxxx@cristalink.com 2006-10-04 19:48:14 >>>
> You don’t statically link to kernel32.dll either, but that doesn’t
seem to
> bother anyone

The trouble is, kernel32 is present in 99.99% Windows installations,
while
KMDF must be redistributed, with all the hassles of installing it.

> They fix bugs in that thing all the time and that doesn’t seem to
bother
> anyone.

Yeah, right. For me, bugs in Windows are the *major* source of
problems. I
can fix my own bugs, but I can’t fix Microsoft ones. And Microsoft
won’t fix
them either, at least within a reasonable time frame, say a year or
two. I
claim this based on my own experience in multiple cases.

> They don’t give you the source either, and that doesn’t seem to bother

> anyone.

Yes, it does.

“Ray Trent” wrote in message
> news:xxxxx@ntdev…
>> You know, when this requirement was first articulated, I pitched a
> big fit
>> for quite some time for a lot of the same reasons people have
> discussed
>> here.
>>
>> Then I calmed down and really thought about it.
>>
>> First of all, KMDF is nothing like MFC. They serve entirely
> different
>> purposes and accomplish their goals in entirely different ways. KMDF
> is
>> much more like “the way WDM should have been done in the first place,
>
>> because damn that thing is crufty and awful and way too complicated”.
>
>> Another way of looking at it is that KMDF is a lot more like NDIS.
>>
>> As for the “but we can’t statically link” argument: It’s part of the
> dang
>> OS. You don’t statically link to kernel32.dll either, but that
> doesn’t
>> seem to bother anyone (and think of what a nightmare that would
> be).
>> They fix bugs in that thing all the time and that doesn’t seem to
> bother
>> anyone. They don’t give you the source either, and that doesn’t seem
> to
>> bother anyone.
>>
>> Where was the huge outrage when Microsoft “hid” all the installation
>
>> details in UpdateDriverForPlugAndPlayDevices rather than “letting”
> driver
>> writers call the SetupAPI functions directly themselves?
>>
>> Sure, it’s new… but I suspect that a whole lot of kernel32.dll in
>
>> Vista is brand-spanking new too. At some level we have to trust MS to
> do
>> their job. Frankly, I know Doron reasonably well, and that gives me
> quite
>> a bit of confidence that KMDF is implemented as well if not better
> than
>> kernel32.dll was.
>>
>> I don’t know anything about SDIO or cellphone drivers, but as for
>> mice/keyboards, I very much doubt that anyone writing one of those is
>
>> doing anything really all that complicated WRT the stuff that KMDF is
>
>> “hiding”. And if they are, that’s probably a pretty big red flag
> (insert
>> sheepish admission that I had to figure out a few tricky ways around
> how
>> KMDF does things during our port because our driver was being
> “bad”).
>> It’s not like Microsoft is saying you can’t write a WDM
> mouse/keyboard
>> driver, or even ship it to your customers, they’re just saying that
>> Microsoft doesn’t want to have anything to do with it if you do. I
> don’t
>> really want to have anything to do with it either…
>>
>> Maxim S. Shatskih wrote:
>>> About KMDF. I’m very much worried about the amount of KMDF
> questions
>>> here
>>> on forums, most of which are due to a) people do not know WDM b)
> KMDF is
>>> source-less. Without the kind help of Doron, these people would be
> stuck.
>>> Note: MFC is provided with source, and KMDF to WDM is what is
> MFC to
>>> Win32.
>>> Also note: MFC does not free the person from knowing Win32
> itself,
>>> though
>>> yes, the need in Win32 knowledge with MFC is very small - only to
> solve
>>> the
>>> hard issues.
>>> Any framework provides an illusion that “now all complexities
> are
>>> solved”.
>>> Not so. The simple and streamlined things are done much easier, but,
> if
>>> the
>>> hard issue arises - then the framework complicates the things a lot,
> the
>>> person
>>> will need to know both the framework and the underlying platform.
>>>
>>>> without worrying about hidden locks, et. c. It seems to me that,
> if one
>>>> looks at the history of software failures, they have several things
> in
>>>> common, one of which is invariably the use of new and relatively
>>>> untested tool to attempt solve what generally boil down to
> personnel,
>>>> management and budgetary problems, the last of which is for the
> most
>>>> part intractable in many cases; i. e. - lack of dedicated resources
> for
>>>> testing. I think one of the major problems with any new tool, and,
> in
>>>> particular, mandating its use, is that its capabilities are
> evaluated by
>>>> its architects and original developers, and, in the process, some
> very
>>>> unattractive realities about the mistakes that the general public
> might
>>>> make, as well as poor decisions get ignored.
>>> Correct. If the bla-bla architect - or just business people -
> mandate
>>> some
>>> tool - then the chances of tool-based failure are very high. For
>>> instance - the
>>> user wants some feature, and the tool just crashes trying to
> implement
>>> it, as
>>> it was with ill memored PowerBuilder in mid 90ies.
>>>
>>>> case with C++ - that Bjarne was able to translate real C programs
> to C++
>>>> with only a 2% performance drop is nice, but not all that
> meaningful, as
>>>> most of us are neither geniuses nor original architects. That
> being
>>>> said, we are not incompetent, as neither probably were the people
> at
>>>> Mentor Graphics, or any of the others who led the early large scale
> C++
>>>> projects outside of Murray Hill Labs, almost all of which failed
>>> IIRC Borland did the first production C++ compiler in 1990, before
> this,
>>> only
>>> “cfront” existed. The first MS’s C++ compiler was IIRC 1992 or 1993,
>
>>> always a
>>> 32bit EXE itself - running under PharLap (PharLap embedded to the
> binary)
>>> on
>>> DOS, in virtual DOS machine under PharLap on Windows 3.x and as
> native PE
>>> in
>>> Windows 95/NT. This is how MSVC 1.5x worked.
>>>
>>> The UNIX and open-source people turned to C++ MUCH later then people
>
>>> working
>>> for DOS/Windows with Borland’s or MS’s tools.
>>>
>>> Maxim Shatskih, Windows DDK MVP
>>> StorageCraft Corporation
>>> xxxxx@storagecraft.com
>>> http://www.storagecraft.com
>>>
>>>
>> –
>> Ray
>> (If you want to reply to me off list, please remove “spamblock.” from
> my
>> email address)
>>
>
>
>
> —
> 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
>


Ray
(If you want to reply to me off list, please remove “spamblock.” from my
email address)

All I’m saying, albeit not very clearly, is that you yourself are saying
that WDM had problems, and I am wondering how you would feel if, instead
of KMDF, WDM was the requirement for the types of devices the KMDF is
now to support. My understanding is the one of the purposes of KMDF was
to, once again, simplify the code required to support Plug and Play and
Power Management, in, once again, and object oriented fashion. It seems
that the first attempt did not turn out to well, so, given this, I don’t
see why it is hard to understand why people are upset about a new
framework being required.

As for your point about Kernel32.DLL, I agree that, indeed, you must
trust Microsoft for some things. Fine. That argument, however, applies
equally well to the versioning issues I presented in other modules,
which, pretty clearly, really suck. Your picking a module that has
worked very well, and, perhaps, that will apply to KMDF. Perhaps not.
Kernel32 is an unavoidable requirement. KMDF is, as evidenced by the
fifteen years or so (or something like that) of NT history, quite
clearly, not. And to me, the bottom line is that requiring anything
really doesn’t mean bugs will just disappear, and, considering that one
can circumvent (by design) KMDF, and there is no source code for it, it
doesn’t mean that they will even improve. This same argument (that
using X will produce better results in and of itself) has been applied
to things like Visual Basic, every other 4GL in existence, Garbage
Collection, C++, eXtreme Programming, et. c., and none of them produce
that result, because it is impossible, and very, very few of them
actually were better overall.

>> xxxxx@synaptics.spamblock.com 2006-10-05 19:52:14 >>>
I can’t really parse this paragraph, but I think Martin’s asking if I
think it would be all right for Microsoft to require you write your
drivers in WDM.

Depending on exactly what is meant by “WDM”, and exactly what kinds of

drivers you’re talking about, Microsoft has been requiring exactly that

for a long time, at least for drivers that you want them to certify.
Ummm, can’t say I’m all that unhappy… considering the
alternatives…

What’s the point, exactly?

WHQL requires that you install your drivers using PnP methods rather
than patching the registry too (which you could do using lower-level,
but otherwise perfectly valid APIs)… is that equally offensive?

Martin O’Brien wrote:

My basic question to xxxxx@synaptics.com is, based on what he actually
quoted, how happy he or she would have been if Microsoft had made
the
same stipulation requiring WDM? Its existence, and, in this sense,
the
existence of KMDF itself, would seem to nullify arguments to the
extent
that some of us are overreacting to the situation, as if it couldn’t
possibly occur, or even that is unlikely. It already has. I don’t
mean
that critically, as that’s just part of the software development
cycle,
until there exists stipulations that one must use it. As I see it, it
is
a hard requirement, because “It’s not like Microsoft is saying you
*can’t* write a WDM mouse/keyboard driver, or even ship it to your
customers, they’re just saying that Microsoft doesn’t want to have
anything to do with it if you do” doesn’t, and shouldn’t mean
anything
to them.

>>> xxxxx@cristalink.com 2006-10-04 19:48:14 >>>
> You don’t statically link to kernel32.dll either, but that doesn’t
seem to
> bother anyone

The trouble is, kernel32 is present in 99.99% Windows installations,
while
KMDF must be redistributed, with all the hassles of installing it.

> They fix bugs in that thing all the time and that doesn’t seem to
bother
> anyone.

Yeah, right. For me, bugs in Windows are the *major* source of
problems. I
can fix my own bugs, but I can’t fix Microsoft ones. And Microsoft
won’t fix
them either, at least within a reasonable time frame, say a year or
two. I
claim this based on my own experience in multiple cases.

> They don’t give you the source either, and that doesn’t seem to
bother

> anyone.

Yes, it does.

“Ray Trent” wrote in message
> news:xxxxx@ntdev…
>> You know, when this requirement was first articulated, I pitched a
> big fit
>> for quite some time for a lot of the same reasons people have
> discussed
>> here.
>>
>> Then I calmed down and really thought about it.
>>
>> First of all, KMDF is nothing like MFC. They serve entirely
> different
>> purposes and accomplish their goals in entirely different ways.
KMDF
> is
>> much more like “the way WDM should have been done in the first
place,
>
>> because damn that thing is crufty and awful and way too
complicated”.
>
>> Another way of looking at it is that KMDF is a lot more like NDIS.
>>
>> As for the “but we can’t statically link” argument: It’s part of
the
> dang
>> OS. You don’t statically link to kernel32.dll either, but that
> doesn’t
>> seem to bother anyone (and think of what a nightmare that would
> be).
>> They fix bugs in that thing all the time and that doesn’t seem to
> bother
>> anyone. They don’t give you the source either, and that doesn’t
seem
> to
>> bother anyone.
>>
>> Where was the huge outrage when Microsoft “hid” all the
installation
>
>> details in UpdateDriverForPlugAndPlayDevices rather than “letting”
> driver
>> writers call the SetupAPI functions directly themselves?
>>
>> Sure, it’s new… but I suspect that a whole lot of kernel32.dll
in
>
>> Vista is brand-spanking new too. At some level we have to trust MS
to
> do
>> their job. Frankly, I know Doron reasonably well, and that gives me
> quite
>> a bit of confidence that KMDF is implemented as well if not better
> than
>> kernel32.dll was.
>>
>> I don’t know anything about SDIO or cellphone drivers, but as for
>> mice/keyboards, I very much doubt that anyone writing one of those
is
>
>> doing anything really all that complicated WRT the stuff that KMDF
is
>
>> “hiding”. And if they are, that’s probably a pretty big red flag
> (insert
>> sheepish admission that I had to figure out a few tricky ways
around
> how
>> KMDF does things during our port because our driver was being
> “bad”).
>> It’s not like Microsoft is saying you can’t write a WDM
> mouse/keyboard
>> driver, or even ship it to your customers, they’re just saying that

>> Microsoft doesn’t want to have anything to do with it if you do. I
> don’t
>> really want to have anything to do with it either…
>>
>> Maxim S. Shatskih wrote:
>>> About KMDF. I’m very much worried about the amount of KMDF
> questions
>>> here
>>> on forums, most of which are due to a) people do not know WDM b)
> KMDF is
>>> source-less. Without the kind help of Doron, these people would be
> stuck.
>>> Note: MFC is provided with source, and KMDF to WDM is what is
> MFC to
>>> Win32.
>>> Also note: MFC does not free the person from knowing Win32
> itself,
>>> though
>>> yes, the need in Win32 knowledge with MFC is very small - only to
> solve
>>> the
>>> hard issues.
>>> Any framework provides an illusion that “now all complexities
> are
>>> solved”.
>>> Not so. The simple and streamlined things are done much easier,
but,
> if
>>> the
>>> hard issue arises - then the framework complicates the things a
lot,
> the
>>> person
>>> will need to know both the framework and the underlying platform.
>>>
>>>> without worrying about hidden locks, et. c. It seems to me that,
> if one
>>>> looks at the history of software failures, they have several
things
> in
>>>> common, one of which is invariably the use of new and relatively
>>>> untested tool to attempt solve what generally boil down to
> personnel,
>>>> management and budgetary problems, the last of which is for the
> most
>>>> part intractable in many cases; i. e. - lack of dedicated
resources
> for
>>>> testing. I think one of the major problems with any new tool,
and,
> in
>>>> particular, mandating its use, is that its capabilities are
> evaluated by
>>>> its architects and original developers, and, in the process, some
> very
>>>> unattractive realities about the mistakes that the general public
> might
>>>> make, as well as poor decisions get ignored.
>>> Correct. If the bla-bla architect - or just business people -
> mandate
>>> some
>>> tool - then the chances of tool-based failure are very high. For
>>> instance - the
>>> user wants some feature, and the tool just crashes trying to
> implement
>>> it, as
>>> it was with ill memored PowerBuilder in mid 90ies.
>>>
>>>> case with C++ - that Bjarne was able to translate real C programs
> to C++
>>>> with only a 2% performance drop is nice, but not all that
> meaningful, as
>>>> most of us are neither geniuses nor original architects. That
> being
>>>> said, we are not incompetent, as neither probably were the people
> at
>>>> Mentor Graphics, or any of the others who led the early large
scale
> C++
>>>> projects outside of Murray Hill Labs, almost all of which failed
>>> IIRC Borland did the first production C++ compiler in 1990, before
> this,
>>> only
>>> “cfront” existed. The first MS’s C++ compiler was IIRC 1992 or
1993,
>
>>> always a
>>> 32bit EXE itself - running under PharLap (PharLap embedded to the
> binary)
>>> on
>>> DOS, in virtual DOS machine under PharLap on Windows 3.x and as
> native PE
>>> in
>>> Windows 95/NT. This is how MSVC 1.5x worked.
>>>
>>> The UNIX and open-source people turned to C++ MUCH later then
people
>
>>> working
>>> for DOS/Windows with Borland’s or MS’s tools.
>>>
>>> Maxim Shatskih, Windows DDK MVP
>>> StorageCraft Corporation
>>> xxxxx@storagecraft.com
>>> http://www.storagecraft.com
>>>
>>>
>> –
>> Ray
>> (If you want to reply to me off list, please remove “spamblock.”
from
> my
>> email address)
>>
>
>
>
> —
> 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
>


Ray
(If you want to reply to me off list, please remove “spamblock.” from
my
email address)


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

Not really. Requiring an INF file speaks to uniformity of user experience. Externally observable behavior. Customer expectations.

And THAT’s what Microsoft should be requiring: Proper driver behaviors. It seems to me that saying there are too many bugs in logo’ed drivers, so therefore you should write them using KMDF is placing the emphasis in the wrong place.

If the WHQL logo tests can’t weed out bad drivers, then there’s something very wrong with the tests. Why not FIX them? Make the tests much more rigorous?? THEN, they’ll have a better chance of catching bad drivers whether they’re written using WDM, KMDF, or they’re input in hex via the debugger.

Set a HIGH STANDARD for behavior and rigor. Make the logo MEAN something.

But requiring that I write my drivers a certain way? Silly and annoying…

P

>>the bottom line is that requiring anything really doesn’t mean bugs will

>just disappear

Below is I think a good example I received from a fellow developer the other
day.


Most of you have probably seen deprecation warnings on sprintf among other
things. It recommends you change to sprintf_s, which has an extra parameter
saying how long the buffer is.

What it doesn’t say is that it nulls out the entire contents of the buffer
beyond what you print.

EG: sprintf_s( buf, 500, “hello” );

This will write “hello” to the buffer, and then write 495 nulls. If you have
any code where you get the buffer size wrong, or sprintf to buf + 10 instead
of just buf (like me, when porting some existing code), then you may wipe
whatever memory happens to be past that buffer. It probably also applies to
most of the other ‘secure’ CRT _s versions of functions too.

Of course, I’m sure that the rest of you are far smarter than I and would
never make such a mistake as this, but consider this a heads up if you
weren’t aware :slight_smile:

“Martin O’Brien” wrote in message
news:xxxxx@ntdev…
> All I’m saying, albeit not very clearly, is that you yourself are saying
> that WDM had problems, and I am wondering how you would feel if, instead
> of KMDF, WDM was the requirement for the types of devices the KMDF is
> now to support. My understanding is the one of the purposes of KMDF was
> to, once again, simplify the code required to support Plug and Play and
> Power Management, in, once again, and object oriented fashion. It seems
> that the first attempt did not turn out to well, so, given this, I don’t
> see why it is hard to understand why people are upset about a new
> framework being required.
>
> As for your point about Kernel32.DLL, I agree that, indeed, you must
> trust Microsoft for some things. Fine. That argument, however, applies
> equally well to the versioning issues I presented in other modules,
> which, pretty clearly, really suck. Your picking a module that has
> worked very well, and, perhaps, that will apply to KMDF. Perhaps not.
> Kernel32 is an unavoidable requirement. KMDF is, as evidenced by the
> fifteen years or so (or something like that) of NT history, quite
> clearly, not. And to me, the bottom line is that requiring anything
> really doesn’t mean bugs will just disappear, and, considering that one
> can circumvent (by design) KMDF, and there is no source code for it, it
> doesn’t mean that they will even improve. This same argument (that
> using X will produce better results in and of itself) has been applied
> to things like Visual Basic, every other 4GL in existence, Garbage
> Collection, C++, eXtreme Programming, et. c., and none of them produce
> that result, because it is impossible, and very, very few of them
> actually were better overall.
>
>
>
>
>
>
>>>> xxxxx@synaptics.spamblock.com 2006-10-05 19:52:14 >>>
> I can’t really parse this paragraph, but I think Martin’s asking if I
> think it would be all right for Microsoft to require you write your
> drivers in WDM.
>
> Depending on exactly what is meant by “WDM”, and exactly what kinds of
>
> drivers you’re talking about, Microsoft has been requiring exactly that
>
> for a long time, at least for drivers that you want them to certify.
> Ummm, can’t say I’m all that unhappy… considering the
> alternatives…
>
> What’s the point, exactly?
>
> WHQL requires that you install your drivers using PnP methods rather
> than patching the registry too (which you could do using lower-level,
> but otherwise perfectly valid APIs)… is that equally offensive?
>
> Martin O’Brien wrote:
>> My basic question to xxxxx@synaptics.com is, based on what he actually
>> quoted, how happy he or she would have been if Microsoft had made
> the
>> same stipulation requiring WDM? Its existence, and, in this sense,
> the
>> existence of KMDF itself, would seem to nullify arguments to the
> extent
>> that some of us are overreacting to the situation, as if it couldn’t
>> possibly occur, or even that is unlikely. It already has. I don’t
> mean
>> that critically, as that’s just part of the software development
> cycle,
>> until there exists stipulations that one must use it. As I see it, it
> is
>> a hard requirement, because “It’s not like Microsoft is saying you
>> can’t write a WDM mouse/keyboard driver, or even ship it to your
>> customers, they’re just saying that Microsoft doesn’t want to have
>> anything to do with it if you do” doesn’t, and shouldn’t mean
> anything
>> to them.
>>
>>
>>
>>
>>
>>
>>>>> xxxxx@cristalink.com 2006-10-04 19:48:14 >>>
>>> You don’t statically link to kernel32.dll either, but that doesn’t
>> seem to
>>> bother anyone
>>
>> The trouble is, kernel32 is present in 99.99% Windows installations,
>> while
>> KMDF must be redistributed, with all the hassles of installing it.
>>
>>> They fix bugs in that thing all the time and that doesn’t seem to
>> bother
>>> anyone.
>>
>> Yeah, right. For me, bugs in Windows are the major source of
>> problems. I
>> can fix my own bugs, but I can’t fix Microsoft ones. And Microsoft
>> won’t fix
>> them either, at least within a reasonable time frame, say a year or
>> two. I
>> claim this based on my own experience in multiple cases.
>>
>>> They don’t give you the source either, and that doesn’t seem to
> bother
>>
>>> anyone.
>>
>> Yes, it does.
>>
>>
>>
>>
>> “Ray Trent” wrote in message
>> news:xxxxx@ntdev…
>>> You know, when this requirement was first articulated, I pitched a
>> big fit
>>> for quite some time for a lot of the same reasons people have
>> discussed
>>> here.
>>>
>>> Then I calmed down and really thought about it.
>>>
>>> First of all, KMDF is nothing like MFC. They serve entirely
>> different
>>> purposes and accomplish their goals in entirely different ways.
> KMDF
>> is
>>> much more like “the way WDM should have been done in the first
> place,
>>
>>> because damn that thing is crufty and awful and way too
> complicated”.
>>
>>> Another way of looking at it is that KMDF is a lot more like NDIS.
>>>
>>> As for the “but we can’t statically link” argument: It’s part of
> the
>> dang
>>> OS. You don’t statically link to kernel32.dll either, but that
>> doesn’t
>>> seem to bother anyone (and think of what a nightmare that would
>> be).
>>> They fix bugs in that thing all the time and that doesn’t seem to
>> bother
>>> anyone. They don’t give you the source either, and that doesn’t
> seem
>> to
>>> bother anyone.
>>>
>>> Where was the huge outrage when Microsoft “hid” all the
> installation
>>
>>> details in UpdateDriverForPlugAndPlayDevices rather than “letting”
>> driver
>>> writers call the SetupAPI functions directly themselves?
>>>
>>> Sure, it’s new… but I suspect that a whole lot of kernel32.dll
> in
>>
>>> Vista is brand-spanking new too. At some level we have to trust MS
> to
>> do
>>> their job. Frankly, I know Doron reasonably well, and that gives me
>> quite
>>> a bit of confidence that KMDF is implemented as well if not better
>> than
>>> kernel32.dll was.
>>>
>>> I don’t know anything about SDIO or cellphone drivers, but as for
>>> mice/keyboards, I very much doubt that anyone writing one of those
> is
>>
>>> doing anything really all that complicated WRT the stuff that KMDF
> is
>>
>>> “hiding”. And if they are, that’s probably a pretty big red flag
>> (insert
>>> sheepish admission that I had to figure out a few tricky ways
> around
>> how
>>> KMDF does things during our port because our driver was being
>> “bad”).
>>> It’s not like Microsoft is saying you can’t write a WDM
>> mouse/keyboard
>>> driver, or even ship it to your customers, they’re just saying that
>
>>> Microsoft doesn’t want to have anything to do with it if you do. I
>> don’t
>>> really want to have anything to do with it either…
>>>
>>> Maxim S. Shatskih wrote:
>>>> About KMDF. I’m very much worried about the amount of KMDF
>> questions
>>>> here
>>>> on forums, most of which are due to a) people do not know WDM b)
>> KMDF is
>>>> source-less. Without the kind help of Doron, these people would be
>> stuck.
>>>> Note: MFC is provided with source, and KMDF to WDM is what is
>> MFC to
>>>> Win32.
>>>> Also note: MFC does not free the person from knowing Win32
>> itself,
>>>> though
>>>> yes, the need in Win32 knowledge with MFC is very small - only to
>> solve
>>>> the
>>>> hard issues.
>>>> Any framework provides an illusion that “now all complexities
>> are
>>>> solved”.
>>>> Not so. The simple and streamlined things are done much easier,
> but,
>> if
>>>> the
>>>> hard issue arises - then the framework complicates the things a
> lot,
>> the
>>>> person
>>>> will need to know both the framework and the underlying platform.
>>>>
>>>>> without worrying about hidden locks, et. c. It seems to me that,
>> if one
>>>>> looks at the history of software failures, they have several
> things
>> in
>>>>> common, one of which is invariably the use of new and relatively
>>>>> untested tool to attempt solve what generally boil down to
>> personnel,
>>>>> management and budgetary problems, the last of which is for the
>> most
>>>>> part intractable in many cases; i. e. - lack of dedicated
> resources
>> for
>>>>> testing. I think one of the major problems with any new tool,
> and,
>> in
>>>>> particular, mandating its use, is that its capabilities are
>> evaluated by
>>>>> its architects and original developers, and, in the process, some
>> very
>>>>> unattractive realities about the mistakes that the general public
>> might
>>>>> make, as well as poor decisions get ignored.
>>>> Correct. If the bla-bla architect - or just business people -
>> mandate
>>>> some
>>>> tool - then the chances of tool-based failure are very high. For
>>>> instance - the
>>>> user wants some feature, and the tool just crashes trying to
>> implement
>>>> it, as
>>>> it was with ill memored PowerBuilder in mid 90ies.
>>>>
>>>>> case with C++ - that Bjarne was able to translate real C programs
>> to C++
>>>>> with only a 2% performance drop is nice, but not all that
>> meaningful, as
>>>>> most of us are neither geniuses nor original architects. That
>> being
>>>>> said, we are not incompetent, as neither probably were the people
>> at
>>>>> Mentor Graphics, or any of the others who led the early large
> scale
>> C++
>>>>> projects outside of Murray Hill Labs, almost all of which failed
>>>> IIRC Borland did the first production C++ compiler in 1990, before
>> this,
>>>> only
>>>> “cfront” existed. The first MS’s C++ compiler was IIRC 1992 or
> 1993,
>>
>>>> always a
>>>> 32bit EXE itself - running under PharLap (PharLap embedded to the
>> binary)
>>>> on
>>>> DOS, in virtual DOS machine under PharLap on Windows 3.x and as
>> native PE
>>>> in
>>>> Windows 95/NT. This is how MSVC 1.5x worked.
>>>>
>>>> The UNIX and open-source people turned to C++ MUCH later then
> people
>>
>>>> working
>>>> for DOS/Windows with Borland’s or MS’s tools.
>>>>
>>>> Maxim Shatskih, Windows DDK MVP
>>>> StorageCraft Corporation
>>>> xxxxx@storagecraft.com
>>>> http://www.storagecraft.com
>>>>
>>>>
>>> –
>>> Ray
>>> (If you want to reply to me off list, please remove “spamblock.”
> from
>> my
>>> email address)
>>>
>>
>>
>>
>> —
>> 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
>>
>
> –
> Ray
> (If you want to reply to me off list, please remove “spamblock.” from
> my
> email address)
>
> —
> 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
>

This is a good example.

>> xxxxx@cristalink.com 2006-10-05 21:58:48 >>>
>the bottom line is that requiring anything really doesn’t mean bugs
will
>just disappear

Below is I think a good example I received from a fellow developer the
other
day.


Most of you have probably seen deprecation warnings on sprintf among
other
things. It recommends you change to sprintf_s, which has an extra
parameter
saying how long the buffer is.

What it doesn’t say is that it nulls out the entire contents of the
buffer
beyond what you print.

EG: sprintf_s( buf, 500, “hello” );

This will write “hello” to the buffer, and then write 495 nulls. If you
have
any code where you get the buffer size wrong, or sprintf to buf + 10
instead
of just buf (like me, when porting some existing code), then you may
wipe
whatever memory happens to be past that buffer. It probably also
applies to
most of the other ‘secure’ CRT _s versions of functions too.

Of course, I’m sure that the rest of you are far smarter than I and
would
never make such a mistake as this, but consider this a heads up if you

weren’t aware :slight_smile:

“Martin O’Brien” wrote in message
news:xxxxx@ntdev…
> All I’m saying, albeit not very clearly, is that you yourself are
saying
> that WDM had problems, and I am wondering how you would feel if,
instead
> of KMDF, WDM was the requirement for the types of devices the KMDF
is
> now to support. My understanding is the one of the purposes of KMDF
was
> to, once again, simplify the code required to support Plug and Play
and
> Power Management, in, once again, and object oriented fashion. It
seems
> that the first attempt did not turn out to well, so, given this, I
don’t
> see why it is hard to understand why people are upset about a new
> framework being required.
>
> As for your point about Kernel32.DLL, I agree that, indeed, you must
> trust Microsoft for some things. Fine. That argument, however,
applies
> equally well to the versioning issues I presented in other modules,
> which, pretty clearly, really suck. Your picking a module that has
> worked very well, and, perhaps, that will apply to KMDF. Perhaps
not.
> Kernel32 is an unavoidable requirement. KMDF is, as evidenced by
the
> fifteen years or so (or something like that) of NT history, quite
> clearly, not. And to me, the bottom line is that requiring anything
> really doesn’t mean bugs will just disappear, and, considering that
one
> can circumvent (by design) KMDF, and there is no source code for it,
it
> doesn’t mean that they will even improve. This same argument (that
> using X will produce better results in and of itself) has been
applied
> to things like Visual Basic, every other 4GL in existence, Garbage
> Collection, C++, eXtreme Programming, et. c., and none of them
produce
> that result, because it is impossible, and very, very few of them
> actually were better overall.
>
>
>
>
>
>
>>>> xxxxx@synaptics.spamblock.com 2006-10-05 19:52:14 >>>
> I can’t really parse this paragraph, but I think Martin’s asking if
I
> think it would be all right for Microsoft to require you write your
> drivers in WDM.
>
> Depending on exactly what is meant by “WDM”, and exactly what kinds
of
>
> drivers you’re talking about, Microsoft has been requiring exactly
that
>
> for a long time, at least for drivers that you want them to certify.
> Ummm, can’t say I’m all that unhappy… considering the
> alternatives…
>
> What’s the point, exactly?
>
> WHQL requires that you install your drivers using PnP methods rather
> than patching the registry too (which you could do using
lower-level,
> but otherwise perfectly valid APIs)… is that equally offensive?
>
> Martin O’Brien wrote:
>> My basic question to xxxxx@synaptics.com is, based on what he
actually
>> quoted, how happy he or she would have been if Microsoft had made
> the
>> same stipulation requiring WDM? Its existence, and, in this
sense,
> the
>> existence of KMDF itself, would seem to nullify arguments to the
> extent
>> that some of us are overreacting to the situation, as if it
couldn’t
>> possibly occur, or even that is unlikely. It already has. I don’t
> mean
>> that critically, as that’s just part of the software development
> cycle,
>> until there exists stipulations that one must use it. As I see it,
it
> is
>> a hard requirement, because “It’s not like Microsoft is saying you
>> can’t write a WDM mouse/keyboard driver, or even ship it to your
>> customers, they’re just saying that Microsoft doesn’t want to have
>> anything to do with it if you do” doesn’t, and shouldn’t mean
> anything
>> to them.
>>
>>
>>
>>
>>
>>
>>>>> xxxxx@cristalink.com 2006-10-04 19:48:14 >>>
>>> You don’t statically link to kernel32.dll either, but that doesn’t
>> seem to
>>> bother anyone
>>
>> The trouble is, kernel32 is present in 99.99% Windows
installations,
>> while
>> KMDF must be redistributed, with all the hassles of installing it.
>>
>>> They fix bugs in that thing all the time and that doesn’t seem to
>> bother
>>> anyone.
>>
>> Yeah, right. For me, bugs in Windows are the major source of
>> problems. I
>> can fix my own bugs, but I can’t fix Microsoft ones. And Microsoft
>> won’t fix
>> them either, at least within a reasonable time frame, say a year or
>> two. I
>> claim this based on my own experience in multiple cases.
>>
>>> They don’t give you the source either, and that doesn’t seem to
> bother
>>
>>> anyone.
>>
>> Yes, it does.
>>
>>
>>
>>
>> “Ray Trent” wrote in message
>> news:xxxxx@ntdev…
>>> You know, when this requirement was first articulated, I pitched a
>> big fit
>>> for quite some time for a lot of the same reasons people have
>> discussed
>>> here.
>>>
>>> Then I calmed down and really thought about it.
>>>
>>> First of all, KMDF is nothing like MFC. They serve entirely
>> different
>>> purposes and accomplish their goals in entirely different ways.
> KMDF
>> is
>>> much more like “the way WDM should have been done in the first
> place,
>>
>>> because damn that thing is crufty and awful and way too
> complicated”.
>>
>>> Another way of looking at it is that KMDF is a lot more like NDIS.
>>>
>>> As for the “but we can’t statically link” argument: It’s part of
> the
>> dang
>>> OS. You don’t statically link to kernel32.dll either, but that
>> doesn’t
>>> seem to bother anyone (and think of what a nightmare that would
>> be).
>>> They fix bugs in that thing all the time and that doesn’t seem to
>> bother
>>> anyone. They don’t give you the source either, and that doesn’t
> seem
>> to
>>> bother anyone.
>>>
>>> Where was the huge outrage when Microsoft “hid” all the
> installation
>>
>>> details in UpdateDriverForPlugAndPlayDevices rather than “letting”
>> driver
>>> writers call the SetupAPI functions directly themselves?
>>>
>>> Sure, it’s new… but I suspect that a whole lot of kernel32.dll
> in
>>
>>> Vista is brand-spanking new too. At some level we have to trust MS
> to
>> do
>>> their job. Frankly, I know Doron reasonably well, and that gives
me
>> quite
>>> a bit of confidence that KMDF is implemented as well if not better
>> than
>>> kernel32.dll was.
>>>
>>> I don’t know anything about SDIO or cellphone drivers, but as for
>>> mice/keyboards, I very much doubt that anyone writing one of those
> is
>>
>>> doing anything really all that complicated WRT the stuff that KMDF
> is
>>
>>> “hiding”. And if they are, that’s probably a pretty big red flag
>> (insert
>>> sheepish admission that I had to figure out a few tricky ways
> around
>> how
>>> KMDF does things during our port because our driver was being
>> “bad”).
>>> It’s not like Microsoft is saying you can’t write a WDM
>> mouse/keyboard
>>> driver, or even ship it to your customers, they’re just saying
that
>
>>> Microsoft doesn’t want to have anything to do with it if you do. I
>> don’t
>>> really want to have anything to do with it either…
>>>
>>> Maxim S. Shatskih wrote:
>>>> About KMDF. I’m very much worried about the amount of KMDF
>> questions
>>>> here
>>>> on forums, most of which are due to a) people do not know WDM b)
>> KMDF is
>>>> source-less. Without the kind help of Doron, these people would
be
>> stuck.
>>>> Note: MFC is provided with source, and KMDF to WDM is what is
>> MFC to
>>>> Win32.
>>>> Also note: MFC does not free the person from knowing Win32
>> itself,
>>>> though
>>>> yes, the need in Win32 knowledge with MFC is very small - only to
>> solve
>>>> the
>>>> hard issues.
>>>> Any framework provides an illusion that “now all complexities
>> are
>>>> solved”.
>>>> Not so. The simple and streamlined things are done much easier,
> but,
>> if
>>>> the
>>>> hard issue arises - then the framework complicates the things a
> lot,
>> the
>>>> person
>>>> will need to know both the framework and the underlying platform.
>>>>
>>>>> without worrying about hidden locks, et. c. It seems to me
that,
>> if one
>>>>> looks at the history of software failures, they have several
> things
>> in
>>>>> common, one of which is invariably the use of new and relatively
>>>>> untested tool to attempt solve what generally boil down to
>> personnel,
>>>>> management and budgetary problems, the last of which is for the
>> most
>>>>> part intractable in many cases; i. e. - lack of dedicated
> resources
>> for
>>>>> testing. I think one of the major problems with any new tool,
> and,
>> in
>>>>> particular, mandating its use, is that its capabilities are
>> evaluated by
>>>>> its architects and original developers, and, in the process,
some
>> very
>>>>> unattractive realities about the mistakes that the general
public
>> might
>>>>> make, as well as poor decisions get ignored.
>>>> Correct. If the bla-bla architect - or just business people -
>> mandate
>>>> some
>>>> tool - then the chances of tool-based failure are very high. For
>>>> instance - the
>>>> user wants some feature, and the tool just crashes trying to
>> implement
>>>> it, as
>>>> it was with ill memored PowerBuilder in mid 90ies.
>>>>
>>>>> case with C++ - that Bjarne was able to translate real C
programs
>> to C++
>>>>> with only a 2% performance drop is nice, but not all that
>> meaningful, as
>>>>> most of us are neither geniuses nor original architects. That
>> being
>>>>> said, we are not incompetent, as neither probably were the
people
>> at
>>>>> Mentor Graphics, or any of the others who led the early large
> scale
>> C++
>>>>> projects outside of Murray Hill Labs, almost all of which failed
>>>> IIRC Borland did the first production C++ compiler in 1990,
before
>> this,
>>>> only
>>>> “cfront” existed. The first MS’s C++ compiler was IIRC 1992 or
> 1993,
>>
>>>> always a
>>>> 32bit EXE itself - running under PharLap (PharLap embedded to the
>> binary)
>>>> on
>>>> DOS, in virtual DOS machine under PharLap on Windows 3.x and as
>> native PE
>>>> in
>>>> Windows 95/NT. This is how MSVC 1.5x worked.
>>>>
>>>> The UNIX and open-source people turned to C++ MUCH later then
> people
>>
>>>> working
>>>> for DOS/Windows with Borland’s or MS’s tools.
>>>>
>>>> Maxim Shatskih, Windows DDK MVP
>>>> StorageCraft Corporation
>>>> xxxxx@storagecraft.com
>>>> http://www.storagecraft.com
>>>>
>>>>
>>> –
>>> Ray
>>> (If you want to reply to me off list, please remove “spamblock.”
> from
>> my
>>> email address)
>>>
>>
>>
>>
>> —
>> 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
>>
>
> –
> Ray
> (If you want to reply to me off list, please remove “spamblock.”
from
> my
> email address)
>
> —
> 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

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of xxxxx@osr.com[SMTP:xxxxx@osr.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, October 06, 2006 4:01 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] KMDF required for Vista certification?

If the WHQL logo tests can’t weed out bad drivers, then there’s something very wrong with the tests. Why not FIX them?

Because it is more work than just requiring KMDF?

Make the tests much more rigorous??

And invoke bugs in the OS itself? :wink: This is what I did with power tests. HCT S1/S3/S4 test was ridiculously slow and weak so I wrote my own and our QA use 100 - 1000x more power cycles for testing. They quickly started like some drivers, especially graphic ones, which can’t survive it :slight_smile:

On the other hand, recently I had to fix 4 years old bug related to power state change which never appeared during any test until one company made dual core computer with “proper” speed for race conditions I made there. On these machines probability of BSOD was about 30% under normal usage.

Almost all problems I met during past few years were caused by race conditions (both mine and OS). Race windows are usually very tight and I’m not sure if it is even possible to write a test which’d detect them automatically. It is of course possible to delay some functions to make necessary order but how to do it automatically when you don’t know what you’re trying to find? The result can be the same as automatic HCT IOCTL test i.e. totally useless. Also, some race conditions occur between hardware and software events (and OS USB stack suffers from it :-/).

THEN, they’ll have a better chance of catching bad drivers whether they’re written using WDM, KMDF, or they’re input in hex via the debugger.

I hate to say it but if both approaches are used at once, the results would be even better. I guess we can presume KMDF quality is better than old WDM samples which most developers modify. Still, I agree making KMDF mandatory is stupid and annoying.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

I have seen this style and even been guilty of it myself in the past.
However, you should use a define for the size that is shared with the
allocator and the other statements that need to know how big the buffer is.
This is also true for statically allocated buffers, but then you can use the
sizeof construct. You may have a different preference, but I think it is
more stable and lends itself to easier modification without having to worry
about not getting one place with the wrong value.

“cristalink” wrote in message news:xxxxx@ntdev…
>>>the bottom line is that requiring anything really doesn’t mean bugs will
>>>just disappear
>
> Below is I think a good example I received from a fellow developer the
> other day.
>
> --------
>
> Most of you have probably seen deprecation warnings on sprintf among other
> things. It recommends you change to sprintf_s, which has an extra
> parameter saying how long the buffer is.
>
> What it doesn’t say is that it nulls out the entire contents of the buffer
> beyond what you print.
>
> EG: sprintf_s( buf, 500, “hello” );
>
> This will write “hello” to the buffer, and then write 495 nulls. If you
> have any code where you get the buffer size wrong, or sprintf to buf + 10
> instead of just buf (like me, when porting some existing code), then you
> may wipe whatever memory happens to be past that buffer. It probably also
> applies to most of the other ‘secure’ CRT _s versions of functions too.
>
> Of course, I’m sure that the rest of you are far smarter than I and would
> never make such a mistake as this, but consider this a heads up if you
> weren’t aware :slight_smile:
>
>
>
> “Martin O’Brien” wrote in message
> news:xxxxx@ntdev…
>> All I’m saying, albeit not very clearly, is that you yourself are saying
>> that WDM had problems, and I am wondering how you would feel if, instead
>> of KMDF, WDM was the requirement for the types of devices the KMDF is
>> now to support. My understanding is the one of the purposes of KMDF was
>> to, once again, simplify the code required to support Plug and Play and
>> Power Management, in, once again, and object oriented fashion. It seems
>> that the first attempt did not turn out to well, so, given this, I don’t
>> see why it is hard to understand why people are upset about a new
>> framework being required.
>>
>> As for your point about Kernel32.DLL, I agree that, indeed, you must
>> trust Microsoft for some things. Fine. That argument, however, applies
>> equally well to the versioning issues I presented in other modules,
>> which, pretty clearly, really suck. Your picking a module that has
>> worked very well, and, perhaps, that will apply to KMDF. Perhaps not.
>> Kernel32 is an unavoidable requirement. KMDF is, as evidenced by the
>> fifteen years or so (or something like that) of NT history, quite
>> clearly, not. And to me, the bottom line is that requiring anything
>> really doesn’t mean bugs will just disappear, and, considering that one
>> can circumvent (by design) KMDF, and there is no source code for it, it
>> doesn’t mean that they will even improve. This same argument (that
>> using X will produce better results in and of itself) has been applied
>> to things like Visual Basic, every other 4GL in existence, Garbage
>> Collection, C++, eXtreme Programming, et. c., and none of them produce
>> that result, because it is impossible, and very, very few of them
>> actually were better overall.
>>
>>
>>
>>
>>
>>
>>>>> xxxxx@synaptics.spamblock.com 2006-10-05 19:52:14 >>>
>> I can’t really parse this paragraph, but I think Martin’s asking if I
>> think it would be all right for Microsoft to require you write your
>> drivers in WDM.
>>
>> Depending on exactly what is meant by “WDM”, and exactly what kinds of
>>
>> drivers you’re talking about, Microsoft has been requiring exactly that
>>
>> for a long time, at least for drivers that you want them to certify.
>> Ummm, can’t say I’m all that unhappy… considering the
>> alternatives…
>>
>> What’s the point, exactly?
>>
>> WHQL requires that you install your drivers using PnP methods rather
>> than patching the registry too (which you could do using lower-level,
>> but otherwise perfectly valid APIs)… is that equally offensive?
>>
>> Martin O’Brien wrote:
>>> My basic question to xxxxx@synaptics.com is, based on what he actually
>>> quoted, how happy he or she would have been if Microsoft had made
>> the
>>> same stipulation requiring WDM? Its existence, and, in this sense,
>> the
>>> existence of KMDF itself, would seem to nullify arguments to the
>> extent
>>> that some of us are overreacting to the situation, as if it couldn’t
>>> possibly occur, or even that is unlikely. It already has. I don’t
>> mean
>>> that critically, as that’s just part of the software development
>> cycle,
>>> until there exists stipulations that one must use it. As I see it, it
>> is
>>> a hard requirement, because “It’s not like Microsoft is saying you
>>> can’t write a WDM mouse/keyboard driver, or even ship it to your
>>> customers, they’re just saying that Microsoft doesn’t want to have
>>> anything to do with it if you do” doesn’t, and shouldn’t mean
>> anything
>>> to them.
>>>
>>>
>>>
>>>
>>>
>>>
>>>>>> xxxxx@cristalink.com 2006-10-04 19:48:14 >>>
>>>> You don’t statically link to kernel32.dll either, but that doesn’t
>>> seem to
>>>> bother anyone
>>>
>>> The trouble is, kernel32 is present in 99.99% Windows installations,
>>> while
>>> KMDF must be redistributed, with all the hassles of installing it.
>>>
>>>> They fix bugs in that thing all the time and that doesn’t seem to
>>> bother
>>>> anyone.
>>>
>>> Yeah, right. For me, bugs in Windows are the major source of
>>> problems. I
>>> can fix my own bugs, but I can’t fix Microsoft ones. And Microsoft
>>> won’t fix
>>> them either, at least within a reasonable time frame, say a year or
>>> two. I
>>> claim this based on my own experience in multiple cases.
>>>
>>>> They don’t give you the source either, and that doesn’t seem to
>> bother
>>>
>>>> anyone.
>>>
>>> Yes, it does.
>>>
>>>
>>>
>>>
>>> “Ray Trent” wrote in message
>>> news:xxxxx@ntdev…
>>>> You know, when this requirement was first articulated, I pitched a
>>> big fit
>>>> for quite some time for a lot of the same reasons people have
>>> discussed
>>>> here.
>>>>
>>>> Then I calmed down and really thought about it.
>>>>
>>>> First of all, KMDF is nothing like MFC. They serve entirely
>>> different
>>>> purposes and accomplish their goals in entirely different ways.
>> KMDF
>>> is
>>>> much more like “the way WDM should have been done in the first
>> place,
>>>
>>>> because damn that thing is crufty and awful and way too
>> complicated”.
>>>
>>>> Another way of looking at it is that KMDF is a lot more like NDIS.
>>>>
>>>> As for the “but we can’t statically link” argument: It’s part of
>> the
>>> dang
>>>> OS. You don’t statically link to kernel32.dll either, but that
>>> doesn’t
>>>> seem to bother anyone (and think of what a nightmare that would
>>> be).
>>>> They fix bugs in that thing all the time and that doesn’t seem to
>>> bother
>>>> anyone. They don’t give you the source either, and that doesn’t
>> seem
>>> to
>>>> bother anyone.
>>>>
>>>> Where was the huge outrage when Microsoft “hid” all the
>> installation
>>>
>>>> details in UpdateDriverForPlugAndPlayDevices rather than “letting”
>>> driver
>>>> writers call the SetupAPI functions directly themselves?
>>>>
>>>> Sure, it’s new… but I suspect that a whole lot of kernel32.dll
>> in
>>>
>>>> Vista is brand-spanking new too. At some level we have to trust MS
>> to
>>> do
>>>> their job. Frankly, I know Doron reasonably well, and that gives me
>>> quite
>>>> a bit of confidence that KMDF is implemented as well if not better
>>> than
>>>> kernel32.dll was.
>>>>
>>>> I don’t know anything about SDIO or cellphone drivers, but as for
>>>> mice/keyboards, I very much doubt that anyone writing one of those
>> is
>>>
>>>> doing anything really all that complicated WRT the stuff that KMDF
>> is
>>>
>>>> “hiding”. And if they are, that’s probably a pretty big red flag
>>> (insert
>>>> sheepish admission that I had to figure out a few tricky ways
>> around
>>> how
>>>> KMDF does things during our port because our driver was being
>>> “bad”).
>>>> It’s not like Microsoft is saying you can’t write a WDM
>>> mouse/keyboard
>>>> driver, or even ship it to your customers, they’re just saying that
>>
>>>> Microsoft doesn’t want to have anything to do with it if you do. I
>>> don’t
>>>> really want to have anything to do with it either…
>>>>
>>>> Maxim S. Shatskih wrote:
>>>>> About KMDF. I’m very much worried about the amount of KMDF
>>> questions
>>>>> here
>>>>> on forums, most of which are due to a) people do not know WDM b)
>>> KMDF is
>>>>> source-less. Without the kind help of Doron, these people would be
>>> stuck.
>>>>> Note: MFC is provided with source, and KMDF to WDM is what is
>>> MFC to
>>>>> Win32.
>>>>> Also note: MFC does not free the person from knowing Win32
>>> itself,
>>>>> though
>>>>> yes, the need in Win32 knowledge with MFC is very small - only to
>>> solve
>>>>> the
>>>>> hard issues.
>>>>> Any framework provides an illusion that “now all complexities
>>> are
>>>>> solved”.
>>>>> Not so. The simple and streamlined things are done much easier,
>> but,
>>> if
>>>>> the
>>>>> hard issue arises - then the framework complicates the things a
>> lot,
>>> the
>>>>> person
>>>>> will need to know both the framework and the underlying platform.
>>>>>
>>>>>> without worrying about hidden locks, et. c. It seems to me that,
>>> if one
>>>>>> looks at the history of software failures, they have several
>> things
>>> in
>>>>>> common, one of which is invariably the use of new and relatively
>>>>>> untested tool to attempt solve what generally boil down to
>>> personnel,
>>>>>> management and budgetary problems, the last of which is for the
>>> most
>>>>>> part intractable in many cases; i. e. - lack of dedicated
>> resources
>>> for
>>>>>> testing. I think one of the major problems with any new tool,
>> and,
>>> in
>>>>>> particular, mandating its use, is that its capabilities are
>>> evaluated by
>>>>>> its architects and original developers, and, in the process, some
>>> very
>>>>>> unattractive realities about the mistakes that the general public
>>> might
>>>>>> make, as well as poor decisions get ignored.
>>>>> Correct. If the bla-bla architect - or just business people -
>>> mandate
>>>>> some
>>>>> tool - then the chances of tool-based failure are very high. For
>>>>> instance - the
>>>>> user wants some feature, and the tool just crashes trying to
>>> implement
>>>>> it, as
>>>>> it was with ill memored PowerBuilder in mid 90ies.
>>>>>
>>>>>> case with C++ - that Bjarne was able to translate real C programs
>>> to C++
>>>>>> with only a 2% performance drop is nice, but not all that
>>> meaningful, as
>>>>>> most of us are neither geniuses nor original architects. That
>>> being
>>>>>> said, we are not incompetent, as neither probably were the people
>>> at
>>>>>> Mentor Graphics, or any of the others who led the early large
>> scale
>>> C++
>>>>>> projects outside of Murray Hill Labs, almost all of which failed
>>>>> IIRC Borland did the first production C++ compiler in 1990, before
>>> this,
>>>>> only
>>>>> “cfront” existed. The first MS’s C++ compiler was IIRC 1992 or
>> 1993,
>>>
>>>>> always a
>>>>> 32bit EXE itself - running under PharLap (PharLap embedded to the
>>> binary)
>>>>> on
>>>>> DOS, in virtual DOS machine under PharLap on Windows 3.x and as
>>> native PE
>>>>> in
>>>>> Windows 95/NT. This is how MSVC 1.5x worked.
>>>>>
>>>>> The UNIX and open-source people turned to C++ MUCH later then
>> people
>>>
>>>>> working
>>>>> for DOS/Windows with Borland’s or MS’s tools.
>>>>>
>>>>> Maxim Shatskih, Windows DDK MVP
>>>>> StorageCraft Corporation
>>>>> xxxxx@storagecraft.com
>>>>> http://www.storagecraft.com
>>>>>
>>>>>
>>>> –
>>>> Ray
>>>> (If you want to reply to me off list, please remove “spamblock.”
>> from
>>> my
>>>> email address)
>>>>
>>>
>>>
>>>
>>> —
>>> 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
>>>
>>
>> –
>> Ray
>> (If you want to reply to me off list, please remove “spamblock.” from
>> my
>> email address)
>>
>> —
>> 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
>>
>
>
>

Well, yeeeaaaah, Michal. That’s because you have a clue and are an exceptionally capable driver writer.

If the only problems that remained in Windows drivers were subtle race conditions, then I think we’d be in MUCH better shape than we are today.

While I’m aware of research that’s going on to detect locking problems (on class of the problem), the only way to test these types of issues is thousands of iterations under different load conditions. Heck, the tests can take two DAYS to run as far as I’m concerned… as long as they’re meaningful, correct, and they result in drivers that are demonstrably MUCH better quality than non-tested drivers.

The IOCTL tests are an excellent example. DevCtl/DevicePathExerciser/DC2 (just about the same test, but three different executables) is an outstanding tool – I have never, not once, seen a driver that can pass a set of PROPERLY CONFIGURED DC2 tests the first time. The problem? The “properly configured” part of that last sentence. The HCT uses a much reduced sub-set of the tests and, while these tests can catch SOME problems (hey, SOMEbody has to open and close your device 20,000 times in a row just to make sure it’s working… right?), it could catch many MORE problems if a broader set of tests were used.

Of course, you need really good, experienced, driver devs to design the best possible tests. Devs who have knowledge of devices in the real world, devs who know what pragmatic problems other devs face in producing quality drivers in a given field.

P

wrote in message news:xxxxx@ntdev…
> Of course, you need really good, experienced, driver devs to design the
> best possible tests. Devs who have knowledge of devices in the real
> world, devs who know what pragmatic problems other devs face in producing
> quality drivers in a given field.

You do need people who can really identify the problems to design the
tests. But you also need some standards and framework (not DTM) to build
the tests. Look at the languages testing and Unix OS testing there were
(at least for most of the stuff I saw) tests that gave a good log informing
you what went wrong, a well designed control model so you could run the
tests you want, and a precedence model that so that a test could indicate
it could not run if a previous test did not pass.

Now compare it to the Microsoft driver tests, where it comes back with
“invalid device” or similar useless statement, and stops everything until
you find and fix that problem. The test does not do as the ones I talked
about above, continue testing and reporting that either a test could not be
run, or that it ran successfully or with errors. The lack of this
capability directly impacts driver quality, because you cannot run the
tests at all until you have a complete drvier, and you have no idea of the
scope of the problems until you fix them all.

If the tests could be run as the driver is being developed, then a manager
would have a better idea where the development stood, versus the “driver is
80% done”, gee is that 80% design, coded or some other quantity. This lack
of any real progress measure means that dev teams get backed into
unrealistic schedules and don’t know they have a problem until it is too
late to fix the schedule or the driver.

The other big failing of the Microsoft tests, is the lack of source code.
If you have a device that does not fit their classes, there is no base to
start developing your tests for the unique device. This means most of us
struggle with inadequate test code to test our drivers.

Microsoft points the finger at third party drivers for causing most system
crashes, this is true, but the lack of good tests from Microsoft holds much
of the responsibility for the problem.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply

cristalink wrote:

Most of you have probably seen deprecation warnings on sprintf among other
things. It recommends you change to sprintf_s, which has an extra parameter
saying how long the buffer is.

What it doesn’t say is that it nulls out the entire contents of the buffer
beyond what you print.

EG: sprintf_s( buf, 500, “hello” );

This will write “hello” to the buffer, and then write 495 nulls.

Yes, but only in a debug build.

It probably also applies to
most of the other ‘secure’ CRT _s versions of functions too.

You don’t have to guess. The source code for the C runtime library is
shipped with the compiler.


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

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of xxxxx@osr.com[SMTP:xxxxx@osr.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, October 06, 2006 5:01 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] KMDF required for Vista certification?

The IOCTL tests are an excellent example. DevCtl/DevicePathExerciser/DC2 (just about the same test, but three different executables) is an outstanding tool – I have never, not once, seen a driver that can pass a set of PROPERLY CONFIGURED DC2 tests the first time.

That’s a challenge :slight_smile: I have to admit I haven’t used DC2 out of WHQL testing because I test IOCTLs using my own tools and I believe it is correct. However, I’ll ask our QA to find proper configuration and will see if my drivers survive.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

All the info you need is in the “Active Control Test” section in the DDK
docs. It’s not as entirely straightforward as the docs might have you
believe, but it is really worth the effort (the fuzz tester in DC2 is evil
incarnate)

-scott


Scott Noone
Software Engineer
OSR Open Systems Resources, Inc.
http://www.osronline.com

“Michal Vodicka” wrote in message
news:xxxxx@ntdev…
> ----------
> From:
> xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com]
> on behalf of xxxxx@osr.com[SMTP:xxxxx@osr.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Friday, October 06, 2006 5:01 PM
> To: Windows System Software Devs Interest List
> Subject: RE:[ntdev] KMDF required for Vista certification?
>
> The IOCTL tests are an excellent example. DevCtl/DevicePathExerciser/DC2
> (just about the same test, but three different executables) is an
> outstanding tool – I have never, not once, seen a driver that can pass a
> set of PROPERLY CONFIGURED DC2 tests the first time.
>
That’s a challenge :slight_smile: I have to admit I haven’t used DC2 out of WHQL testing
because I test IOCTLs using my own tools and I believe it is correct.
However, I’ll ask our QA to find proper configuration and will see if my
drivers survive.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

IMHO, the “secure” functions are no more secure than their “unsecure”
counterparts. Both rely on the programmer to pass correct parameters to. I
was always careful in using strcpy etc, so why do I *have to* use the newly
invented “secure” functions, which are likely to lead to more bugs just
because they are new? On the other hand, even if I got used to them, they
are not going to make my code any more secure than it was before. Actually,
the code will be less secure, as there are more confusing parameters with
undocumented behavior to care about.

<just disappear>>

“David J. Craig” wrote in message
news:xxxxx@ntdev…
>I have seen this style and even been guilty of it myself in the past.
>However, you should use a define for the size that is shared with the
>allocator and the other statements that need to know how big the buffer is.
>This is also true for statically allocated buffers, but then you can use
>the sizeof construct. You may have a different preference, but I think it
>is more stable and lends itself to easier modification without having to
>worry about not getting one place with the wrong value.
>
> “cristalink” wrote in message news:xxxxx@ntdev…
>>>>the bottom line is that requiring anything really doesn’t mean bugs will
>>>>just disappear
>>
>> Below is I think a good example I received from a fellow developer the
>> other day.
>>
>> --------
>>
>> Most of you have probably seen deprecation warnings on sprintf among
>> other things. It recommends you change to sprintf_s, which has an extra
>> parameter saying how long the buffer is.
>>
>> What it doesn’t say is that it nulls out the entire contents of the
>> buffer beyond what you print.
>>
>> EG: sprintf_s( buf, 500, “hello” );
>>
>> This will write “hello” to the buffer, and then write 495 nulls. If you
>> have any code where you get the buffer size wrong, or sprintf to buf + 10
>> instead of just buf (like me, when porting some existing code), then you
>> may wipe whatever memory happens to be past that buffer. It probably also
>> applies to most of the other ‘secure’ CRT _s versions of functions too.
>>
>> Of course, I’m sure that the rest of you are far smarter than I and would
>> never make such a mistake as this, but consider this a heads up if you
>> weren’t aware :slight_smile:
>>
>>
>>
>> “Martin O’Brien” wrote in message
>> news:xxxxx@ntdev…
>>> All I’m saying, albeit not very clearly, is that you yourself are saying
>>> that WDM had problems, and I am wondering how you would feel if, instead
>>> of KMDF, WDM was the requirement for the types of devices the KMDF is
>>> now to support. My understanding is the one of the purposes of KMDF was
>>> to, once again, simplify the code required to support Plug and Play and
>>> Power Management, in, once again, and object oriented fashion. It seems
>>> that the first attempt did not turn out to well, so, given this, I don’t
>>> see why it is hard to understand why people are upset about a new
>>> framework being required.
>>>
>>> As for your point about Kernel32.DLL, I agree that, indeed, you must
>>> trust Microsoft for some things. Fine. That argument, however, applies
>>> equally well to the versioning issues I presented in other modules,
>>> which, pretty clearly, really suck. Your picking a module that has
>>> worked very well, and, perhaps, that will apply to KMDF. Perhaps not.
>>> Kernel32 is an unavoidable requirement. KMDF is, as evidenced by the
>>> fifteen years or so (or something like that) of NT history, quite
>>> clearly, not. And to me, the bottom line is that requiring anything
>>> really doesn’t mean bugs will just disappear, and, considering that one
>>> can circumvent (by design) KMDF, and there is no source code for it, it
>>> doesn’t mean that they will even improve. This same argument (that
>>> using X will produce better results in and of itself) has been applied
>>> to things like Visual Basic, every other 4GL in existence, Garbage
>>> Collection, C++, eXtreme Programming, et. c., and none of them produce
>>> that result, because it is impossible, and very, very few of them
>>> actually were better overall.
>>>
>>>
>>>
>>>
>>>
>>>
>>>>>> xxxxx@synaptics.spamblock.com 2006-10-05 19:52:14 >>>
>>> I can’t really parse this paragraph, but I think Martin’s asking if I
>>> think it would be all right for Microsoft to require you write your
>>> drivers in WDM.
>>>
>>> Depending on exactly what is meant by “WDM”, and exactly what kinds of
>>>
>>> drivers you’re talking about, Microsoft has been requiring exactly that
>>>
>>> for a long time, at least for drivers that you want them to certify.
>>> Ummm, can’t say I’m all that unhappy… considering the
>>> alternatives…
>>>
>>> What’s the point, exactly?
>>>
>>> WHQL requires that you install your drivers using PnP methods rather
>>> than patching the registry too (which you could do using lower-level,
>>> but otherwise perfectly valid APIs)… is that equally offensive?
>>>
>>> Martin O’Brien wrote:
>>>> My basic question to xxxxx@synaptics.com is, based on what he actually
>>>> quoted, how happy he or she would have been if Microsoft had made
>>> the
>>>> same stipulation requiring WDM? Its existence, and, in this sense,
>>> the
>>>> existence of KMDF itself, would seem to nullify arguments to the
>>> extent
>>>> that some of us are overreacting to the situation, as if it couldn’t
>>>> possibly occur, or even that is unlikely. It already has. I don’t
>>> mean
>>>> that critically, as that’s just part of the software development
>>> cycle,
>>>> until there exists stipulations that one must use it. As I see it, it
>>> is
>>>> a hard requirement, because “It’s not like Microsoft is saying you
>>>> can’t write a WDM mouse/keyboard driver, or even ship it to your
>>>> customers, they’re just saying that Microsoft doesn’t want to have
>>>> anything to do with it if you do” doesn’t, and shouldn’t mean
>>> anything
>>>> to them.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>> xxxxx@cristalink.com 2006-10-04 19:48:14 >>>
>>>>> You don’t statically link to kernel32.dll either, but that doesn’t
>>>> seem to
>>>>> bother anyone
>>>>
>>>> The trouble is, kernel32 is present in 99.99% Windows installations,
>>>> while
>>>> KMDF must be redistributed, with all the hassles of installing it.
>>>>
>>>>> They fix bugs in that thing all the time and that doesn’t seem to
>>>> bother
>>>>> anyone.
>>>>
>>>> Yeah, right. For me, bugs in Windows are the major source of
>>>> problems. I
>>>> can fix my own bugs, but I can’t fix Microsoft ones. And Microsoft
>>>> won’t fix
>>>> them either, at least within a reasonable time frame, say a year or
>>>> two. I
>>>> claim this based on my own experience in multiple cases.
>>>>
>>>>> They don’t give you the source either, and that doesn’t seem to
>>> bother
>>>>
>>>>> anyone.
>>>>
>>>> Yes, it does.
>>>>
>>>>
>>>>
>>>>
>>>> “Ray Trent” wrote in message
>>>> news:xxxxx@ntdev…
>>>>> You know, when this requirement was first articulated, I pitched a
>>>> big fit
>>>>> for quite some time for a lot of the same reasons people have
>>>> discussed
>>>>> here.
>>>>>
>>>>> Then I calmed down and really thought about it.
>>>>>
>>>>> First of all, KMDF is nothing like MFC. They serve entirely
>>>> different
>>>>> purposes and accomplish their goals in entirely different ways.
>>> KMDF
>>>> is
>>>>> much more like “the way WDM should have been done in the first
>>> place,
>>>>
>>>>> because damn that thing is crufty and awful and way too
>>> complicated”.
>>>>
>>>>> Another way of looking at it is that KMDF is a lot more like NDIS.
>>>>>
>>>>> As for the “but we can’t statically link” argument: It’s part of
>>> the
>>>> dang
>>>>> OS. You don’t statically link to kernel32.dll either, but that
>>>> doesn’t
>>>>> seem to bother anyone (and think of what a nightmare that would
>>>> be).
>>>>> They fix bugs in that thing all the time and that doesn’t seem to
>>>> bother
>>>>> anyone. They don’t give you the source either, and that doesn’t
>>> seem
>>>> to
>>>>> bother anyone.
>>>>>
>>>>> Where was the huge outrage when Microsoft “hid” all the
>>> installation
>>>>
>>>>> details in UpdateDriverForPlugAndPlayDevices rather than “letting”
>>>> driver
>>>>> writers call the SetupAPI functions directly themselves?
>>>>>
>>>>> Sure, it’s new… but I suspect that a whole lot of kernel32.dll
>>> in
>>>>
>>>>> Vista is brand-spanking new too. At some level we have to trust MS
>>> to
>>>> do
>>>>> their job. Frankly, I know Doron reasonably well, and that gives me
>>>> quite
>>>>> a bit of confidence that KMDF is implemented as well if not better
>>>> than
>>>>> kernel32.dll was.
>>>>>
>>>>> I don’t know anything about SDIO or cellphone drivers, but as for
>>>>> mice/keyboards, I very much doubt that anyone writing one of those
>>> is
>>>>
>>>>> doing anything really all that complicated WRT the stuff that KMDF
>>> is
>>>>
>>>>> “hiding”. And if they are, that’s probably a pretty big red flag
>>>> (insert
>>>>> sheepish admission that I had to figure out a few tricky ways
>>> around
>>>> how
>>>>> KMDF does things during our port because our driver was being
>>>> “bad”).
>>>>> It’s not like Microsoft is saying you can’t write a WDM
>>>> mouse/keyboard
>>>>> driver, or even ship it to your customers, they’re just saying that
>>>
>>>>> Microsoft doesn’t want to have anything to do with it if you do. I
>>>> don’t
>>>>> really want to have anything to do with it either…
>>>>>
>>>>> Maxim S. Shatskih wrote:
>>>>>> About KMDF. I’m very much worried about the amount of KMDF
>>>> questions
>>>>>> here
>>>>>> on forums, most of which are due to a) people do not know WDM b)
>>>> KMDF is
>>>>>> source-less. Without the kind help of Doron, these people would be
>>>> stuck.
>>>>>> Note: MFC is provided with source, and KMDF to WDM is what is
>>>> MFC to
>>>>>> Win32.
>>>>>> Also note: MFC does not free the person from knowing Win32
>>>> itself,
>>>>>> though
>>>>>> yes, the need in Win32 knowledge with MFC is very small - only to
>>>> solve
>>>>>> the
>>>>>> hard issues.
>>>>>> Any framework provides an illusion that “now all complexities
>>>> are
>>>>>> solved”.
>>>>>> Not so. The simple and streamlined things are done much easier,
>>> but,
>>>> if
>>>>>> the
>>>>>> hard issue arises - then the framework complicates the things a
>>> lot,
>>>> the
>>>>>> person
>>>>>> will need to know both the framework and the underlying platform.
>>>>>>
>>>>>>> without worrying about hidden locks, et. c. It seems to me that,
>>>> if one
>>>>>>> looks at the history of software failures, they have several
>>> things
>>>> in
>>>>>>> common, one of which is invariably the use of new and relatively
>>>>>>> untested tool to attempt solve what generally boil down to
>>>> personnel,
>>>>>>> management and budgetary problems, the last of which is for the
>>>> most
>>>>>>> part intractable in many cases; i. e. - lack of dedicated
>>> resources
>>>> for
>>>>>>> testing. I think one of the major problems with any new tool,
>>> and,
>>>> in
>>>>>>> particular, mandating its use, is that its capabilities are
>>>> evaluated by
>>>>>>> its architects and original developers, and, in the process, some
>>>> very
>>>>>>> unattractive realities about the mistakes that the general public
>>>> might
>>>>>>> make, as well as poor decisions get ignored.
>>>>>> Correct. If the bla-bla architect - or just business people -
>>>> mandate
>>>>>> some
>>>>>> tool - then the chances of tool-based failure are very high. For
>>>>>> instance - the
>>>>>> user wants some feature, and the tool just crashes trying to
>>>> implement
>>>>>> it, as
>>>>>> it was with ill memored PowerBuilder in mid 90ies.
>>>>>>
>>>>>>> case with C++ - that Bjarne was able to translate real C programs
>>>> to C++
>>>>>>> with only a 2% performance drop is nice, but not all that
>>>> meaningful, as
>>>>>>> most of us are neither geniuses nor original architects. That
>>>> being
>>>>>>> said, we are not incompetent, as neither probably were the people
>>>> at
>>>>>>> Mentor Graphics, or any of the others who led the early large
>>> scale
>>>> C++
>>>>>>> projects outside of Murray Hill Labs, almost all of which failed
>>>>>> IIRC Borland did the first production C++ compiler in 1990, before
>>>> this,
>>>>>> only
>>>>>> “cfront” existed. The first MS’s C++ compiler was IIRC 1992 or
>>> 1993,
>>>>
>>>>>> always a
>>>>>> 32bit EXE itself - running under PharLap (PharLap embedded to the
>>>> binary)
>>>>>> on
>>>>>> DOS, in virtual DOS machine under PharLap on Windows 3.x and as
>>>> native PE
>>>>>> in
>>>>>> Windows 95/NT. This is how MSVC 1.5x worked.
>>>>>>
>>>>>> The UNIX and open-source people turned to C++ MUCH later then
>>> people
>>>>
>>>>>> working
>>>>>> for DOS/Windows with Borland’s or MS’s tools.
>>>>>>
>>>>>> Maxim Shatskih, Windows DDK MVP
>>>>>> StorageCraft Corporation
>>>>>> xxxxx@storagecraft.com
>>>>>> http://www.storagecraft.com
>>>>>>
>>>>>>
>>>>> –
>>>>> Ray
>>>>> (If you want to reply to me off list, please remove “spamblock.”
>>> from
>>>> my
>>>>> email address)
>>>>>
>>>>
>>>>
>>>>
>>>> —
>>>> 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
>>>>
>>>
>>> –
>>> Ray
>>> (If you want to reply to me off list, please remove “spamblock.” from
>>> my
>>> email address)
>>>
>>> —
>>> 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
>>>
>>
>>
>>
>
>
>