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.

45 lines
875 B

  1. #ifndef __MFR_H_INCLUDED__
  2. #define __MFR_H_INCLUDED__
  3. #pragma once
  4. /////////////////////////////////////////////////////////////////////////////
  5. //
  6. // CMappedFileRead class
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. class CMappedFileRead
  10. {
  11. public:
  12. CMappedFileRead();
  13. ~CMappedFileRead();
  14. // Operations
  15. public:
  16. BOOL Open( LPCWSTR cszPath );
  17. void Close();
  18. BOOL Read( LPVOID pBuf, DWORD cbBuf );
  19. BOOL Read( DWORD *pdw );
  20. LPCWSTR ReadStrAnsi( DWORD cbStr );
  21. BOOL ReadDynStrW( LPWSTR szBuf, DWORD cchMax );
  22. protected:
  23. // Attributes
  24. public:
  25. DWORD GetAvail() { return( m_dwAvail ); }
  26. protected:
  27. WCHAR m_szPath[MAX_PATH];
  28. DWORD m_dwSize;
  29. HANDLE m_hFile;
  30. HANDLE m_hMap;
  31. LPBYTE m_pBuf;
  32. LPBYTE m_pCur;
  33. DWORD m_dwAvail;
  34. };
  35. #endif //ndef __MFR_H_INCLUDED__