Thanks to everyone for all the help and suggestions.
I went back to the drawing board and completely redesigned the driver so
that the component that required C++ now sits in user-mode land. I already
had a user-mode component talking to my driver, so it wasn’t all that
difficult.
I have a new level of respect for understanding why drivers are sometimes
error prone and buggy when first released even after only being at this for
a short time.
Cheers,
Andrew
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David J. Craig
Sent: May 4, 2007 3:11 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] C++ in minifilter driver.
There are no kernel mode DLLs that come even close to the DLLs that exist in
user mode. Read the referenced documents about C++ in the kernel. Read
about writing helper/EXPORT drivers. One example of using an export driver
is found in the smartcard stack where smclib.sys is the Microsoft written
export driver that does most of the work in managing smartcard logic other
than the specifics of the reader/writer device. Source is not available,
AFAIK, but there are samples for the device specific driver that shows how
it can use an export driver.
I know of many drivers that use C++, but only in a limited way. Exceptions
cannot be used (C++) as only SEH is supported in the kernel.
Best advise is to read first then try an implementation that will be a throw
away. After you get it working, start over again with the overall design of
the driver. You have to implement or find an implementation of new and
delete that map to the standard kernel memory allocation functions. I
STRONGLY recommend that you use unique tags for each type of memory to help
in debugging memory leaks and errors.
“Andrew Cheyne” wrote in message
news:xxxxx@ntfsd…
> Do you have any examples of how to do this?
>
> I have the source code for the C++ components. If I could put them in a
> kernel mode DLL and then load that DLL, it would help me a lot. At the
> moment, I’m looking at re-implementing in C.
>
>
> Thanks,
> Andrew
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Dejan Maksimovic
> Sent: May 4, 2007 7:19 AM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] C++ in minifilter driver.
>
>
> Ahh right KMDF. It can help if he puts the C++ code (I am assuming it
> is
> not
> directly driver related) and export it as a kernel mode DLL for his
> mini-filter
> (that’s what I do).
>
> Don Burn wrote:
>
>> Where in the RamDisk sample? The only RamDisk sample’s are in KMDF, and
>> all the files are C files (at least in all the KMDF betas, and WDK 6000
> and
>> the longhorn bets). Now, I know KMDF used C++ in a limited manor, so it
> is
>> possible that the C++ support you are referring to is an artifact of
>> that.
>> But this still won’t help the OP, since KMDF is not for file system
>> filters.
>
> –
> Kind regards, Dejan
> http://www.alfasp.com
> File system audit, security and encryption kits.
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gridironsoftware.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@gridironsoftware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com