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
79 lines
1.3 KiB
/*++
|
|
|
|
Copyright (c) 1996 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
seolock.cpp
|
|
|
|
Abstract:
|
|
|
|
This module contains the implementation for the Server
|
|
Extension Object CEventLock class.
|
|
|
|
Author:
|
|
|
|
Don Dumitru ([email protected])
|
|
|
|
Revision History:
|
|
|
|
dondu 03/06/97 created
|
|
dondu 04/07/97 changed to IEventLock and CEventLock
|
|
|
|
--*/
|
|
|
|
|
|
// seolock.cpp : Implementation of CEventLock
|
|
#include "stdafx.h"
|
|
#include "seodefs.h"
|
|
#include "rwnew.h"
|
|
#include "seolock.h"
|
|
|
|
|
|
HRESULT CEventLock::FinalConstruct() {
|
|
HRESULT hrRes;
|
|
TraceFunctEnter("CEventLock::FinalConstruct");
|
|
|
|
hrRes = CoCreateFreeThreadedMarshaler(GetControllingUnknown(),&m_pUnkMarshaler.p);
|
|
_ASSERTE(!SUCCEEDED(hrRes)||m_pUnkMarshaler);
|
|
TraceFunctLeave();
|
|
return (SUCCEEDED(hrRes)?S_OK:hrRes);
|
|
}
|
|
|
|
|
|
void CEventLock::FinalRelease() {
|
|
TraceFunctEnter("CEventLock::FinalRelease");
|
|
|
|
m_pUnkMarshaler.Release();
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
|
|
HRESULT CEventLock::LockRead(int iTimeoutMS) {
|
|
|
|
m_lock.ShareLock();
|
|
// tbd - implement timeouts
|
|
return (S_OK);
|
|
}
|
|
|
|
|
|
HRESULT CEventLock::UnlockRead() {
|
|
|
|
m_lock.ShareUnlock();
|
|
return (S_OK);
|
|
}
|
|
|
|
|
|
HRESULT CEventLock::LockWrite(int iTimeoutMS) {
|
|
|
|
m_lock.ExclusiveLock();
|
|
return (S_OK);
|
|
}
|
|
|
|
|
|
HRESULT CEventLock::UnlockWrite() {
|
|
|
|
m_lock.ExclusiveUnlock();
|
|
// tbd - implement timeouts
|
|
return (S_OK);
|
|
}
|