Object oriented programming in NDIS

hi, i am new to programming NDIS drivers…can you tell me if i can use OO
programming, what are the disadvantages/advantages of doing that. Also what
will be the fastest data structure to use for drivers, can we use
associative binary trees? Thanks for your help


MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus

Look at Compuware NuMega Driver::Networks library (part of DriverStudio)

Guy

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Yasser Toor
Sent: =E5 14 =EE=E0=E9 2004 10:09
To: Windows System Software Devs Interest List
Subject: [ntdev] Object oriented programming in NDIS

hi, i am new to programming NDIS drivers…can you tell me if i can use
OO=20
programming, what are the disadvantages/advantages of doing that. Also
what=20
will be the fastest data structure to use for drivers, can we use=20
associative binary trees? Thanks for your help


MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.=20
http://join.msn.com/?page=3Dfeatures/virus


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

You are currently subscribed to ntdev as: xxxxx@netvision.net.il To
unsubscribe send a blank email to xxxxx@lists.osr.com

> hi, i am new to programming NDIS drivers…can you tell me if

i can use OO
programming, what are the disadvantages/advantages of doing
that. Also what
will be the fastest data structure to use for drivers, can we use
associative binary trees? Thanks for your help

You can use OO in drivers, but there are a few limitations, as well as
complicatins. For instance, it’s not possible to have “global” objects. All
objects have to be created dynamically and at runtime.

You will also have to roll your own of some of the runtime library, as it’s
not supported by MS for the driver libraries. For instance, you’ll need to
create a pair of “new” & “delete” functions.

Of course, as Guy suggested, you can use DriverStudio from NuMega to get
started.

Or you can use plain C.

We’ve got a large simulator written in C++ which is used to simulate our
next generation graphics processor, which interfaces to plain C driver that
we have. There’s been times when I’ve thought “This would be much easier to
do in C++” in the driver, but our driver is several dozen files, and a lot
of it is fairly complex, so it would take quite a lot of work to re-engineer
it to C++ all the way through, and if you don’t do it properly, it’s not
much point.

I’d say that the advantages of C is:

  • It’s directly interfacing to the DDK, you don’t need any ‘interface
    layers’.
  • I personally think it’s easier for the programmer to realize what the code
    does.

The advantages of C++ would be:

  • Generic classes, for encapsulation and code reuse.
  • Better type checking.

Of course you can use associative binary trees. It’s generally more popular
to use hash-tables or other methods that are more “directly accessible”, but
it all depends on how much data you’re trying to store/retrieve, and what
the access patterns are, etc, etc. All algorithms for storing and retrieving
data is dependant on how you access the data, and how much data is being
stored.

Also, if you’re going to access a lot of the data at short intervals, and
want the cache to help the performance of the driver, you may want to
consider something that isn’t a linked list (which binary trees is a form
of). Linked lists are perfect for thrashing in the cache, as each entry is
very likely to be on a different cache-line. Consider the following code:

struct x
{
struct x *next;
struct y *data;
} *list;

struct y
{
int key;
… some more data
};

struct y *findKey(int key)
{
struct x *p;
for(p = list; p; p = p->next)
{
if (p->data.key == key)
return p->data;
}
return NULL;
}

Now, it’s very likely that each allocation of struct x is on a different
cache-line than the previous one. Also, if data is not allocated closely to
struct x, it’s very likely to not be on the same cache-line as the owning
struct x. So every time through the loop, we fetch TWO cache-lines. In order
to get two integer values. On a modern processor that means reading 128 or
256 bytes each time. And the only time the extra data fetched is of some
help is on the final one where we find the correct key. All the others are
most likely just polluting the cache.

Of course, a slightly different (less generic) way of structuring the data
as a single struct would help a lot here. The above example would be very
likely to be the generic C++ implementation of a linked list, while a C
implementation may well use a single struct for the data and the link(s),
and that would help a fair bit (half the memory bandwidth needed). Another
way would be to copy the key from the data to the struct x, so that it’s
easy to access without the extra dererferenc.

But a much better option would be to have a hash-table where we can find the
object based on the key data. If done correctly, this would cause no memory
access during the lookup phase.

It’s important to remember that modern processors have a very high
throughput of instructions, but can easily be slowed down to a crawl by
accessing memory “badly”. The latency to read something that isn’t in
memory, on an Opteron/Athlon64 is about 45 ns. If the processor runs at
2GHz, and has 3 execution units, it will do 3 * 2 * 45 instructions in that
time. So even if you have to do a long instruction such as divide or
multiply, it’s a lot quicker than an uncached memory operation. Of course,
if the data is already in L1 cache, that’s a completely different story.

wrote in message news:xxxxx@ntdev…
> > hi, i am new to programming NDIS drivers…can you tell me if
> > i can use OO
> > programming, what are the disadvantages/advantages of doing
> > that. Also what
> > will be the fastest data structure to use for drivers, can we use
> > associative binary trees? Thanks for your help
>
> Or you can use plain C.
>

I don’t want to start another C versus C++ war, but C++ is not by nature OO.
A lot of use have written OO long before “OO languages” existed, and a heck
of a lot of C++ is not written in an object oriented model. You can use OO
with C, in fact the new Windows Driver Foundation interface is object
oriented and is specificed for C.


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

> wrote in message news:xxxxx@ntdev…
> > > hi, i am new to programming NDIS drivers…can you tell me if
> > > i can use OO
> > > programming, what are the disadvantages/advantages of doing
> > > that. Also what
> > > will be the fastest data structure to use for drivers, can we use
> > > associative binary trees? Thanks for your help
> >
> > Or you can use plain C.
> >
>
> I don’t want to start another C versus C++ war, but C++ is
> not by nature OO.
> A lot of use have written OO long before “OO languages”
> existed, and a heck
> of a lot of C++ is not written in an object oriented model.
> You can use OO
> with C, in fact the new Windows Driver Foundation interface is object
> oriented and is specificed for C.

