// example for CMemFile::CMemFile
CMemFile f; // Ready to use - no Open necessary.BYTE * pBuf = (BYTE *)new char [1024];
CMemFile g( pBuf, 1024, 256 );
// same as CMemFile g; g.Attach( pBuf, 1024, 256 );The above is copied from MSDN. You Can have a look to CMemFile::CMemFile().
*psf is sure to change, &psf and psf never change. In fact, &psf does not mean anything to you.
In your code, buffer's address never changes, and it's attached with psf.
For more details, you can write a console application to have a test.