Fine, great. As long as people are using GOOD QUALITY code in their
device drivers, I love it. I’m just sick to death of the NT world
looking like a bunch of freshman amateurs, due to all of the buffer
overflows, DoS susceptibilities, IRQL_NOT_LESS_THAN_OR_EQUAL BSODs, etc.
If you work in kernel-mode, you have an enormous responsibility to
consider security and stability as HIGHER priorities than performance or
functionality. Whether you achieve that with the NT RTL, with your own
package, with a high-quality lex package – whatever, I don’t care. As
long as developers understand the stringent requirements of k-mode, and
meet them!, feel free to use whatever solution is availabe to you.
I know you know this, as well as Maxim Shatskih, and most of the other
competent developers on this list. I know I sound strident. But it
PISSES ME OFF that people casually develop shitty drivers, and then
users blame Microsoft/Windows/whatever for the BSODs, corrupted data,
wounded functionality, etc.
– arlie
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
Sent: Friday, October 10, 2003 8:59 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Using sscanf and strtok in a kernel driver
Well despite your pedantic lecture, the NT kernel api has long supported
the standard C string functions, although recent ddks document a
preference for the new “string safe” versions of the same. The Rtl
functions are both inadequate and incomplete, and recommending that
programmers ‘roll their own’, when tested functioning versions ARE
available, is not good advice.
=====================
Mark Roddy
-----Original Message-----
From: Arlie Davis [mailto:xxxxx@sublinear.org]
Sent: Friday, October 10, 2003 4:08 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Using sscanf and strtok in a kernel driver
>
> No, there is no malloc or calloc. I don’t mean to be rude,
> but the kernel-mode development environment is very
> different from user-mode development, and there are very good
> reasons for this. Kernel-mode development is not a toy.
> There isn’t a single “malloc” function, because there are
> several different ways to allocate memory. Each is driven by
> different needs (non-paged pool, paged pool, mapped files,
> etc.), and each imposes certain constraints and requirements
> on your code.
>
> Similarly, you can’t use functions like strtok or *scanf, or
> any of the other horrid C RTL functions that were designed
> for UNIX user-mode apps in the 1970s. Read the DDK, and most
> of all, understand the constraints that kernel-mode
> development requires. You must understand what IRQL your
> code is executing at, how this interacts with pageable code
> and data, and therefore what you can and cannot do.
>
> Functions like strtok, strcpy, *scanf, and many of the other
> C RTL functions are simply too dangerous to use. Experience
> has shown that junior developers simply use them incorrectly
> 90% of the time, and when they do, they introduce serious
> security and stability bugs. Senior developers simply don’t
> use them, or use them extremely sparingly in toy user-mode apps.
>
> You MUST use the NT RTL functions (which provide many safe
> equivalents), or you must roll your own functions. In any
> case, security and stability MUST be more important than
> performance, especially for kernel-mode code.
>
>
– arlie
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On > Behalf Of
Menashe Ungar
Sent: Friday, October 10, 2003 3:25 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Using sscanf and strtok in a kernel driver
What about allocating memory? It looks that functions like
calloc or malloc are not available when using the DDK?
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@sublinear.org
To unsubscribe send a blank email to xxxxx@lists.osr.com