This is a rather open ended question. As I think Don pointed out, the
ext and the driver do not necessarily have anything to do with each
other; if they do, that has to be your doing. So, in the end, you can
pretty much to whatever you are willing to implement in the extension
and/or driver. If you need some sort of synchronization with your
driver, it is up to you to do so. What you wish to do (the
synchronization part) sounds pretty invovled. If you haven’t written an
extension yet, I would take a look at the samples that come with WinDbg.
In particular, I would look at extcpp or exts. The former is based on
the newer EngExtCpp framework, which I personally find much more easily
useful; the later is the older DbgEng. You don’t want simplext or
anything based on the original WDbgExt framework. If you do go the
EngExtCpp framework, there are at least a couple of things to keep in
mind. The first is that the documentation, well, sucks, and
considerably more so that the documentation for DbgEng, which itself,
well, sucks. You will have to understand DbgEng as well. The other is
that, unless you enjoy all the pleasures that can be had with trying to
get something that uses MSVCRT8 to run on machine without Visual Studio
installed, I would strongly suggest that you rebuild the source for
EngExtCpp.lib (which comes with WinDbg) to use a static library.
mm
Let me just mention, once again, just to be sure, that this particular
task (allocations) could be much more easily handled by DV and some
existing tools.
mm
>> xxxxx@gmail.com 2007-05-29 10:30 >>>
well as far as the logic to use the registry key and fail certain
memory
allocs, i am set.
what i am curious to find out is 9as u say) the kd ext is not unloaded
when
the driver unloads (after say a possible mem alloc failure). then can i
use
it to track all unallcoated mem by the driver or not?
On 5/29/07, Martin O’Brien wrote:
>
> ap:
>
> You’ve lost me. What is it you are asking/trying to do? Do you
have
> any further questions about KD Ext, et. c., are you all set?
>
> mm
>
> >>> xxxxx@gmail.com 2007-05-29 09:47 >>>
> hi all
>
>
> thanks a ton for all the valuable advice.
>
> the reason why i wanted the kd angle was i have better control. and
i
> dont
> have to wait till a third party test ends.
>
> i have haev some thing like a registry key telling me that i need to
> fail
> the xth memory alloc call and see whether my driver handles cleanup
> properly
> or not.
>
> AP
>
> On 5/29/07, Martin O’Brien wrote:
> >
> > In this specific case (pool usage), and most cases overall, I
would
> > totally agree with DV, et. c. In general, I have found that there
> are
> > times where your basic idea - kd extension integrated with a
driver
> -
> > does have its place, or at least works well. Generally, I have
used
> > this to work around problems - for example, ReadMsr() failing with
> > certain valid MSR’s.
> >
> > If I understand you correctly, the answer to your basic question
is
> > that, no, the kd ext would not unload because the driver did.
> >
> > mm
> >
> > >>> xxxxx@neverfailgroup.com 2007-05-28 19:10 >>>
> > Your driver must be leak free. Poolmon is a great tool when it
comes
> to
> >
> > detection of memory leaks. It is much better to use it in your lab
> > before
> > your customers use it; I know this as a fact. Verifier is also
your
> > good
> > friend. Prefast might be useful. SDV might be useful. The diligent
> > inspector
> > is also your friend, chances the diligent inspector is your best
> > friend,
> > welcome the diligent inspector.
> >
> > “A P” wrote in message
news:xxxxx@ntdev…
> > Hi all,
> >
> >
> > I want to add memory leaks detection code in a driver. my driver
is
> > written
> > such that for allocation failures it should cleanup properly and
> then
> > unload
> > itself. I ws wondering whether I can write a kd extension tht can
> work
> > in
> > conjunction to the driver to make this better. My doubt is when
the
> > driver
> > unloads, whould the kd extension also unload? then if wnt work for
> me.
> >
> > AP
> >
> >
> >
> > —
> > 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
> >
>
> —
> 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
>
—
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