Source code of Windows XP (NT5)
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.

18 lines
471 B

  1. #ifndef __FILEMAP_H__
  2. #define __FILEMAP_H__
  3. class CFileMap : public CObject {
  4. public:
  5. CFileMap();
  6. ~CFileMap();
  7. BOOL bOpen(LPCTSTR FileName,BOOL ReadOnly=TRUE);
  8. BOOL bClose();
  9. LPBYTE GetMemPtr() {return m_Memory;}
  10. DWORD GetFileSize() {return m_FileSize;}
  11. UINT_PTR GetOffset(LPBYTE Tag) {return Tag - m_Memory;}
  12. protected:
  13. LPBYTE m_Memory;
  14. HANDLE m_FileMapping;
  15. HANDLE m_FileHandle;
  16. DWORD m_FileSize;
  17. };
  18. #endif