Commit 861bb8ee authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: Remove some useless comments.

parent f29674e8
...@@ -274,9 +274,7 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface( ...@@ -274,9 +274,7 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface(
{ {
OleAdviseHolderImpl *This = (OleAdviseHolderImpl *)iface; OleAdviseHolderImpl *This = (OleAdviseHolderImpl *)iface;
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObj); TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObj);
/*
* Sanity check
*/
if (ppvObj==NULL) if (ppvObj==NULL)
return E_POINTER; return E_POINTER;
...@@ -284,21 +282,16 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface( ...@@ -284,21 +282,16 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface(
if (IsEqualIID(riid, &IID_IUnknown)) if (IsEqualIID(riid, &IID_IUnknown))
{ {
/* IUnknown */
*ppvObj = This; *ppvObj = This;
} }
else if(IsEqualIID(riid, &IID_IOleAdviseHolder)) else if(IsEqualIID(riid, &IID_IOleAdviseHolder))
{ {
/* IOleAdviseHolder */
*ppvObj = This; *ppvObj = This;
} }
if(*ppvObj == NULL) if(*ppvObj == NULL)
return E_NOINTERFACE; return E_NOINTERFACE;
/*
* A successful QI always increments the reference count.
*/
IUnknown_AddRef((IUnknown*)*ppvObj); IUnknown_AddRef((IUnknown*)*ppvObj);
return S_OK; return S_OK;
...@@ -348,26 +341,17 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise( ...@@ -348,26 +341,17 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise(
TRACE("(%p)->(%p, %p)\n", This, pAdvise, pdwConnection); TRACE("(%p)->(%p, %p)\n", This, pAdvise, pdwConnection);
/*
* Sanity check
*/
if (pdwConnection==NULL) if (pdwConnection==NULL)
return E_POINTER; return E_POINTER;
*pdwConnection = 0; *pdwConnection = 0;
/*
* Find a free spot in the array.
*/
for (index = 0; index < This->maxSinks; index++) for (index = 0; index < This->maxSinks; index++)
{ {
if (This->arrayOfSinks[index]==NULL) if (This->arrayOfSinks[index]==NULL)
break; break;
} }
/*
* If the array is full, we need to grow it.
*/
if (index == This->maxSinks) if (index == This->maxSinks)
{ {
DWORD i; DWORD i;
...@@ -383,9 +367,6 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise( ...@@ -383,9 +367,6 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise(
This->arrayOfSinks[i]=0; This->arrayOfSinks[i]=0;
} }
/*
* Store the new sink
*/
This->arrayOfSinks[index] = pAdvise; This->arrayOfSinks[index] = pAdvise;
if (This->arrayOfSinks[index]!=NULL) if (This->arrayOfSinks[index]!=NULL)
...@@ -651,8 +632,6 @@ static void DataAdviseHolder_Destructor(DataAdviseHolder* ptrToDestroy) ...@@ -651,8 +632,6 @@ static void DataAdviseHolder_Destructor(DataAdviseHolder* ptrToDestroy)
/************************************************************************ /************************************************************************
* DataAdviseHolder_QueryInterface (IUnknown) * DataAdviseHolder_QueryInterface (IUnknown)
*
* See Windows documentation for more details on IUnknown methods.
*/ */
static HRESULT WINAPI DataAdviseHolder_QueryInterface( static HRESULT WINAPI DataAdviseHolder_QueryInterface(
IDataAdviseHolder* iface, IDataAdviseHolder* iface,
...@@ -661,47 +640,29 @@ static HRESULT WINAPI DataAdviseHolder_QueryInterface( ...@@ -661,47 +640,29 @@ static HRESULT WINAPI DataAdviseHolder_QueryInterface(
{ {
DataAdviseHolder *This = (DataAdviseHolder *)iface; DataAdviseHolder *This = (DataAdviseHolder *)iface;
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject); TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
/*
* Perform a sanity check on the parameters.
*/
if ( (This==0) || (ppvObject==0) ) if ( (This==0) || (ppvObject==0) )
return E_INVALIDARG; return E_INVALIDARG;
/*
* Initialize the return parameter.
*/
*ppvObject = 0; *ppvObject = 0;
/*
* Compare the riid with the interface IDs implemented by this object.
*/
if ( IsEqualIID(&IID_IUnknown, riid) || if ( IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IDataAdviseHolder, riid) ) IsEqualIID(&IID_IDataAdviseHolder, riid) )
{ {
*ppvObject = iface; *ppvObject = iface;
} }
/*
* Check that we obtained an interface.
*/
if ((*ppvObject)==0) if ((*ppvObject)==0)
{ {
return E_NOINTERFACE; return E_NOINTERFACE;
} }
/*
* Query Interface always increases the reference count by one when it is
* successful.
*/
IUnknown_AddRef((IUnknown*)*ppvObject); IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK; return S_OK;
} }
/************************************************************************ /************************************************************************
* DataAdviseHolder_AddRef (IUnknown) * DataAdviseHolder_AddRef (IUnknown)
*
* See Windows documentation for more details on IUnknown methods.
*/ */
static ULONG WINAPI DataAdviseHolder_AddRef( static ULONG WINAPI DataAdviseHolder_AddRef(
IDataAdviseHolder* iface) IDataAdviseHolder* iface)
...@@ -713,8 +674,6 @@ static ULONG WINAPI DataAdviseHolder_AddRef( ...@@ -713,8 +674,6 @@ static ULONG WINAPI DataAdviseHolder_AddRef(
/************************************************************************ /************************************************************************
* DataAdviseHolder_Release (IUnknown) * DataAdviseHolder_Release (IUnknown)
*
* See Windows documentation for more details on IUnknown methods.
*/ */
static ULONG WINAPI DataAdviseHolder_Release( static ULONG WINAPI DataAdviseHolder_Release(
IDataAdviseHolder* iface) IDataAdviseHolder* iface)
...@@ -723,14 +682,7 @@ static ULONG WINAPI DataAdviseHolder_Release( ...@@ -723,14 +682,7 @@ static ULONG WINAPI DataAdviseHolder_Release(
ULONG ref; ULONG ref;
TRACE("(%p) (ref=%d)\n", This, This->ref); TRACE("(%p) (ref=%d)\n", This, This->ref);
/*
* Decrease the reference count on this object.
*/
ref = InterlockedDecrement(&This->ref); ref = InterlockedDecrement(&This->ref);
/*
* If the reference count goes down to 0, perform suicide.
*/
if (ref==0) DataAdviseHolder_Destructor(This); if (ref==0) DataAdviseHolder_Destructor(This);
return ref; return ref;
...@@ -754,26 +706,18 @@ static HRESULT WINAPI DataAdviseHolder_Advise( ...@@ -754,26 +706,18 @@ static HRESULT WINAPI DataAdviseHolder_Advise(
TRACE("(%p)->(%p, %p, %08x, %p, %p)\n", This, pDataObject, pFetc, advf, TRACE("(%p)->(%p, %p, %08x, %p, %p)\n", This, pDataObject, pFetc, advf,
pAdvise, pdwConnection); pAdvise, pdwConnection);
/*
* Sanity check
*/
if (pdwConnection==NULL) if (pdwConnection==NULL)
return E_POINTER; return E_POINTER;
*pdwConnection = 0; *pdwConnection = 0;
/*
* Find a free spot in the array.
*/
for (index = 0; index < This->maxCons; index++) for (index = 0; index < This->maxCons; index++)
{ {
if (This->Connections[index].sink == NULL) if (This->Connections[index].sink == NULL)
break; break;
} }
/*
* If the array is full, we need to grow it.
*/
if (index == This->maxCons) if (index == This->maxCons)
{ {
This->maxCons+=INITIAL_SINKS; This->maxCons+=INITIAL_SINKS;
...@@ -781,9 +725,7 @@ static HRESULT WINAPI DataAdviseHolder_Advise( ...@@ -781,9 +725,7 @@ static HRESULT WINAPI DataAdviseHolder_Advise(
This->Connections, This->Connections,
This->maxCons*sizeof(DataAdviseConnection)); This->maxCons*sizeof(DataAdviseConnection));
} }
/*
* Store the new sink
*/
This->Connections[index].sink = pAdvise; This->Connections[index].sink = pAdvise;
This->Connections[index].advf = advf & ~WINE_ADVF_REMOTE; This->Connections[index].advf = advf & ~WINE_ADVF_REMOTE;
This->Connections[index].fmat = *pFetc; This->Connections[index].fmat = *pFetc;
...@@ -1010,9 +952,6 @@ HRESULT WINAPI CreateOleAdviseHolder( ...@@ -1010,9 +952,6 @@ HRESULT WINAPI CreateOleAdviseHolder(
{ {
TRACE("(%p)\n", ppOAHolder); TRACE("(%p)\n", ppOAHolder);
/*
* Sanity check,
*/
if (ppOAHolder==NULL) if (ppOAHolder==NULL)
return E_POINTER; return E_POINTER;
...@@ -1032,9 +971,6 @@ HRESULT WINAPI CreateDataAdviseHolder( ...@@ -1032,9 +971,6 @@ HRESULT WINAPI CreateDataAdviseHolder(
{ {
TRACE("(%p)\n", ppDAHolder); TRACE("(%p)\n", ppDAHolder);
/*
* Sanity check,
*/
if (ppDAHolder==NULL) if (ppDAHolder==NULL)
return E_POINTER; return E_POINTER;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment