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.
 
 
 
 
 
 

88 lines
2.1 KiB

//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1995.
//
// File: CLOCKBYT.CXX
//
// Contents:
//
// Classes: Implements the ILockBytes base class.
//
// Functions:
//
// History: 12-01-95 JoeS (Joe Souza) Created
//
//----------------------------------------------------------------------------
#include <urlint.h>
#include <urlmon.hxx>
#include "clockbyt.hxx"
CLockBytes::CLockBytes() : _CRefs()
{
}
STDMETHODIMP CLockBytes::QueryInterface
(REFIID riid, LPVOID FAR* ppvObj)
{
VDATETHIS(this);
UrlMkDebugOut((DEB_ILOCKBYTES, "%p IN CLockBytes::QueryInterface\n", this));
HRESULT hresult = NOERROR;
if ( IsEqualIID(riid, IID_IUnknown)
|| IsEqualIID(riid, IID_ILockBytes)
)
{
*ppvObj = this;
}
else
{
*ppvObj = NULL;
hresult = E_NOINTERFACE;
}
if (*ppvObj)
AddRef();
UrlMkDebugOut((DEB_ILOCKBYTES, "%p OUT CLockBytes::QueryInterface\n", this));
return hresult;
}
STDMETHODIMP_(ULONG) CLockBytes::AddRef(void)
{
VDATETHIS(this);
UrlMkDebugOut((DEB_ILOCKBYTES, "%p IN CLockBytes::AddRef\n", this));
LONG lRet = ++_CRefs;
UrlMkDebugOut((DEB_ILOCKBYTES, "%p OUT CLockBytes::AddRef\n", this));
return lRet;
}
HRESULT CLockBytes::Flush()
{
UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::Flush (NoOp)\n", this));
return(NOERROR);
}
HRESULT CLockBytes::LockRegion(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb,
DWORD dwLockType)
{
UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::LockRegion (NoOp)\n", this));
return(NOERROR);
}
HRESULT CLockBytes::UnlockRegion(THIS_ ULARGE_INTEGER libOffset,
ULARGE_INTEGER cb, DWORD dwLockType)
{
UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::UnlockRegion (NoOp)\n", this));
return(NOERROR);
}
HRESULT CLockBytes::Stat(THIS_ STATSTG FAR *pStatStg, DWORD grfStatFlag)
{
UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::Stat (NoOp)\n", this));
return(STG_E_UNKNOWN);
}