Good point, and I agree. I’ve not written much OO code, but I’ve done some,
in as varying languages as C++, Simula67 (the inspiration of C++), Pascal
and Modula-2/3. But I’ve also used C++ compilers to write an awfull lot of
non-OO code, and a bunch of code where I’ve written parts as OO and parts as
non-OO (usually because the non-OO code already existed someplace else, and
I just incorporated it from a previous project or some such). Way before I
even heard of C++ (or at least laid by grubby mits on the disks of), I met
with a collegue who was writing OO code in plain C, and it was really neat
and clean.


Mats

First, I would like to mention that someone already replied with Compuware
NDis frame work, and that is a good example to look, if you happen to be
more inclined to use C++.

Second, http://www.microsoft.com/whdc/driver/kernel/KMcode.mspx is a
farily recent article by MS, so that should also give you some indication
about using the C++ …

Third, about the data structures, you must be aware that the DDI does not
support any ADT library like STL, it is way too much of a burden simply
because, pls guess it for me :). So if you want to use any and all data
structure techniques you can program and use it, as such NT kernel itself
has lot of shopisticated data sturctures ( one example is AVL ), SO IT IS
PURELY UPTO YOU TO COMEUP WITH YOUR KNOW ‘THE ELEGANT’ DATA STURCTURES FOR
YOUR USE… BUT SOME OF THE SIMPLE PRIMITIVES ARE ALREADY PROVIDED, AND THEY
ARE HEAVLY USED BY US IF WE JUST TAKE THE FREQUENCY MEASURE(S)…

Finally, it is my personal opinion, is that the DDI interface, as of today,
is very much C like, C is in more ways assembler like, and AT DRIVER LEVEL
PROGRAMMING OUR MIND’S FRAMEWORK is assembler like since it is mostly
exercising hardware(s)… If there is a virtual driver ( say a kernelmode
database engine ) and never ever need to worry about von-newmon Load/store
architcture then if the database engine’s models maps to object orientation,
sure you could use OO to design and code. If I want to use any language,
first I need to look at the problem at hand, and the boundary or space I
need to cover, and try to pickup a language that suits most closely to it.
An example is in order, if I just need to execute couple command(s), I would
try to use the BAT scripting, and it has if then else while type
constructs… I WOULD NEVER TRY TO WRITE A C PROGRAM TO EXECUTE THOSE
COMMANDS BY INVOKING FROM THE PROGRAM …

It is just my thought about using a language tool for getting the job done
and it is Pi/2 cents :slight_smile:

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Yasser Toor
Sent: Friday, May 14, 2004 12:09 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Object oriented programming in NDIS

hi, i am new to programming NDIS drivers…can you tell me if i can use OO
programming, what are the disadvantages/advantages of doing that. Also what
will be the fastest data structure to use for drivers, can we use
associative binary trees? Thanks for your help


MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus


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

You are currently subscribed to ntdev as: xxxxx@garlic.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> hi, i am new to programming NDIS drivers…can you tell me if i can use OO

programming,

For what? Just base your code on PASSTHRU sample (if we are speaking about the
filter).

will be the fastest data structure to use for drivers, can we use
associative binary trees?

The RtlxxxGenericTable (documented in the IFS kit) is fast enough.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> I don’t want to start another C versus C++ war

Well you did :slight_smile:

but C++ is not by nature OO.

I know what you are saying can be construed as technically true in many
respects but the honest truth is that it is worlds easier to follow good OO
practices in C++ than it is in C. WDF is using C, I suspect, in large part
due to political reasons and not technical merit. C can definitely be used
in an OO fashion and this is akin to knocking in nails with a pair of
pliers. I would rather use my C++ hammer.

The point earlier about no globals is incorrect as well, you just have to
set up a few things and this has been discussed here and other places
before. See www.hollistech.com for some good info on C++ in Windows
drivers. NDIS has its own challenges WRT C++ due to some Microsoft specific
conventions that were used in many NDIS structures, but if Compuware can do
it, it can obviously be done.

Would I recommend this approach? That is heavily dependent on the user, but
I certainly would not disuade anyone so inclined. The benefit is well worth
the pain of setup in many cases.


Bill McKenzie
Software Engineer - Prism 802.11 Wireless Solutions
Conexant Systems, Inc.

“Don Burn” wrote in message news:xxxxx@ntdev…
>
> wrote in message news:xxxxx@ntdev…
> > > hi, i am new to programming NDIS drivers…can you tell me if
> > > i can use OO
> > > programming, what are the disadvantages/advantages of doing
> > > that. Also what
> > > will be the fastest data structure to use for drivers, can we use
> > > associative binary trees? Thanks for your help
> >
> > Or you can use plain C.
> >
>
> I don’t want to start another C versus C++ war, but C++ is not by nature
OO.
> A lot of use have written OO long before “OO languages” existed, and a
heck
> of a lot of C++ is not written in an object oriented model. You can use
OO
> with C, in fact the new Windows Driver Foundation interface is object
> oriented and is specificed for C.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
>
>

A moments reflection on a stack trace with a WDF based driver in the stack
will reveal that WDF is implemented using C++ while providing C wrappers to
its facilities as an API. The include files reveal that the C wrappers
themselves are constructed as ‘C++ implemented in C’ constructs, and are an
interesting example of the ‘banging nails with pliers’ paradigm Bill refers
to.

