qmgr: Added missing argument tracing, method naming made more compact.

This commit is contained in:
Nikolay Sivov 2013-11-26 13:22:09 +04:00 committed by Alexandre Julliard
parent c132ed8d5b
commit a124e927fa
3 changed files with 85 additions and 57 deletions

View File

@ -37,10 +37,12 @@ static inline EnumBackgroundCopyFilesImpl *impl_from_IEnumBackgroundCopyFiles(IE
return CONTAINING_RECORD(iface, EnumBackgroundCopyFilesImpl, IEnumBackgroundCopyFiles_iface);
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_QueryInterface(IEnumBackgroundCopyFiles *iface,
static HRESULT WINAPI EnumBackgroundCopyFiles_QueryInterface(IEnumBackgroundCopyFiles *iface,
REFIID riid, void **ppv)
{
TRACE("(%p,%s,%p)\n", iface, debugstr_guid(riid), ppv);
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumBackgroundCopyFiles))
{
@ -53,21 +55,23 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_QueryInterface(IEnumBackgrou
return E_NOINTERFACE;
}
static ULONG WINAPI BITS_IEnumBackgroundCopyFiles_AddRef(IEnumBackgroundCopyFiles *iface)
static ULONG WINAPI EnumBackgroundCopyFiles_AddRef(IEnumBackgroundCopyFiles *iface)
{
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
TRACE("(%p)->(%d)\n", This, ref);
return ref;
}
static ULONG WINAPI BITS_IEnumBackgroundCopyFiles_Release(IEnumBackgroundCopyFiles *iface)
static ULONG WINAPI EnumBackgroundCopyFiles_Release(IEnumBackgroundCopyFiles *iface)
{
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
ULONG ref = InterlockedDecrement(&This->ref);
ULONG i;
TRACE("(%p)->(%d)\n", This, ref);
if (ref == 0)
{
for(i = 0; i < This->numFiles; i++)
@ -80,7 +84,7 @@ static ULONG WINAPI BITS_IEnumBackgroundCopyFiles_Release(IEnumBackgroundCopyFil
}
/* Return reference to one or more files in the file enumerator */
static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_Next(IEnumBackgroundCopyFiles *iface,
static HRESULT WINAPI EnumBackgroundCopyFiles_Next(IEnumBackgroundCopyFiles *iface,
ULONG celt, IBackgroundCopyFile **rgelt, ULONG *pceltFetched)
{
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
@ -88,6 +92,8 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_Next(IEnumBackgroundCopyFile
ULONG i;
IBackgroundCopyFile *file;
TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched);
/* Despite documented behavior, Windows (tested on XP) is not verifying
that the caller set pceltFetched to zero. No check here. */
@ -118,11 +124,13 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_Next(IEnumBackgroundCopyFile
}
/* Skip over one or more files in the file enumerator */
static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_Skip(IEnumBackgroundCopyFiles *iface,
static HRESULT WINAPI EnumBackgroundCopyFiles_Skip(IEnumBackgroundCopyFiles *iface,
ULONG celt)
{
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
TRACE("(%p)->(%d)\n", This, celt);
if (celt > This->numFiles - This->indexFiles)
{
This->indexFiles = This->numFiles;
@ -133,38 +141,43 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_Skip(IEnumBackgroundCopyFile
return S_OK;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_Reset(IEnumBackgroundCopyFiles *iface)
static HRESULT WINAPI EnumBackgroundCopyFiles_Reset(IEnumBackgroundCopyFiles *iface)
{
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
TRACE("(%p)\n", This);
This->indexFiles = 0;
return S_OK;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_Clone(IEnumBackgroundCopyFiles *iface,
static HRESULT WINAPI EnumBackgroundCopyFiles_Clone(IEnumBackgroundCopyFiles *iface,
IEnumBackgroundCopyFiles **ppenum)
{
FIXME("Not implemented\n");
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
FIXME("(%p)->(%p): stub\n", This, ppenum);
return E_NOTIMPL;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyFiles_GetCount(IEnumBackgroundCopyFiles *iface,
static HRESULT WINAPI EnumBackgroundCopyFiles_GetCount(IEnumBackgroundCopyFiles *iface,
ULONG *puCount)
{
EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface);
TRACE("(%p)->(%p)\n", This, puCount);
*puCount = This->numFiles;
return S_OK;
}
static const IEnumBackgroundCopyFilesVtbl BITS_IEnumBackgroundCopyFiles_Vtbl =
static const IEnumBackgroundCopyFilesVtbl EnumBackgroundCopyFilesVtbl =
{
BITS_IEnumBackgroundCopyFiles_QueryInterface,
BITS_IEnumBackgroundCopyFiles_AddRef,
BITS_IEnumBackgroundCopyFiles_Release,
BITS_IEnumBackgroundCopyFiles_Next,
BITS_IEnumBackgroundCopyFiles_Skip,
BITS_IEnumBackgroundCopyFiles_Reset,
BITS_IEnumBackgroundCopyFiles_Clone,
BITS_IEnumBackgroundCopyFiles_GetCount
EnumBackgroundCopyFiles_QueryInterface,
EnumBackgroundCopyFiles_AddRef,
EnumBackgroundCopyFiles_Release,
EnumBackgroundCopyFiles_Next,
EnumBackgroundCopyFiles_Skip,
EnumBackgroundCopyFiles_Reset,
EnumBackgroundCopyFiles_Clone,
EnumBackgroundCopyFiles_GetCount
};
HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl *job, IEnumBackgroundCopyFiles **enum_files)
@ -179,7 +192,7 @@ HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl *job, IEnumBack
if (!This)
return E_OUTOFMEMORY;
This->IEnumBackgroundCopyFiles_iface.lpVtbl = &BITS_IEnumBackgroundCopyFiles_Vtbl;
This->IEnumBackgroundCopyFiles_iface.lpVtbl = &EnumBackgroundCopyFilesVtbl;
This->ref = 1;
/* Create array of files */

View File

@ -37,10 +37,12 @@ static inline EnumBackgroundCopyJobsImpl *impl_from_IEnumBackgroundCopyJobs(IEnu
return CONTAINING_RECORD(iface, EnumBackgroundCopyJobsImpl, IEnumBackgroundCopyJobs_iface);
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_QueryInterface(IEnumBackgroundCopyJobs *iface,
static HRESULT WINAPI EnumBackgroundCopyJobs_QueryInterface(IEnumBackgroundCopyJobs *iface,
REFIID riid, void **ppv)
{
TRACE("(%p,%s,%p)\n", iface, debugstr_guid(riid), ppv);
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumBackgroundCopyJobs))
{
@ -53,23 +55,23 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_QueryInterface(IEnumBackgroun
return E_NOINTERFACE;
}
static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_AddRef(IEnumBackgroundCopyJobs *iface)
static ULONG WINAPI EnumBackgroundCopyJobs_AddRef(IEnumBackgroundCopyJobs *iface)
{
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
TRACE("(%p)->(%d)\n", This, ref);
return ref;
}
static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_Release(IEnumBackgroundCopyJobs *iface)
static ULONG WINAPI EnumBackgroundCopyJobs_Release(IEnumBackgroundCopyJobs *iface)
{
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
ULONG ref = InterlockedDecrement(&This->ref);
ULONG i;
TRACE("(%p) ref=%d\n", This, ref);
TRACE("(%p)->(%d)\n", This, ref);
if (ref == 0) {
for(i = 0; i < This->numJobs; i++)
@ -81,7 +83,7 @@ static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_Release(IEnumBackgroundCopyJobs
return ref;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs *iface, ULONG celt,
static HRESULT WINAPI EnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs *iface, ULONG celt,
IBackgroundCopyJob **rgelt, ULONG *pceltFetched)
{
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
@ -89,6 +91,8 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs
ULONG i;
IBackgroundCopyJob *job;
TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched);
fetched = min(celt, This->numJobs - This->indexJobs);
if (pceltFetched)
*pceltFetched = fetched;
@ -115,10 +119,12 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs
return fetched == celt ? S_OK : S_FALSE;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Skip(IEnumBackgroundCopyJobs *iface, ULONG celt)
static HRESULT WINAPI EnumBackgroundCopyJobs_Skip(IEnumBackgroundCopyJobs *iface, ULONG celt)
{
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
TRACE("(%p)->(%d)\n", This, celt);
if (This->numJobs - This->indexJobs < celt)
{
This->indexJobs = This->numJobs;
@ -129,38 +135,45 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Skip(IEnumBackgroundCopyJobs
return S_OK;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Reset(IEnumBackgroundCopyJobs *iface)
static HRESULT WINAPI EnumBackgroundCopyJobs_Reset(IEnumBackgroundCopyJobs *iface)
{
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
TRACE("(%p)\n", This);
This->indexJobs = 0;
return S_OK;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Clone(IEnumBackgroundCopyJobs *iface,
static HRESULT WINAPI EnumBackgroundCopyJobs_Clone(IEnumBackgroundCopyJobs *iface,
IEnumBackgroundCopyJobs **ppenum)
{
FIXME("Not implemented\n");
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
FIXME("(%p)->(%p): stub\n", This, ppenum);
return E_NOTIMPL;
}
static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_GetCount(IEnumBackgroundCopyJobs *iface,
static HRESULT WINAPI EnumBackgroundCopyJobs_GetCount(IEnumBackgroundCopyJobs *iface,
ULONG *puCount)
{
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
TRACE("(%p)->(%p)\n", This, puCount);
*puCount = This->numJobs;
return S_OK;
}
static const IEnumBackgroundCopyJobsVtbl BITS_IEnumBackgroundCopyJobs_Vtbl =
static const IEnumBackgroundCopyJobsVtbl EnumBackgroundCopyJobsVtbl =
{
BITS_IEnumBackgroundCopyJobs_QueryInterface,
BITS_IEnumBackgroundCopyJobs_AddRef,
BITS_IEnumBackgroundCopyJobs_Release,
BITS_IEnumBackgroundCopyJobs_Next,
BITS_IEnumBackgroundCopyJobs_Skip,
BITS_IEnumBackgroundCopyJobs_Reset,
BITS_IEnumBackgroundCopyJobs_Clone,
BITS_IEnumBackgroundCopyJobs_GetCount
EnumBackgroundCopyJobs_QueryInterface,
EnumBackgroundCopyJobs_AddRef,
EnumBackgroundCopyJobs_Release,
EnumBackgroundCopyJobs_Next,
EnumBackgroundCopyJobs_Skip,
EnumBackgroundCopyJobs_Reset,
EnumBackgroundCopyJobs_Clone,
EnumBackgroundCopyJobs_GetCount
};
HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCopyJobs **enumjob)
@ -174,7 +187,7 @@ HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCop
This = HeapAlloc(GetProcessHeap(), 0, sizeof *This);
if (!This)
return E_OUTOFMEMORY;
This->IEnumBackgroundCopyJobs_iface.lpVtbl = &BITS_IEnumBackgroundCopyJobs_Vtbl;
This->IEnumBackgroundCopyJobs_iface.lpVtbl = &EnumBackgroundCopyJobsVtbl;
This->ref = 1;
/* Create array of jobs */

View File

@ -40,7 +40,7 @@ static inline BackgroundCopyFileImpl *impl_from_IBackgroundCopyFile(IBackgroundC
return CONTAINING_RECORD(iface, BackgroundCopyFileImpl, IBackgroundCopyFile_iface);
}
static HRESULT WINAPI BITS_IBackgroundCopyFile_QueryInterface(
static HRESULT WINAPI BackgroundCopyFile_QueryInterface(
IBackgroundCopyFile* iface,
REFIID riid,
void **obj)
@ -61,7 +61,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_QueryInterface(
return E_NOINTERFACE;
}
static ULONG WINAPI BITS_IBackgroundCopyFile_AddRef(IBackgroundCopyFile* iface)
static ULONG WINAPI BackgroundCopyFile_AddRef(IBackgroundCopyFile* iface)
{
BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface);
ULONG ref = InterlockedIncrement(&This->ref);
@ -69,7 +69,7 @@ static ULONG WINAPI BITS_IBackgroundCopyFile_AddRef(IBackgroundCopyFile* iface)
return ref;
}
static ULONG WINAPI BITS_IBackgroundCopyFile_Release(
static ULONG WINAPI BackgroundCopyFile_Release(
IBackgroundCopyFile* iface)
{
BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface);
@ -89,7 +89,7 @@ static ULONG WINAPI BITS_IBackgroundCopyFile_Release(
}
/* Get the remote name of a background copy file */
static HRESULT WINAPI BITS_IBackgroundCopyFile_GetRemoteName(
static HRESULT WINAPI BackgroundCopyFile_GetRemoteName(
IBackgroundCopyFile* iface,
LPWSTR *pVal)
{
@ -100,7 +100,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetRemoteName(
return return_strval(This->info.RemoteName, pVal);
}
static HRESULT WINAPI BITS_IBackgroundCopyFile_GetLocalName(
static HRESULT WINAPI BackgroundCopyFile_GetLocalName(
IBackgroundCopyFile* iface,
LPWSTR *pVal)
{
@ -111,12 +111,14 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetLocalName(
return return_strval(This->info.LocalName, pVal);
}
static HRESULT WINAPI BITS_IBackgroundCopyFile_GetProgress(
static HRESULT WINAPI BackgroundCopyFile_GetProgress(
IBackgroundCopyFile* iface,
BG_FILE_PROGRESS *pVal)
{
BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface);
TRACE("(%p)->(%p)\n", This, pVal);
EnterCriticalSection(&This->owner->cs);
pVal->BytesTotal = This->fileProgress.BytesTotal;
pVal->BytesTransferred = This->fileProgress.BytesTransferred;
@ -126,14 +128,14 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetProgress(
return S_OK;
}
static const IBackgroundCopyFileVtbl BITS_IBackgroundCopyFile_Vtbl =
static const IBackgroundCopyFileVtbl BackgroundCopyFileVtbl =
{
BITS_IBackgroundCopyFile_QueryInterface,
BITS_IBackgroundCopyFile_AddRef,
BITS_IBackgroundCopyFile_Release,
BITS_IBackgroundCopyFile_GetRemoteName,
BITS_IBackgroundCopyFile_GetLocalName,
BITS_IBackgroundCopyFile_GetProgress
BackgroundCopyFile_QueryInterface,
BackgroundCopyFile_AddRef,
BackgroundCopyFile_Release,
BackgroundCopyFile_GetRemoteName,
BackgroundCopyFile_GetLocalName,
BackgroundCopyFile_GetProgress
};
HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
@ -168,7 +170,7 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
}
memcpy(This->info.LocalName, localName, n);
This->IBackgroundCopyFile_iface.lpVtbl = &BITS_IBackgroundCopyFile_Vtbl;
This->IBackgroundCopyFile_iface.lpVtbl = &BackgroundCopyFileVtbl;
This->ref = 1;
This->fileProgress.BytesTotal = BG_SIZE_UNKNOWN;