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.

60 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: ROSTMFIL.HXX
  7. //
  8. // Contents:
  9. //
  10. // Classes: Declaration for CReadOnlyStreamFile class
  11. //
  12. // Functions:
  13. //
  14. // History: 03-02-96 JoeS (Joe Souza) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. class FAR CReadOnlyStreamFile : public CReadOnlyStreamDirect
  18. {
  19. public:
  20. static HRESULT Create(LPSTR pszFileName, CReadOnlyStreamFile **ppCRoStm, LPCWSTR pwzURL);
  21. CReadOnlyStreamFile(LPSTR pszFileName, HANDLE handle, LPWSTR pwzURL);
  22. virtual ~CReadOnlyStreamFile(void);
  23. // *** IStream methods ***
  24. STDMETHOD(Read) (THIS_ VOID HUGEP *pv, ULONG cb, ULONG FAR *pcbRead);
  25. STDMETHOD(Seek) (THIS_ LARGE_INTEGER dlibMove, DWORD dwOrigin,
  26. ULARGE_INTEGER FAR *plibNewPosition);
  27. STDMETHOD(CopyTo) (THIS_ LPSTREAM pStm, ULARGE_INTEGER cb,
  28. ULARGE_INTEGER FAR *pcbRead, ULARGE_INTEGER FAR *pcbWritten);
  29. STDMETHOD(LockRegion) (THIS_ ULARGE_INTEGER libOffset,
  30. ULARGE_INTEGER cb, DWORD dwLockType);
  31. STDMETHOD(UnlockRegion) (THIS_ ULARGE_INTEGER libOffset,
  32. ULARGE_INTEGER cb, DWORD dwLockType);
  33. STDMETHOD(Stat) (THIS_ STATSTG FAR *pStatStg, DWORD grfStatFlag);
  34. STDMETHOD(Clone) (THIS_ LPSTREAM FAR *ppStm);
  35. // *** IWinInetFileStream ***
  36. STDMETHOD(SetHandleForUnlock)(THIS_ DWORD_PTR hWinInetLockHandle, DWORD_PTR dwReserved);
  37. STDMETHOD(SetDeleteFile)(THIS_ DWORD_PTR dwReserved);
  38. void SetDataFullyAvailable()
  39. {
  40. _fDataFullyAvailable = TRUE;
  41. }
  42. private:
  43. LPWSTR GetFileName();
  44. private:
  45. LPSTR _pszFileName;
  46. HANDLE _hFileHandle;
  47. BOOL _fDataFullyAvailable;
  48. LPWSTR _pwzURL;
  49. BOOL _fDeleteFile;
  50. HANDLE _hWinInetLockHandle;
  51. };