windows-nt/Source/XPSP1/NT/admin/pchealth/sr/tools/rstrlogc/mfr.h
2020-09-26 16:20:57 +08:00

46 lines
875 B
C++

#ifndef __MFR_H_INCLUDED__
#define __MFR_H_INCLUDED__
#pragma once
/////////////////////////////////////////////////////////////////////////////
//
// CMappedFileRead class
//
/////////////////////////////////////////////////////////////////////////////
class CMappedFileRead
{
public:
CMappedFileRead();
~CMappedFileRead();
// Operations
public:
BOOL Open( LPCWSTR cszPath );
void Close();
BOOL Read( LPVOID pBuf, DWORD cbBuf );
BOOL Read( DWORD *pdw );
LPCWSTR ReadStrAnsi( DWORD cbStr );
BOOL ReadDynStrW( LPWSTR szBuf, DWORD cchMax );
protected:
// Attributes
public:
DWORD GetAvail() { return( m_dwAvail ); }
protected:
WCHAR m_szPath[MAX_PATH];
DWORD m_dwSize;
HANDLE m_hFile;
HANDLE m_hMap;
LPBYTE m_pBuf;
LPBYTE m_pCur;
DWORD m_dwAvail;
};
#endif //ndef __MFR_H_INCLUDED__