=====================
Mark Roddy

-----Original Message-----
From: Bill McKenzie [mailto:xxxxx@conexant.com]
Sent: Wednesday, May 19, 2004 9:53 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Object oriented programming in NDIS

> I don’t want to start another C versus C++ war

Well you did :slight_smile:

>but C++ is not by nature OO.

I know what you are saying can be construed as technically
true in many respects but the honest truth is that it is
worlds easier to follow good OO practices in C++ than it is
in C. WDF is using C, I suspect, in large part due to
political reasons and not technical merit. C can definitely
be used in an OO fashion and this is akin to knocking in
nails with a pair of pliers. I would rather use my C++ hammer.

The point earlier about no globals is incorrect as well, you
just have to set up a few things and this has been discussed
here and other places before. See www.hollistech.com for
some good info on C++ in Windows drivers. NDIS has its own
challenges WRT C++ due to some Microsoft specific conventions
that were used in many NDIS structures, but if Compuware can
do it, it can obviously be done.

Would I recommend this approach? That is heavily dependent
on the user, but I certainly would not disuade anyone so
inclined. The benefit is well worth the pain of setup in many cases.


Bill McKenzie
Software Engineer - Prism 802.11 Wireless Solutions Conexant
Systems, Inc.

“Don Burn” wrote in message news:xxxxx@ntdev…
> >
> > wrote in message news:xxxxx@ntdev…
> > > > hi, i am new to programming NDIS drivers…can you tell me if
> > > > i can use OO
> > > > programming, what are the disadvantages/advantages of doing
> > > > that. Also what
> > > > will be the fastest data structure to use for drivers,
> can we use
> > > > associative binary trees? Thanks for your help
> > >
> > > Or you can use plain C.
> > >
> >
> > I don’t want to start another C versus C++ war, but C++ is
> not by nature
> OO.
> > A lot of use have written OO long before “OO languages”
> existed, and a
> heck
> > of a lot of C++ is not written in an object oriented model.
> You can use
> OO
> > with C, in fact the new Windows Driver Foundation interface
> is object
> > oriented and is specificed for C.
> >
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Remove StopSpam from the email to reply
> >
> >
> >
>
>
>
> —
> 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
>

Looks to me like the issue isn’t C++, but the current implementation. I
don’t see why the DDK compiler cannot be changed to generate good kernel
code that gets rid of all of those implementation issues.

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Bill McKenzie
Sent: Wednesday, May 19, 2004 9:53 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Object oriented programming in NDIS

I don’t want to start another C versus C++ war

Well you did :slight_smile:

but C++ is not by nature OO.

I know what you are saying can be construed as technically true in many
respects but the honest truth is that it is worlds easier to follow good OO
practices in C++ than it is in C. WDF is using C, I suspect, in large part
due to political reasons and not technical merit. C can definitely be used
in an OO fashion and this is akin to knocking in nails with a pair of
pliers. I would rather use my C++ hammer.

The point earlier about no globals is incorrect as well, you just have to
set up a few things and this has been discussed here and other places
before. See www.hollistech.com for some good info on C++ in Windows
drivers. NDIS has its own challenges WRT C++ due to some Microsoft specific
conventions that were used in many NDIS structures, but if Compuware can do
it, it can obviously be done.

Would I recommend this approach? That is heavily dependent on the user, but
I certainly would not disuade anyone so inclined. The benefit is well worth
the pain of setup in many cases.


Bill McKenzie
Software Engineer - Prism 802.11 Wireless Solutions
Conexant Systems, Inc.

“Don Burn” wrote in message news:xxxxx@ntdev…
>
> wrote in message news:xxxxx@ntdev…
> > > hi, i am new to programming NDIS drivers…can you tell me if
> > > i can use OO
> > > programming, what are the disadvantages/advantages of doing
> > > that. Also what
> > > will be the fastest data structure to use for drivers, can we use
> > > associative binary trees? Thanks for your help
> >
> > Or you can use plain C.
> >
>
> I don’t want to start another C versus C++ war, but C++ is not by nature
OO.
> A lot of use have written OO long before “OO languages” existed, and a
heck
> of a lot of C++ is not written in an object oriented model. You can use
OO
> with C, in fact the new Windows Driver Foundation interface is object
> oriented and is specificed for C.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
>
>


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

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

If it is so (and a quick dumpbin /symbols wdf.lib reveals a rather
extensive C++ framework) then I suppose
it’s just a matter of time when the underlying wdf class library gets
open for the direct C++ interface, not via the currently provided Wdf
wrappers?
Otherwise, it seems illogical to carry all the weight of the “hammer”
(as wdf.lib is a statically linked library), and yet being allowed to
use the “pliers” only.

  • Vitaly

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
Sent: Wednesday, May 19, 2004 10:01 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

A moments reflection on a stack trace with a WDF based driver in the
stack will reveal that WDF is implemented using C++ while providing C
wrappers to its facilities as an API. The include files reveal that the
C wrappers themselves are constructed as ‘C++ implemented in C’
constructs, and are an interesting example of the ‘banging nails with
pliers’ paradigm Bill refers to.

=====================
Mark Roddy

-----Original Message-----
From: Bill McKenzie [mailto:xxxxx@conexant.com]
Sent: Wednesday, May 19, 2004 9:53 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Object oriented programming in NDIS

> I don’t want to start another C versus C++ war

Well you did :slight_smile:

>but C++ is not by nature OO.

I know what you are saying can be construed as technically
true in many respects but the honest truth is that it is
worlds easier to follow good OO practices in C++ than it is
in C. WDF is using C, I suspect, in large part due to
political reasons and not technical merit. C can definitely
be used in an OO fashion and this is akin to knocking in
nails with a pair of pliers. I would rather use my C++ hammer.

The point earlier about no globals is incorrect as well, you
just have to set up a few things and this has been discussed
here and other places before. See www.hollistech.com for
some good info on C++ in Windows drivers. NDIS has its own
challenges WRT C++ due to some Microsoft specific conventions
that were used in many NDIS structures, but if Compuware can
do it, it can obviously be done.

Would I recommend this approach? That is heavily dependent
on the user, but I certainly would not disuade anyone so
inclined. The benefit is well worth the pain of setup in many cases.


Bill McKenzie
Software Engineer - Prism 802.11 Wireless Solutions Conexant
Systems, Inc.

“Don Burn” wrote in message news:xxxxx@ntdev…
> >
> > wrote in message news:xxxxx@ntdev…
> > > > hi, i am new to programming NDIS drivers…can you tell me if i
> > > > can use OO programming, what are the disadvantages/advantages of

> > > > doing that. Also what
> > > > will be the fastest data structure to use for drivers,
> can we use
> > > > associative binary trees? Thanks for your help
> > >
> > > Or you can use plain C.
> > >
> >
> > I don’t want to start another C versus C++ war, but C++ is
> not by nature
> OO.
> > A lot of use have written OO long before “OO languages”
> existed, and a
> heck
> > of a lot of C++ is not written in an object oriented model.
> You can use
> OO
> > with C, in fact the new Windows Driver Foundation interface
> is object
> > oriented and is specificed for C.
> >
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Remove StopSpam from the email to reply
> >
> >
> >
>
>
>
> —
> 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@relicore.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

FWIW, let me say why WDF only supports C. When we started the design for
WDF, we asked a bunch of third party developers (invited to a roundtable at
Microsoft) and asked them which language (C or C++) they will prefer. We
also had a survey. There was no conclusive answer. ~50% said they wanted C.
Others were ok with C/C++. We wanted good adoption for WDF. We didn’t want
to slow adoption by making C++ the default language for using WDF. So we
decided to go with C as the language for expressing our DDIs. The other
reason is that C++ has a lot of gotchas in kernel mode that will trip an
unwary programmer. There is a whitepaper on this subject at
http://www.microsoft.com/whdc. We are working with the compiler team to
resolve these issues. Once these are resolved we will officially support
C++. Internally WDF uses C++ (and we are careful to avoid these gotchas).


Nar Ganapathy
Windows Core OS group
This posting is provided “AS IS” with no warranties, and confers no rights.

“Vitaly Vatnikov” wrote in message
news:xxxxx@ntdev…
> If it is so (and a quick dumpbin /symbols wdf.lib reveals a rather
> extensive C++ framework) then I suppose
> it’s just a matter of time when the underlying wdf class library gets
> open for the direct C++ interface, not via the currently provided Wdf
> wrappers?
> Otherwise, it seems illogical to carry all the weight of the “hammer”
> (as wdf.lib is a statically linked library), and yet being allowed to
> use the “pliers” only.
>
> - Vitaly
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
> Sent: Wednesday, May 19, 2004 10:01 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Object oriented programming in NDIS
>
>
> A moments reflection on a stack trace with a WDF based driver in the
> stack will reveal that WDF is implemented using C++ while providing C
> wrappers to its facilities as an API. The include files reveal that the
> C wrappers themselves are constructed as ‘C++ implemented in C’
> constructs, and are an interesting example of the ‘banging nails with
> pliers’ paradigm Bill refers to.
>
>
> =====================
> Mark Roddy
>
>
>> -----Original Message-----
>> From: Bill McKenzie [mailto:xxxxx@conexant.com]
>> Sent: Wednesday, May 19, 2004 9:53 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re:[ntdev] Object oriented programming in NDIS
>>
>> > I don’t want to start another C versus C++ war
>>
>> Well you did :slight_smile:
>>
>> >but C++ is not by nature OO.
>>
>> I know what you are saying can be construed as technically
>> true in many respects but the honest truth is that it is
>> worlds easier to follow good OO practices in C++ than it is
>> in C. WDF is using C, I suspect, in large part due to
>> political reasons and not technical merit. C can definitely
>> be used in an OO fashion and this is akin to knocking in
>> nails with a pair of pliers. I would rather use my C++ hammer.
>>
>> The point earlier about no globals is incorrect as well, you
>> just have to set up a few things and this has been discussed
>> here and other places before. See www.hollistech.com for
>> some good info on C++ in Windows drivers. NDIS has its own
>> challenges WRT C++ due to some Microsoft specific conventions
>> that were used in many NDIS structures, but if Compuware can
>> do it, it can obviously be done.
>>
>> Would I recommend this approach? That is heavily dependent
>> on the user, but I certainly would not disuade anyone so
>> inclined. The benefit is well worth the pain of setup in many cases.
>>
>> –
>> Bill McKenzie
>> Software Engineer - Prism 802.11 Wireless Solutions Conexant
>> Systems, Inc.
>>
>>
>> “Don Burn” wrote in message news:xxxxx@ntdev…
>> >
>> > wrote in message news:xxxxx@ntdev…
>> > > > hi, i am new to programming NDIS drivers…can you tell me if i
>> > > > can use OO programming, what are the disadvantages/advantages of
>
>> > > > doing that. Also what
>> > > > will be the fastest data structure to use for drivers,
>> can we use
>> > > > associative binary trees? Thanks for your help
>> > >
>> > > Or you can use plain C.
>> > >
>> >
>> > I don’t want to start another C versus C++ war, but C++ is
>> not by nature
>> OO.
>> > A lot of use have written OO long before “OO languages”
>> existed, and a
>> heck
>> > of a lot of C++ is not written in an object oriented model.
>> You can use
>> OO
>> > with C, in fact the new Windows Driver Foundation interface
>> is object
>> > oriented and is specificed for C.
>> >
>> >
>> > –
>> > Don Burn (MVP, Windows DDK)
>> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> > Remove StopSpam from the email to reply
>> >
>> >
>> >
>>
>>
>>
>> —
>> 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@relicore.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

