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.

79 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. seolock.cpp
  5. Abstract:
  6. This module contains the implementation for the Server
  7. Extension Object CEventLock class.
  8. Author:
  9. Don Dumitru (dondu@microsoft.com)
  10. Revision History:
  11. dondu 03/06/97 created
  12. dondu 04/07/97 changed to IEventLock and CEventLock
  13. --*/
  14. // seolock.cpp : Implementation of CEventLock
  15. #include "stdafx.h"
  16. #include "seodefs.h"
  17. #include "rwnew.h"
  18. #include "seolock.h"
  19. HRESULT CEventLock::FinalConstruct() {
  20. HRESULT hrRes;
  21. TraceFunctEnter("CEventLock::FinalConstruct");
  22. hrRes = CoCreateFreeThreadedMarshaler(GetControllingUnknown(),&m_pUnkMarshaler.p);
  23. _ASSERTE(!SUCCEEDED(hrRes)||m_pUnkMarshaler);
  24. TraceFunctLeave();
  25. return (SUCCEEDED(hrRes)?S_OK:hrRes);
  26. }
  27. void CEventLock::FinalRelease() {
  28. TraceFunctEnter("CEventLock::FinalRelease");
  29. m_pUnkMarshaler.Release();
  30. TraceFunctLeave();
  31. }
  32. HRESULT CEventLock::LockRead(int iTimeoutMS) {
  33. m_lock.ShareLock();
  34. // tbd - implement timeouts
  35. return (S_OK);
  36. }
  37. HRESULT CEventLock::UnlockRead() {
  38. m_lock.ShareUnlock();
  39. return (S_OK);
  40. }
  41. HRESULT CEventLock::LockWrite(int iTimeoutMS) {
  42. m_lock.ExclusiveLock();
  43. return (S_OK);
  44. }
  45. HRESULT CEventLock::UnlockWrite() {
  46. m_lock.ExclusiveUnlock();
  47. // tbd - implement timeouts
  48. return (S_OK);
  49. }