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.

43 lines
958 B

  1. #ifndef _INC_DSKQUOTA_MAPFILE_H
  2. #define _INC_DSKQUOTA_MAPFILE_H
  3. //
  4. // Simple encapsulation of a mapped file for opening font files.
  5. //
  6. class MappedFile
  7. {
  8. public:
  9. MappedFile(VOID);
  10. ~MappedFile(VOID);
  11. //
  12. // Open the mapped file.
  13. //
  14. HRESULT Open(LPCTSTR pszFile);
  15. //
  16. // Close the mapped file.
  17. //
  18. VOID Close(VOID);
  19. //
  20. // Get the base virtual address of the mapped file.
  21. //
  22. LPBYTE Base(VOID) const
  23. { return m_pbBase; }
  24. //
  25. // How many bytes in the mapped file?
  26. //
  27. LONGLONG Size(VOID) const;
  28. private:
  29. HANDLE m_hFile;
  30. HANDLE m_hFileMapping;
  31. LPBYTE m_pbBase;
  32. LONGLONG m_llSize;
  33. //
  34. // Prevent copy.
  35. //
  36. MappedFile(const MappedFile& rhs);
  37. MappedFile& operator = (const MappedFile& rhs);
  38. };
  39. #endif // _INC_DSKQUOTA_MAPFILE_H