Golly guys, you certainly didn’t ask me. :slight_smile:

Also, why not support both ? We do, and we’re much smaller, and we don’t
have access to the compiler guys !

This would have been quite a good chance to get somebody to make sure that
the DDK compiler correctly support kernel side C++. Actually, do you know
what ? I’d much prefer to see a kernel side C# compiler than a C++ one - I’m
a minimalist and I believe in minimalist languages, specially when I have to
write kernel side code. And I believe in minimalist APIs too, the key rule
to an API call is, can I live without it ? If so, it shouldn’t be there.
Now, I can’t have Java, so, I’d settle for C#; but C++ is the minimum level.
Can you pass that request up to Uncle Bill ?

:slight_smile:

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Nar Ganapathy[MS]
Sent: Thursday, May 20, 2004 5:26 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Object oriented programming in NDIS

FWIW, let me say why WDF only supports C. When we started the design for
WDF, we asked a bunch of third party developers (invited to a roundtable at
Microsoft) and asked them which language (C or C++) they will prefer. We
also had a survey. There was no conclusive answer. ~50% said they wanted C.
Others were ok with C/C++. We wanted good adoption for WDF. We didn’t want
to slow adoption by making C++ the default language for using WDF. So we
decided to go with C as the language for expressing our DDIs. The other
reason is that C++ has a lot of gotchas in kernel mode that will trip an
unwary programmer. There is a whitepaper on this subject at
http://www.microsoft.com/whdc. We are working with the compiler team to
resolve these issues. Once these are resolved we will officially support
C++. Internally WDF uses C++ (and we are careful to avoid these gotchas).


Nar Ganapathy
Windows Core OS group
This posting is provided “AS IS” with no warranties, and confers no rights.

“Vitaly Vatnikov” wrote in message
news:xxxxx@ntdev…
> If it is so (and a quick dumpbin /symbols wdf.lib reveals a rather
> extensive C++ framework) then I suppose
> it’s just a matter of time when the underlying wdf class library gets
> open for the direct C++ interface, not via the currently provided Wdf
> wrappers?
> Otherwise, it seems illogical to carry all the weight of the “hammer”
> (as wdf.lib is a statically linked library), and yet being allowed to
> use the “pliers” only.
>
> - Vitaly
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
> Sent: Wednesday, May 19, 2004 10:01 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Object oriented programming in NDIS
>
>
> A moments reflection on a stack trace with a WDF based driver in the
> stack will reveal that WDF is implemented using C++ while providing C
> wrappers to its facilities as an API. The include files reveal that the
> C wrappers themselves are constructed as ‘C++ implemented in C’
> constructs, and are an interesting example of the ‘banging nails with
> pliers’ paradigm Bill refers to.
>
>
> =====================
> Mark Roddy
>
>
>> -----Original Message-----
>> From: Bill McKenzie [mailto:xxxxx@conexant.com]
>> Sent: Wednesday, May 19, 2004 9:53 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re:[ntdev] Object oriented programming in NDIS
>>
>> > I don’t want to start another C versus C++ war
>>
>> Well you did :slight_smile:
>>
>> >but C++ is not by nature OO.
>>
>> I know what you are saying can be construed as technically
>> true in many respects but the honest truth is that it is
>> worlds easier to follow good OO practices in C++ than it is
>> in C. WDF is using C, I suspect, in large part due to
>> political reasons and not technical merit. C can definitely
>> be used in an OO fashion and this is akin to knocking in
>> nails with a pair of pliers. I would rather use my C++ hammer.
>>
>> The point earlier about no globals is incorrect as well, you
>> just have to set up a few things and this has been discussed
>> here and other places before. See www.hollistech.com for
>> some good info on C++ in Windows drivers. NDIS has its own
>> challenges WRT C++ due to some Microsoft specific conventions
>> that were used in many NDIS structures, but if Compuware can
>> do it, it can obviously be done.
>>
>> Would I recommend this approach? That is heavily dependent
>> on the user, but I certainly would not disuade anyone so
>> inclined. The benefit is well worth the pain of setup in many cases.
>>
>> –
>> Bill McKenzie
>> Software Engineer - Prism 802.11 Wireless Solutions Conexant
>> Systems, Inc.
>>
>>
>> “Don Burn” wrote in message news:xxxxx@ntdev…
>> >
>> > wrote in message news:xxxxx@ntdev…
>> > > > hi, i am new to programming NDIS drivers…can you tell me if i
>> > > > can use OO programming, what are the disadvantages/advantages of
>
>> > > > doing that. Also what
>> > > > will be the fastest data structure to use for drivers,
>> can we use
>> > > > associative binary trees? Thanks for your help
>> > >
>> > > Or you can use plain C.
>> > >
>> >
>> > I don’t want to start another C versus C++ war, but C++ is
>> not by nature
>> OO.
>> > A lot of use have written OO long before “OO languages”
>> existed, and a
>> heck
>> > of a lot of C++ is not written in an object oriented model.
>> You can use
>> OO
>> > with C, in fact the new Windows Driver Foundation interface
>> is object
>> > oriented and is specificed for C.
>> >
>> >
>> > –
>> > Don Burn (MVP, Windows DDK)
>> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> > Remove StopSpam from the email to reply
>> >
>> >
>> >
>>
>>
>>
>> —
>> 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@relicore.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@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Java and C# minimalist? I think my head just exploded from acute
cognitive dissonance.

