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.

75 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: ilbmem.hxx
  7. //
  8. // Contents: ILockBytes memory implementation
  9. //
  10. // Classes: CMapBytes
  11. //
  12. // History: 30-Oct-92 AlexT Created
  13. //
  14. //--------------------------------------------------------------------------
  15. #ifndef __ILB_HXX__
  16. //#include <dfmsp.hxx> // Pick up UL64 support
  17. #define ULISetLow(li, v) ((li).LowPart = (v))
  18. #define ULISetHigh(li, v) ((li).HighPart = (v))
  19. #define ULIGetLow(li) ((li).LowPart)
  20. #define ULIGetHigh(li) ((li).HighPart)
  21. #define AtomicInc(lp) InterlockedIncrement(lp)
  22. #define AtomicDec(lp) InterlockedDecrement(lp)
  23. #if DBG == 1
  24. DECLARE_DEBUG(ol);
  25. #define olDebugOut(parms) olInlineDebugOut parms
  26. #define olAssert(exp) Win4Assert(exp)
  27. #else // DBG != 1
  28. #define olDebugOut(parms)
  29. #define olAssert(exp)
  30. #endif // DBG == 1
  31. class CMapBytes : public ILockBytes
  32. {
  33. public:
  34. CMapBytes(void);
  35. STDMETHOD(QueryInterface) (REFIID riid, LPVOID FAR* ppvObj);
  36. STDMETHOD_(ULONG,AddRef) (void);
  37. STDMETHOD_(ULONG,Release) (void);
  38. STDMETHOD(ReadAt) (ULARGE_INTEGER ulOffset,
  39. VOID HUGEP *pv,
  40. ULONG cb,
  41. ULONG FAR *pcbRead);
  42. STDMETHOD(WriteAt) (ULARGE_INTEGER ulOffset,
  43. VOID const HUGEP *pv,
  44. ULONG cb,
  45. ULONG FAR *pcbWritten);
  46. STDMETHOD(Flush) (void);
  47. STDMETHOD(GetSize) (ULARGE_INTEGER FAR *pcb);
  48. STDMETHOD(SetSize) (ULARGE_INTEGER cb);
  49. STDMETHOD(LockRegion) (ULARGE_INTEGER libOffset,
  50. ULARGE_INTEGER cb,
  51. DWORD dwLockType);
  52. STDMETHOD(UnlockRegion) (ULARGE_INTEGER libOffset,
  53. ULARGE_INTEGER cb,
  54. DWORD dwLockType);
  55. STDMETHOD(Stat) (STATSTG FAR *pstatstg, DWORD grfStatFlag);
  56. private:
  57. LONG _ulRef; // reference count
  58. ULONG _ulSize; // memory map size
  59. void FAR *_pv; // memory map
  60. };
  61. #endif // #ifndef __ILB_HXX__