[wdmaudiodev] Re: Bug in MSVAD sample, or misunderstanding?

  • From: "Chris Edgington" <chris.edgington@xxxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Sat, 5 Oct 2002 18:00:08 -0500

I said I think the pointer should be set to NULL. As is it now, we could
call ExFreePool with a pointer to a block of memory that was already
freed. Setting m_pvDmaBuffer to NULL after freeing it would not allow
that to happen. 

Maybe I'm misunderstanding what you're saying, I don't see the quote you
refer to in MSDN. 

-Chris

> -----Original Message-----
> From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
> [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Chun-Yu
> Sent: Saturday, October 05, 2002 5:55 PM
> To: wdmaudiodev@xxxxxxxxxxxxx
> Subject: [wdmaudiodev] Re: Bug in MSVAD sample, or misunderstanding?
> 
> 
> 
> Ah, but from the MSDN Library - "If memblock is NULL, the pointer is
> ignored and free immediately returns."
> 
> So it doesn't hurt to call free on a NULL pointer - it just won't do
> anything.
> 
> Chun-Yu
> 
> On Sat, 5 Oct 2002, Chris Edgington wrote:
> 
> > 
> > In the msvad sample in the XP DDK, in basedma.cpp, the 
> following code
> > exists for the FreeBuffer method:
> > 
> >     if ( m_pvDmaBuffer )
> >     {
> >         ExFreePool( m_pvDmaBuffer );
> >         m_ulDmaBufferSize = 0;
> >     }
> > 
> > Am I missing something, or should m_pvDmaBuffer be set to 
> NULL after the
> > free? This has the potential of being called to free a NULL pointer,
> > right?
> > 
> > Thanks,
> > -Chris
> > 
> > ******************
> > 
> > WDMAUDIODEV addresses:
> > Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
> > Subscribe:    
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
> Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
> Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
> 
> URL to WDMAUDIODEV page:
> http://www.wdmaudiodev.de/
> 
> 
> 

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/


******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/

Other related posts: