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.

38 lines
1.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: lock.hxx
  7. //
  8. // Contents: Function definitions for remote exclusion functions
  9. //
  10. // History: 09-Mar-92 PhilipLa Created.
  11. //
  12. //--------------------------------------------------------------------------
  13. #ifndef __LOCK_HXX__
  14. #define __LOCK_HXX__
  15. #define NOLOCK 0x0
  16. SCODE GetAccess(ILockBytes *plst, DFLAGS df, ULONG *poReturn);
  17. void ReleaseAccess(ILockBytes *plst, DFLAGS df, ULONG offset);
  18. SCODE GetOpen(ILockBytes *plst, DFLAGS df, BOOL fCheck, ULONG *puReturn);
  19. void ReleaseOpen(ILockBytes *plst, DFLAGS df, ULONG offset);
  20. // For 32-bit builds we also provide a function that will repeatedly
  21. // attempt to get access locks for gracefully handling contention
  22. // Since waiting is virtually impossible in the 16-bit world, it doesn't
  23. // attempt it
  24. #if defined(FLAT)
  25. SCODE WaitForAccess(ILockBytes *plst, DFLAGS df, ULONG *poReturn);
  26. #else
  27. #define WaitForAccess(plst, df, poReturn) GetAccess(plst, df, poReturn)
  28. #endif
  29. #define IsInRangeLocks(iBegin, cbBuffer) \
  30. ((iBegin + cbBuffer > OLOCKREGIONBEGIN) && \
  31. (iBegin <= OLOCKREGIONEND) )
  32. #endif // #ifndef __LOCK_HXX__