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.

66 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name :
  4. FInStrm.h
  5. Abstract:
  6. A lightweight implementation of input streams using files
  7. Author:
  8. Neil Allain ( a-neilal ) August-1997
  9. Revision History:
  10. --*/
  11. #pragma once
  12. #include "InStrm.h"
  13. #include "except.h"
  14. #include "eh.h"
  15. class FileInStream : public InStream
  16. {
  17. public:
  18. FileInStream();
  19. HRESULT Init( LPCTSTR );
  20. ~FileInStream();
  21. HRESULT CreateFileMapping ();
  22. void UnMapFile();
  23. virtual HRESULT readChar( _TCHAR& );
  24. virtual HRESULT read( CharCheck&, String& );
  25. virtual HRESULT skip( CharCheck& );
  26. virtual HRESULT back( size_t );
  27. bool is_open() const { return m_bIsOpen; }
  28. HANDLE handle() const { return m_hFile; }
  29. bool is_UTF8() const { return m_bIsUTF8; }
  30. bool ReadMappedFile(LPVOID buff, DWORD countOfBytes, LPDWORD BytesRead);
  31. void SetCurrFilePointer(LONG DistToMove, PLONG DistToMoveH, DWORD refPoint);
  32. private:
  33. HANDLE m_hFile;
  34. HANDLE m_hMap;
  35. bool m_bIsOpen;
  36. bool m_bIsUTF8;
  37. bool m_fInited;
  38. BYTE* m_pbStartOfFile;
  39. LONG m_cbCurrOffset;
  40. LONG m_cbFileSize;
  41. };
  42. class IPIOException
  43. {
  44. private :
  45. unsigned int nSE;
  46. public :
  47. IPIOException () : nSE(0) {}
  48. IPIOException (unsigned int n) : nSE(n) {}
  49. ~IPIOException () {}
  50. unsigned int getSeNumber () {return nSE;}
  51. };
  52. void __cdecl poi_Capture(unsigned int u, _EXCEPTION_POINTERS* pExp);