Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
634 B

#include "stdafx.h"
#include "mymfile.h"
CMyMemFile::CMyMemFile()
{
}
CMyMemFile::~CMyMemFile()
{
Close();
}
BOOL CMyMemFile::bOpen(LPCTSTR FileName)
{
BOOL bRet = FALSE;
const WORD UnicodePrefix=0xFEFF;
if (! Open(FileName,CFile::modeCreate | CFile::modeReadWrite)) {
fprintf(stderr,"Open target file failed ! %d\n",GetLastError());
goto Exit1;
}
Write(&UnicodePrefix,sizeof(WORD));
bRet = TRUE;
Exit1:
return bRet;
}
void CMyMemFile::bClose()
{
if (m_lpBuffer) {
CFile::Write(m_lpBuffer,m_nFileSize);
}
return;
}