Re: C vs C++ Device Driver Question
- From: "m" <m@xxx>
- Date: Thu, 28 Feb 2008 22:48:51 -0500
IMHO, C++ can be used to good effect in KM but I advise against it for a
variety of reasons. Most importantly, C++ can hide the meaning of code and
the consequences of a seemingly trivial line of code can be disastrous. C
has the advantage that, with the exception of macros, all code executes as
it appears in source.
BTW: I also advise against C++ in UM for the same reason. And if you want
OO programming, then use .NET or Java. I regularly write and maintain code
in C, C++, VB.NET, C#, & Java and the most difficult to work on by far is
C++ because of the non-obvious nature of some constructs.
This is just my opinion and, as has been stated already, C++ can readily be
used in KM.
"decoder" <rcg_golf@xxxxxxxxxxx> wrote in message
news:e%23ZCmPneIHA.4696@xxxxxxxxxxxxxxxxxxxxxxx
On the MS website: http://www.microsoft.com/whdc/driver/kernel/KMcode.mspx
it points out the many pitfalls of developing a kernel mode driver using
C++ (classes, inheritance etc.).
If it presents so many problems to use C++, why do the AVStream samples
use C++ classes?
For example in C:\WINDDK\3790.1830\src\wdm\avstream or
C:\WINDDK\6000\src\AVStream, the sample
files provided by MS contain C++ classes, and use inheritance!!
Since especially the avshws sample is targeted for eventual use with
hardware( it is pin-centric, shows how to
do DMA etc.), why is it not written in C, like the bulkusb sample for
example?
What does the community think about using C++ in kernel mode drivers?
Thanks
-decoder
.
- References:
- C vs C++ Device Driver Question
- From: decoder
- C vs C++ Device Driver Question
- Prev by Date: Re: how to get data from mirror driver
- Next by Date: Re: send notification from mirror driver to user application
- Previous by thread: Re: C vs C++ Device Driver Question
- Next by thread: NdisMCoIndicateReceiveNetBufferLists not working with NDIS_RECEIVE_FLAGS_RESOURCES flag
- Index(es):
Relevant Pages
|