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.

65 lines
1.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000.
  5. //
  6. // File: Mfr.h
  7. //
  8. // Contents: Class definition of CMappedFileRead class
  9. //
  10. //
  11. // Objects:
  12. //
  13. // Coupling:
  14. //
  15. // Notes:
  16. //
  17. // History: 03-May-2001 WeiyouC Copied from dev code and minor rewite
  18. //
  19. //----------------------------------------------------------------------------
  20. #ifndef __MFR_H_INCLUDED__
  21. #define __MFR_H_INCLUDED__
  22. #pragma once
  23. /////////////////////////////////////////////////////////////////////////////
  24. //
  25. // CMappedFileRead class
  26. //
  27. /////////////////////////////////////////////////////////////////////////////
  28. class CMappedFileRead
  29. {
  30. public:
  31. CMappedFileRead();
  32. ~CMappedFileRead();
  33. // Operations
  34. public:
  35. BOOL Open( LPCWSTR cszPath );
  36. void Close();
  37. BOOL Read( LPVOID pBuf, DWORD cbBuf );
  38. BOOL Read( DWORD *pdw );
  39. LPCWSTR ReadStrAnsi( DWORD cbStr );
  40. BOOL ReadDynStrW( LPWSTR szBuf, DWORD cchMax );
  41. protected:
  42. // Attributes
  43. public:
  44. DWORD GetAvail() { return( m_dwAvail ); }
  45. protected:
  46. WCHAR m_szPath[MAX_PATH];
  47. DWORD m_dwSize;
  48. HANDLE m_hFile;
  49. HANDLE m_hMap;
  50. LPBYTE m_pBuf;
  51. LPBYTE m_pCur;
  52. DWORD m_dwAvail;
  53. };
  54. #endif //ndef __MFR_H_INCLUDED__