I mean, I’m fond of both in their place. I suppose if you pretend that
the language exists independently of the 500 ton standard runtime
library, …

There is indeed a big difference between a language and its runtime library.

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of benson margulies
Sent: Thursday, May 20, 2004 8:10 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Java and C# minimalist? I think my head just exploded from acute
cognitive dissonance.

I mean, I’m fond of both in their place. I suppose if you pretend that
the language exists independently of the 500 ton standard runtime
library, …


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

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Because supporting both would require more effort, and much more testing. I
would MUCH rather have a solid 1.0 driver framework than 2 half-assed
frameworks. (And no, the numerator and denominator would not cancel.)

Whenever anyone evaluates someone else’s work, it’s always “Why didn’t you
do X, or add feature Y?” But you evaluate your own project and you see that
every feature has a cost.

In this situation, it makes sense to decouple the transitions – first, WDM
to WDF. Then, IF YOU WANT, C to C++.

Actually, I think Alberto is just a couple of regexes that scan NTDEV for
strings relevant to C++, and a little rules set that conjures up a response
when such a string is found.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Moreira, Alberto
Sent: Thursday, May 20, 2004 5:41 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Golly guys, you certainly didn’t ask me. :slight_smile:

Also, why not support both ? We do, and we’re much smaller, and we don’t
have access to the compiler guys !

This would have been quite a good chance to get somebody to make sure that
the DDK compiler correctly support kernel side C++. Actually, do you know
what ? I’d much prefer to see a kernel side C# compiler than a C++ one - I’m
a minimalist and I believe in minimalist languages, specially when I have to
write kernel side code. And I believe in minimalist APIs too, the key rule
to an API call is, can I live without it ? If so, it shouldn’t be there.
Now, I can’t have Java, so, I’d settle for C#; but C++ is the minimum level.
Can you pass that request up to Uncle Bill ?

:slight_smile:

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Nar Ganapathy[MS]
Sent: Thursday, May 20, 2004 5:26 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Object oriented programming in NDIS

FWIW, let me say why WDF only supports C. When we started the design for
WDF, we asked a bunch of third party developers (invited to a roundtable at
Microsoft) and asked them which language (C or C++) they will prefer. We
also had a survey. There was no conclusive answer. ~50% said they wanted C.
Others were ok with C/C++. We wanted good adoption for WDF. We didn’t want
to slow adoption by making C++ the default language for using WDF. So we
decided to go with C as the language for expressing our DDIs. The other
reason is that C++ has a lot of gotchas in kernel mode that will trip an
unwary programmer. There is a whitepaper on this subject at
http://www.microsoft.com/whdc. We are working with the compiler team to
resolve these issues. Once these are resolved we will officially support
C++. Internally WDF uses C++ (and we are careful to avoid these gotchas).


Nar Ganapathy
Windows Core OS group
This posting is provided “AS IS” with no warranties, and confers no rights.

“Vitaly Vatnikov” wrote in message
news:xxxxx@ntdev…
> If it is so (and a quick dumpbin /symbols wdf.lib reveals a rather
> extensive C++ framework) then I suppose it’s just a matter of time
> when the underlying wdf class library gets open for the direct C++
> interface, not via the currently provided Wdf wrappers?
> Otherwise, it seems illogical to carry all the weight of the “hammer”
> (as wdf.lib is a statically linked library), and yet being allowed to
> use the “pliers” only.
>
> - Vitaly
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
> Sent: Wednesday, May 19, 2004 10:01 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Object oriented programming in NDIS
>
>
> A moments reflection on a stack trace with a WDF based driver in the
> stack will reveal that WDF is implemented using C++ while providing C
> wrappers to its facilities as an API. The include files reveal that
> the C wrappers themselves are constructed as ‘C++ implemented in C’
> constructs, and are an interesting example of the ‘banging nails with
> pliers’ paradigm Bill refers to.
>
>
> =====================
> Mark Roddy
>
>
>> -----Original Message-----
>> From: Bill McKenzie [mailto:xxxxx@conexant.com]
>> Sent: Wednesday, May 19, 2004 9:53 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re:[ntdev] Object oriented programming in NDIS
>>
>> > I don’t want to start another C versus C++ war
>>
>> Well you did :slight_smile:
>>
>> >but C++ is not by nature OO.
>>
>> I know what you are saying can be construed as technically true in
>> many respects but the honest truth is that it is worlds easier to
>> follow good OO practices in C++ than it is in C. WDF is using C, I
>> suspect, in large part due to political reasons and not technical
>> merit. C can definitely be used in an OO fashion and this is akin to
>> knocking in nails with a pair of pliers. I would rather use my C++
>> hammer.
>>
>> The point earlier about no globals is incorrect as well, you just
>> have to set up a few things and this has been discussed here and
>> other places before. See www.hollistech.com for some good info on
>> C++ in Windows drivers. NDIS has its own challenges WRT C++ due to
>> some Microsoft specific conventions that were used in many NDIS
>> structures, but if Compuware can do it, it can obviously be done.
>>
>> Would I recommend this approach? That is heavily dependent on the
>> user, but I certainly would not disuade anyone so inclined. The
>> benefit is well worth the pain of setup in many cases.
>>
>> –
>> Bill McKenzie
>> Software Engineer - Prism 802.11 Wireless Solutions Conexant Systems,
>> Inc.
>>
>>
>> “Don Burn” wrote in message news:xxxxx@ntdev…
>> >
>> > wrote in message news:xxxxx@ntdev…
>> > > > hi, i am new to programming NDIS drivers…can you tell me if i
>> > > > can use OO programming, what are the disadvantages/advantages
>> > > > of
>
>> > > > doing that. Also what
>> > > > will be the fastest data structure to use for drivers,
>> can we use
>> > > > associative binary trees? Thanks for your help
>> > >
>> > > Or you can use plain C.
>> > >
>> >
>> > I don’t want to start another C versus C++ war, but C++ is
>> not by nature
>> OO.
>> > A lot of use have written OO long before “OO languages”
>> existed, and a
>> heck
>> > of a lot of C++ is not written in an object oriented model.
>> You can use
>> OO
>> > with C, in fact the new Windows Driver Foundation interface
>> is object
>> > oriented and is specificed for C.
>> >
>> >
>> > –
>> > Don Burn (MVP, Windows DDK)
>> > Windows 2k/XP/2k3 Filesystem and Driver Consulting Remove StopSpam
>> > from the email to reply
>> >
>> >
>> >
>>
>>
>>
>> —
>> 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@relicore.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@compuware.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.


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

