From ae525c1441189a0b03306c926282cd0cd205c5ef Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 10 Jun 2006 11:59:15 +0200 Subject: [PATCH] ole32: Make the virtual table functions static where possible. --- dlls/ole32/memlockbytes.c | 105 +++++++++++--------------------------- dlls/ole32/storage32.c | 56 ++++++++++---------- dlls/ole32/storage32.h | 7 --- 3 files changed, 58 insertions(+), 110 deletions(-) diff --git a/dlls/ole32/memlockbytes.c b/dlls/ole32/memlockbytes.c index c2297a55806..32edbc69fdc 100644 --- a/dlls/ole32/memlockbytes.c +++ b/dlls/ole32/memlockbytes.c @@ -87,71 +87,9 @@ HGLOBALLockBytesImpl* HGLOBALLockBytesImpl_Construct( void HGLOBALLockBytesImpl_Destroy(HGLOBALLockBytesImpl* This); -HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface( - ILockBytes* iface, - REFIID riid, /* [in] */ - void** ppvObject); /* [iid_is][out] */ +static HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( ILockBytes* iface, ULARGE_INTEGER libNewSize ); -ULONG WINAPI HGLOBALLockBytesImpl_AddRef( - ILockBytes* iface); - -ULONG WINAPI HGLOBALLockBytesImpl_Release( - ILockBytes* iface); - -HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt( - ILockBytes* iface, - ULARGE_INTEGER ulOffset, /* [in] */ - void* pv, /* [length_is][size_is][out] */ - ULONG cb, /* [in] */ - ULONG* pcbRead); /* [out] */ - -HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt( - ILockBytes* iface, - ULARGE_INTEGER ulOffset, /* [in] */ - const void* pv, /* [size_is][in] */ - ULONG cb, /* [in] */ - ULONG* pcbWritten); /* [out] */ - -HRESULT WINAPI HGLOBALLockBytesImpl_Flush( - ILockBytes* iface); - -HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( - ILockBytes* iface, - ULARGE_INTEGER libNewSize); /* [in] */ - -HRESULT WINAPI HGLOBALLockBytesImpl_LockRegion( - ILockBytes* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType); /* [in] */ - -HRESULT WINAPI HGLOBALLockBytesImpl_UnlockRegion( - ILockBytes* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType); /* [in] */ - -HRESULT WINAPI HGLOBALLockBytesImpl_Stat( - ILockBytes* iface, - STATSTG* pstatstg, /* [out] */ - DWORD grfStatFlag); /* [in] */ - -/* - * Virtual function table for the HGLOBALLockBytesImpl class. - */ -static const ILockBytesVtbl HGLOBALLockBytesImpl_Vtbl = -{ - HGLOBALLockBytesImpl_QueryInterface, - HGLOBALLockBytesImpl_AddRef, - HGLOBALLockBytesImpl_Release, - HGLOBALLockBytesImpl_ReadAt, - HGLOBALLockBytesImpl_WriteAt, - HGLOBALLockBytesImpl_Flush, - HGLOBALLockBytesImpl_SetSize, - HGLOBALLockBytesImpl_LockRegion, - HGLOBALLockBytesImpl_UnlockRegion, - HGLOBALLockBytesImpl_Stat, -}; +static const ILockBytesVtbl HGLOBALLockBytesImpl_Vtbl; /****************************************************************************** * CreateILockBytesOnHGlobal [OLE32.@] @@ -327,7 +265,7 @@ void HGLOBALLockBytesImpl_Destroy(HGLOBALLockBytesImpl* This) * This implements the IUnknown method QueryInterface for this * class */ -HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface( +static HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface( ILockBytes* iface, REFIID riid, /* [in] */ void** ppvObject) /* [iid_is][out] */ @@ -367,7 +305,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface( * Query Interface always increases the reference count by one when it is * successful */ - HGLOBALLockBytesImpl_AddRef(iface); + IUnknown_AddRef(iface); return S_OK; } @@ -376,7 +314,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface( * This implements the IUnknown method AddRef for this * class */ -ULONG WINAPI HGLOBALLockBytesImpl_AddRef(ILockBytes* iface) +static ULONG WINAPI HGLOBALLockBytesImpl_AddRef(ILockBytes* iface) { HGLOBALLockBytesImpl* const This=(HGLOBALLockBytesImpl*)iface; return InterlockedIncrement(&This->ref); @@ -386,7 +324,7 @@ ULONG WINAPI HGLOBALLockBytesImpl_AddRef(ILockBytes* iface) * This implements the IUnknown method Release for this * class */ -ULONG WINAPI HGLOBALLockBytesImpl_Release(ILockBytes* iface) +static ULONG WINAPI HGLOBALLockBytesImpl_Release(ILockBytes* iface) { HGLOBALLockBytesImpl* const This=(HGLOBALLockBytesImpl*)iface; ULONG ref; @@ -412,7 +350,7 @@ ULONG WINAPI HGLOBALLockBytesImpl_Release(ILockBytes* iface) * * See the documentation of ILockBytes for more info. */ -HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt( +static HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt( ILockBytes* iface, ULARGE_INTEGER ulOffset, /* [in] */ void* pv, /* [length_is][size_is][out] */ @@ -484,7 +422,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt( * * See the documentation of ILockBytes for more info. */ -HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt( +static HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt( ILockBytes* iface, ULARGE_INTEGER ulOffset, /* [in] */ const void* pv, /* [size_is][in] */ @@ -549,7 +487,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt( * * See the documentation of ILockBytes for more info. */ -HRESULT WINAPI HGLOBALLockBytesImpl_Flush(ILockBytes* iface) +static HRESULT WINAPI HGLOBALLockBytesImpl_Flush(ILockBytes* iface) { return S_OK; } @@ -561,7 +499,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_Flush(ILockBytes* iface) * * See the documentation of ILockBytes for more info. */ -HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( +static HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( ILockBytes* iface, ULARGE_INTEGER libNewSize) /* [in] */ { @@ -598,7 +536,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( * * See the documentation of ILockBytes for more info. */ -HRESULT WINAPI HGLOBALLockBytesImpl_LockRegion( +static HRESULT WINAPI HGLOBALLockBytesImpl_LockRegion( ILockBytes* iface, ULARGE_INTEGER libOffset, /* [in] */ ULARGE_INTEGER cb, /* [in] */ @@ -614,7 +552,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_LockRegion( * * See the documentation of ILockBytes for more info. */ -HRESULT WINAPI HGLOBALLockBytesImpl_UnlockRegion( +static HRESULT WINAPI HGLOBALLockBytesImpl_UnlockRegion( ILockBytes* iface, ULARGE_INTEGER libOffset, /* [in] */ ULARGE_INTEGER cb, /* [in] */ @@ -631,7 +569,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_UnlockRegion( * * See the documentation of ILockBytes for more info. */ -HRESULT WINAPI HGLOBALLockBytesImpl_Stat( +static HRESULT WINAPI HGLOBALLockBytesImpl_Stat( ILockBytes* iface, STATSTG* pstatstg, /* [out] */ DWORD grfStatFlag) /* [in] */ @@ -646,3 +584,20 @@ HRESULT WINAPI HGLOBALLockBytesImpl_Stat( return S_OK; } + +/* + * Virtual function table for the HGLOBALLockBytesImpl class. + */ +static const ILockBytesVtbl HGLOBALLockBytesImpl_Vtbl = +{ + HGLOBALLockBytesImpl_QueryInterface, + HGLOBALLockBytesImpl_AddRef, + HGLOBALLockBytesImpl_Release, + HGLOBALLockBytesImpl_ReadAt, + HGLOBALLockBytesImpl_WriteAt, + HGLOBALLockBytesImpl_Flush, + HGLOBALLockBytesImpl_SetSize, + HGLOBALLockBytesImpl_LockRegion, + HGLOBALLockBytesImpl_UnlockRegion, + HGLOBALLockBytesImpl_Stat, +}; diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 4232edfce78..acebb98950b 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -179,7 +179,7 @@ extern const IPropertySetStorageVtbl IPropertySetStorage_Vtbl; * * See Windows documentation for more details on IUnknown methods. */ -HRESULT WINAPI StorageBaseImpl_QueryInterface( +static HRESULT WINAPI StorageBaseImpl_QueryInterface( IStorage* iface, REFIID riid, void** ppvObject) @@ -235,7 +235,7 @@ HRESULT WINAPI StorageBaseImpl_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI StorageBaseImpl_AddRef( +static ULONG WINAPI StorageBaseImpl_AddRef( IStorage* iface) { StorageBaseImpl *This = (StorageBaseImpl *)iface; @@ -254,7 +254,7 @@ ULONG WINAPI StorageBaseImpl_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI StorageBaseImpl_Release( +static ULONG WINAPI StorageBaseImpl_Release( IStorage* iface) { StorageBaseImpl *This = (StorageBaseImpl *)iface; @@ -288,7 +288,7 @@ ULONG WINAPI StorageBaseImpl_Release( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageBaseImpl_OpenStream( +static HRESULT WINAPI StorageBaseImpl_OpenStream( IStorage* iface, const OLECHAR* pwcsName, /* [string][in] */ void* reserved1, /* [unique][in] */ @@ -421,7 +421,7 @@ end: * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageBaseImpl_OpenStorage( +static HRESULT WINAPI StorageBaseImpl_OpenStorage( IStorage* iface, const OLECHAR* pwcsName, /* [string][unique][in] */ IStorage* pstgPriority, /* [unique][in] */ @@ -561,7 +561,7 @@ end: * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageBaseImpl_EnumElements( +static HRESULT WINAPI StorageBaseImpl_EnumElements( IStorage* iface, DWORD reserved1, /* [in] */ void* reserved2, /* [size_is][unique][in] */ @@ -610,7 +610,7 @@ HRESULT WINAPI StorageBaseImpl_EnumElements( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageBaseImpl_Stat( +static HRESULT WINAPI StorageBaseImpl_Stat( IStorage* iface, STATSTG* pstatstg, /* [out] */ DWORD grfStatFlag) /* [in] */ @@ -675,7 +675,7 @@ end: * of the deleted StgProperty object setting it with the new name and to * perform a DestroyElement of the old StgProperty. */ -HRESULT WINAPI StorageBaseImpl_RenameElement( +static HRESULT WINAPI StorageBaseImpl_RenameElement( IStorage* iface, const OLECHAR* pwcsOldName, /* [in] */ const OLECHAR* pwcsNewName) /* [in] */ @@ -830,7 +830,7 @@ HRESULT WINAPI StorageBaseImpl_RenameElement( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageBaseImpl_CreateStream( +static HRESULT WINAPI StorageBaseImpl_CreateStream( IStorage* iface, const OLECHAR* pwcsName, /* [string][in] */ DWORD grfMode, /* [in] */ @@ -1008,7 +1008,7 @@ HRESULT WINAPI StorageBaseImpl_CreateStream( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageBaseImpl_SetClass( +static HRESULT WINAPI StorageBaseImpl_SetClass( IStorage* iface, REFCLSID clsid) /* [in] */ { @@ -1047,7 +1047,7 @@ HRESULT WINAPI StorageBaseImpl_SetClass( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageImpl_CreateStorage( +static HRESULT WINAPI StorageImpl_CreateStorage( IStorage* iface, const OLECHAR *pwcsName, /* [string][in] */ DWORD grfMode, /* [in] */ @@ -1446,7 +1446,7 @@ static void updatePropertyChain( /************************************************************************* * CopyTo (IStorage) */ -HRESULT WINAPI StorageImpl_CopyTo( +static HRESULT WINAPI StorageImpl_CopyTo( IStorage* iface, DWORD ciidExclude, /* [in] */ const IID* rgiidExclude, /* [size_is][unique][in] */ @@ -1612,7 +1612,7 @@ HRESULT WINAPI StorageImpl_CopyTo( /************************************************************************* * MoveElementTo (IStorage) */ -HRESULT WINAPI StorageImpl_MoveElementTo( +static HRESULT WINAPI StorageImpl_MoveElementTo( IStorage* iface, const OLECHAR *pwcsName, /* [string][in] */ IStorage *pstgDest, /* [unique][in] */ @@ -1633,7 +1633,7 @@ HRESULT WINAPI StorageImpl_MoveElementTo( * Wine doesn't implement transacted mode, which seems to be a basic * optimization, so we can ignore this stub for now. */ -HRESULT WINAPI StorageImpl_Commit( +static HRESULT WINAPI StorageImpl_Commit( IStorage* iface, DWORD grfCommitFlags)/* [in] */ { @@ -1646,7 +1646,7 @@ HRESULT WINAPI StorageImpl_Commit( * * Discard all changes that have been made since the last commit operation */ -HRESULT WINAPI StorageImpl_Revert( +static HRESULT WINAPI StorageImpl_Revert( IStorage* iface) { FIXME("not implemented!\n"); @@ -1664,7 +1664,7 @@ HRESULT WINAPI StorageImpl_Revert( * enumeration strategy that would give all the leaves of a storage * first. (postfix order) */ -HRESULT WINAPI StorageImpl_DestroyElement( +static HRESULT WINAPI StorageImpl_DestroyElement( IStorage* iface, const OLECHAR *pwcsName)/* [string][in] */ { @@ -1795,7 +1795,7 @@ HRESULT WINAPI StorageImpl_DestroyElement( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageImpl_Stat( IStorage* iface, +static HRESULT WINAPI StorageImpl_Stat( IStorage* iface, STATSTG* pstatstg, /* [out] */ DWORD grfStatFlag) /* [in] */ { @@ -2231,7 +2231,7 @@ static HRESULT adjustPropertyChain( /****************************************************************************** * SetElementTimes (IStorage) */ -HRESULT WINAPI StorageImpl_SetElementTimes( +static HRESULT WINAPI StorageImpl_SetElementTimes( IStorage* iface, const OLECHAR *pwcsName,/* [string][in] */ const FILETIME *pctime, /* [in] */ @@ -2245,7 +2245,7 @@ HRESULT WINAPI StorageImpl_SetElementTimes( /****************************************************************************** * SetStateBits (IStorage) */ -HRESULT WINAPI StorageImpl_SetStateBits( +static HRESULT WINAPI StorageImpl_SetStateBits( IStorage* iface, DWORD grfStateBits,/* [in] */ DWORD grfMask) /* [in] */ @@ -3585,7 +3585,7 @@ void StorageInternalImpl_Destroy( StorageBaseImpl *iface) ** The non-root storages cannot be opened in transacted mode thus this function ** does nothing. */ -HRESULT WINAPI StorageInternalImpl_Commit( +static HRESULT WINAPI StorageInternalImpl_Commit( IStorage* iface, DWORD grfCommitFlags) /* [in] */ { @@ -3599,7 +3599,7 @@ HRESULT WINAPI StorageInternalImpl_Commit( ** The non-root storages cannot be opened in transacted mode thus this function ** does nothing. */ -HRESULT WINAPI StorageInternalImpl_Revert( +static HRESULT WINAPI StorageInternalImpl_Revert( IStorage* iface) { return S_OK; @@ -3612,7 +3612,7 @@ void IEnumSTATSTGImpl_Destroy(IEnumSTATSTGImpl* This) HeapFree(GetProcessHeap(), 0, This); } -HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface( +static HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface( IEnumSTATSTG* iface, REFIID riid, void** ppvObject) @@ -3644,14 +3644,14 @@ HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface( return E_NOINTERFACE; } -ULONG WINAPI IEnumSTATSTGImpl_AddRef( +static ULONG WINAPI IEnumSTATSTGImpl_AddRef( IEnumSTATSTG* iface) { IEnumSTATSTGImpl* const This=(IEnumSTATSTGImpl*)iface; return InterlockedIncrement(&This->ref); } -ULONG WINAPI IEnumSTATSTGImpl_Release( +static ULONG WINAPI IEnumSTATSTGImpl_Release( IEnumSTATSTG* iface) { IEnumSTATSTGImpl* const This=(IEnumSTATSTGImpl*)iface; @@ -3671,7 +3671,7 @@ ULONG WINAPI IEnumSTATSTGImpl_Release( return newRef; } -HRESULT WINAPI IEnumSTATSTGImpl_Next( +static HRESULT WINAPI IEnumSTATSTGImpl_Next( IEnumSTATSTG* iface, ULONG celt, STATSTG* rgelt, @@ -3754,7 +3754,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Next( } -HRESULT WINAPI IEnumSTATSTGImpl_Skip( +static HRESULT WINAPI IEnumSTATSTGImpl_Skip( IEnumSTATSTG* iface, ULONG celt) { @@ -3806,7 +3806,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Skip( return S_FALSE; } -HRESULT WINAPI IEnumSTATSTGImpl_Reset( +static HRESULT WINAPI IEnumSTATSTGImpl_Reset( IEnumSTATSTG* iface) { IEnumSTATSTGImpl* const This=(IEnumSTATSTGImpl*)iface; @@ -3840,7 +3840,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Reset( return S_OK; } -HRESULT WINAPI IEnumSTATSTGImpl_Clone( +static HRESULT WINAPI IEnumSTATSTGImpl_Clone( IEnumSTATSTG* iface, IEnumSTATSTG** ppenum) { diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 62d0c88c07a..898ea48a859 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -424,13 +424,6 @@ StorageInternalImpl* StorageInternalImpl_Construct( void StorageInternalImpl_Destroy( StorageBaseImpl* This); -HRESULT WINAPI StorageInternalImpl_Commit( - IStorage* iface, - DWORD grfCommitFlags); /* [in] */ - -HRESULT WINAPI StorageInternalImpl_Revert( - IStorage* iface); - /**************************************************************************** * IEnumSTATSTGImpl definitions.