home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / vm / src / vmlockc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-15  |  937 b   |  44 lines

  1. /***
  2. * vmlockc.c -
  3. *
  4. *       Copyright (c) 1989-1992, Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *
  8. * PUBLIC Functions:
  9. *
  10. *       CVmLockVp:
  11. *       This function returns the lock count for the page containing
  12. *       the specified virtual address.  If the page is not locked, the
  13. *       function will return 0.
  14. *
  15. *******************************************************************************/
  16.  
  17. #pragma title("Virtual Memory Manager")
  18. #pragma subtitle("Locking functions")
  19.  
  20. #include <version.h>
  21. #include <vmassert.h>
  22. #include <system.h>
  23. #include <error.h>
  24. #include <vm.h>
  25. #include <vmp.h>
  26.  
  27. #include <stddef.h>
  28.  
  29.  
  30. #pragma page()
  31.  
  32. unsigned PUBLIC __CVmLockVp(VPVOID vp)
  33. {
  34.    HPGD  hpgd;
  35.  
  36.    VmTracePrintf(("CVmLockVp: vp = %08lX.\n", vp));
  37.  
  38.    Assert((vp >= vpptMax) && (vp < vpMax));
  39.  
  40.    hpgd = __HpgdSearchCache(vp);
  41.  
  42.    return((hpgd == hpgdNil) ? 0 : PpgdOfHpgd(hpgd)->cLock);
  43. }
  44.