Actually, I believe in Object Orientation - the real thing. I find C
insufficient for driver writing, hence I keep prodding people to support a
real OO language for kernel side development.

And no, I’m not two regexes. Actually, if I wanted to have one solid driver
framework, I’d do it in C++ and forget C !

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Friday, May 21, 2004 2:00 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Because supporting both would require more effort, and much more testing. I
would MUCH rather have a solid 1.0 driver framework than 2 half-assed
frameworks. (And no, the numerator and denominator would not cancel.)

Whenever anyone evaluates someone else’s work, it’s always “Why didn’t you
do X, or add feature Y?” But you evaluate your own project and you see that
every feature has a cost.

In this situation, it makes sense to decouple the transitions – first, WDM
to WDF. Then, IF YOU WANT, C to C++.

Actually, I think Alberto is just a couple of regexes that scan NTDEV for
strings relevant to C++, and a little rules set that conjures up a response
when such a string is found.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Moreira, Alberto
Sent: Thursday, May 20, 2004 5:41 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Golly guys, you certainly didn’t ask me. :slight_smile:

Also, why not support both ? We do, and we’re much smaller, and we don’t
have access to the compiler guys !

This would have been quite a good chance to get somebody to make sure that
the DDK compiler correctly support kernel side C++. Actually, do you know
what ? I’d much prefer to see a kernel side C# compiler than a C++ one - I’m
a minimalist and I believe in minimalist languages, specially when I have to
write kernel side code. And I believe in minimalist APIs too, the key rule
to an API call is, can I live without it ? If so, it shouldn’t be there.
Now, I can’t have Java, so, I’d settle for C#; but C++ is the minimum level.
Can you pass that request up to Uncle Bill ?

:slight_smile:

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Nar Ganapathy[MS]
Sent: Thursday, May 20, 2004 5:26 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Object oriented programming in NDIS

FWIW, let me say why WDF only supports C. When we started the design for
WDF, we asked a bunch of third party developers (invited to a roundtable at
Microsoft) and asked them which language (C or C++) they will prefer. We
also had a survey. There was no conclusive answer. ~50% said they wanted C.
Others were ok with C/C++. We wanted good adoption for WDF. We didn’t want
to slow adoption by making C++ the default language for using WDF. So we
decided to go with C as the language for expressing our DDIs. The other
reason is that C++ has a lot of gotchas in kernel mode that will trip an
unwary programmer. There is a whitepaper on this subject at
http://www.microsoft.com/whdc. We are working with the compiler team to
resolve these issues. Once these are resolved we will officially support
C++. Internally WDF uses C++ (and we are careful to avoid these gotchas).


Nar Ganapathy
Windows Core OS group
This posting is provided “AS IS” with no warranties, and confers no rights.

