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.

80 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: filelkb.hxx
  7. //
  8. // Contents: File ILockBytes class for async docfile
  9. //
  10. // Classes: CFileLockBytes
  11. //
  12. // Functions:
  13. //
  14. // History: 19-Dec-95 PhilipLa Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __FILELKB_HXX__
  18. #define __FILELKB_HXX__
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Class: CFileLockBytes
  22. //
  23. // Purpose:
  24. //
  25. // Interface:
  26. //
  27. // History: 28-Dec-95 PhilipLa Created
  28. //
  29. // Notes:
  30. //
  31. //----------------------------------------------------------------------------
  32. class CFileLockBytes: public ILockBytes
  33. {
  34. public:
  35. CFileLockBytes();
  36. ~CFileLockBytes();
  37. SCODE Init(OLECHAR const *pwcsName);
  38. // IUnknown
  39. STDMETHOD(QueryInterface)(REFIID iid, void **ppvObj);
  40. STDMETHOD_(ULONG, AddRef)(void);
  41. STDMETHOD_(ULONG, Release)(void);
  42. // ILockBytes
  43. STDMETHOD(ReadAt)(ULARGE_INTEGER ulOffset,
  44. VOID HUGEP *pv,
  45. ULONG cb,
  46. ULONG *pcbRead);
  47. STDMETHOD(WriteAt)(ULARGE_INTEGER ulOffset,
  48. VOID const HUGEP *pv,
  49. ULONG cb,
  50. ULONG *pcbWritten);
  51. STDMETHOD(Flush)(void);
  52. STDMETHOD(SetSize)(ULARGE_INTEGER cb);
  53. STDMETHOD(LockRegion)(ULARGE_INTEGER libOffset,
  54. ULARGE_INTEGER cb,
  55. DWORD dwLockType);
  56. STDMETHOD(UnlockRegion)(ULARGE_INTEGER libOffset,
  57. ULARGE_INTEGER cb,
  58. DWORD dwLockType);
  59. STDMETHOD(Stat)(STATSTG *pstatstg, DWORD grfStatFlag);
  60. private:
  61. LONG _cReferences;
  62. CRITICAL_SECTION _cs;
  63. HANDLE _h;
  64. OLECHAR _acName[MAX_PATH + 1];
  65. };
  66. SCODE Win32ErrorToScode(DWORD dwErr);
  67. #endif // #ifndef __FILELKB_HXX__