“Vitaly Vatnikov” wrote in message
news:xxxxx@ntdev…
> If it is so (and a quick dumpbin /symbols wdf.lib reveals a rather
> extensive C++ framework) then I suppose it’s just a matter of time
> when the underlying wdf class library gets open for the direct C++
> interface, not via the currently provided Wdf wrappers?
> Otherwise, it seems illogical to carry all the weight of the “hammer”
> (as wdf.lib is a statically linked library), and yet being allowed to
> use the “pliers” only.
>
> - Vitaly
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
> Sent: Wednesday, May 19, 2004 10:01 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Object oriented programming in NDIS
>
>
> A moments reflection on a stack trace with a WDF based driver in the
> stack will reveal that WDF is implemented using C++ while providing C
> wrappers to its facilities as an API. The include files reveal that
> the C wrappers themselves are constructed as ‘C++ implemented in C’
> constructs, and are an interesting example of the ‘banging nails with
> pliers’ paradigm Bill refers to.
>
>
> =====================
> Mark Roddy
>
>
>> -----Original Message-----
>> From: Bill McKenzie [mailto:xxxxx@conexant.com]
>> Sent: Wednesday, May 19, 2004 9:53 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re:[ntdev] Object oriented programming in NDIS
>>
>> > I don’t want to start another C versus C++ war
>>
>> Well you did :slight_smile:
>>
>> >but C++ is not by nature OO.
>>
>> I know what you are saying can be construed as technically true in
>> many respects but the honest truth is that it is worlds easier to
>> follow good OO practices in C++ than it is in C. WDF is using C, I
>> suspect, in large part due to political reasons and not technical
>> merit. C can definitely be used in an OO fashion and this is akin to
>> knocking in nails with a pair of pliers. I would rather use my C++
>> hammer.
>>
>> The point earlier about no globals is incorrect as well, you just
>> have to set up a few things and this has been discussed here and
>> other places before. See www.hollistech.com for some good info on
>> C++ in Windows drivers. NDIS has its own challenges WRT C++ due to
>> some Microsoft specific conventions that were used in many NDIS
>> structures, but if Compuware can do it, it can obviously be done.
>>
>> Would I recommend this approach? That is heavily dependent on the
>> user, but I certainly would not disuade anyone so inclined. The
>> benefit is well worth the pain of setup in many cases.
>>
>> –
>> Bill McKenzie
>> Software Engineer - Prism 802.11 Wireless Solutions Conexant Systems,
>> Inc.
>>
>>
>> “Don Burn” wrote in message news:xxxxx@ntdev…
>> >
>> > wrote in message news:xxxxx@ntdev…
>> > > > hi, i am new to programming NDIS drivers…can you tell me if i
>> > > > can use OO programming, what are the disadvantages/advantages
>> > > > of
>
>> > > > doing that. Also what
>> > > > will be the fastest data structure to use for drivers,
>> can we use
>> > > > associative binary trees? Thanks for your help
>> > >
>> > > Or you can use plain C.
>> > >
>> >
>> > I don’t want to start another C versus C++ war, but C++ is
>> not by nature
>> OO.
>> > A lot of use have written OO long before “OO languages”
>> existed, and a
>> heck
>> > of a lot of C++ is not written in an object oriented model.
>> You can use
>> OO
>> > with C, in fact the new Windows Driver Foundation interface
>> is object
>> > oriented and is specificed for C.
>> >
>> >
>> > –
>> > Don Burn (MVP, Windows DDK)
>> > Windows 2k/XP/2k3 Filesystem and Driver Consulting Remove StopSpam
>> > from the email to reply
>> >
>> >
>> >
>>
>>
>>
>> —
>> 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@relicore.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@compuware.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.


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


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

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Amen. I agree that C++ – or ANYTHING – would be a better language than C.
(And if you check the list archives, I’ve already said that a managed
language such as C# is exactly what kernel-mode development *eventually*
needs.) Thing is, we don’t get to reinvent everything on every iteration.
Every new software component exists in the context of existing, and usually
quite important! software components. Backward compatibility is not an ugly
necessity. It is absolutely vital.

Providing a natural transition from WDM to WDF is important. And, when the
time is right, from C to something better. But not here, not now.
Meanwhile, as I’m sure you know, there are several quite decent C++ driver
frameworks for WDM.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Moreira, Alberto
Sent: Friday, May 21, 2004 2:02 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Actually, I believe in Object Orientation - the real thing. I find C
insufficient for driver writing, hence I keep prodding people to support a
real OO language for kernel side development.

And no, I’m not two regexes. Actually, if I wanted to have one solid driver
framework, I’d do it in C++ and forget C !

Alberto.

Actually, while I was digging through the DDK documentation for AVStream
drivers, I bumped into this snippet:

=================================================
For maximum portability, drivers should be written in a high-level language,
typically C for kernel-mode drivers, and C or C++ for user-mode drivers. The
following are exceptions:

Audio/Video streaming (AVStream) client minidrivers (Microsoft? DirectX?
8.0, Microsoft? Windows? XP and later versions of the operating system) are
typically written in C++.

WDM audio miniport drivers use kernel-mode COM components and are typically
written in C++.

Windows Image Acquisition (WIA) drivers, most of which run in user mode, are
typically written in C++.

Display drivers are typically written in C. However, the system-supplied
Graphics Display Interface (GDI) defines the public portions of its internal
data structures as user objects. GDI also defines numerous service routines
to manipulate these objects. Display drivers written in C++ can treat these
routines as methods on the user object; drivers written in C can call these
routines in the usual manner.

Looks like when things get a bit more involved, Microsoft suggests using
C++, and even kernel side COM !

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Friday, May 21, 2004 2:15 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Amen. I agree that C++ – or ANYTHING – would be a better language than C.
(And if you check the list archives, I’ve already said that a managed
language such as C# is exactly what kernel-mode development *eventually*
needs.) Thing is, we don’t get to reinvent everything on every iteration.
Every new software component exists in the context of existing, and usually
quite important! software components. Backward compatibility is not an ugly
necessity. It is absolutely vital.

Providing a natural transition from WDM to WDF is important. And, when the
time is right, from C to something better. But not here, not now.
Meanwhile, as I’m sure you know, there are several quite decent C++ driver
frameworks for WDM.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Moreira, Alberto
Sent: Friday, May 21, 2004 2:02 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Actually, I believe in Object Orientation - the real thing. I find C
insufficient for driver writing, hence I keep prodding people to support a
real OO language for kernel side development.

And no, I’m not two regexes. Actually, if I wanted to have one solid driver
framework, I’d do it in C++ and forget C !

Alberto.


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

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Arlie Davis[SMTP:xxxxx@sublinear.org]
Reply To: Windows System Software Devs Interest List
Sent: Friday, May 21, 2004 7:59 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Object oriented programming in NDIS

Actually, I think Alberto is just a couple of regexes that scan NTDEV for
strings relevant to C++, and a little rules set that conjures up a response
when such a string is found.

:slight_smile: Some time before I pondered writting Alberto emulator above mentioned way. But laziness prevailed, as usual.

Best regards,

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