--- trunk/reactos/lib/ole32/antimoniker.c 2005-05-05 17:45:00 UTC (rev 15009)
+++ trunk/reactos/lib/ole32/antimoniker.c 2005-05-05 18:16:09 UTC (rev 15010)
@@ -29,7 +29,6 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
-#include "wine/unicode.h"
#include "objbase.h"
#include "wine/debug.h"
#include "moniker.h"
@@ -54,135 +53,48 @@
} AntiMonikerImpl;
-/********************************************************************************/
-/* AntiMoniker prototype functions : */
-/* IUnknown prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject);
-static ULONG WINAPI AntiMonikerImpl_AddRef(IMoniker* iface);
-static ULONG WINAPI AntiMonikerImpl_Release(IMoniker* iface);
-
-/* IPersist prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_GetClassID(IMoniker* iface, CLSID *pClassID);
-
-/* IPersistStream prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_IsDirty(IMoniker* iface);
-static HRESULT WINAPI AntiMonikerImpl_Load(IMoniker* iface, IStream* pStm);
-static HRESULT WINAPI AntiMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty);
-static HRESULT WINAPI AntiMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize);
-
-/* IMoniker prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_BindToObject(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI AntiMonikerImpl_BindToStorage(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI AntiMonikerImpl_Reduce(IMoniker* iface,IBindCtx* pbc, DWORD dwReduceHowFar,IMoniker** ppmkToLeft, IMoniker** ppmkReduced);
-static HRESULT WINAPI AntiMonikerImpl_ComposeWith(IMoniker* iface,IMoniker* pmkRight,BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite);
-static HRESULT WINAPI AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker);
-static HRESULT WINAPI AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker);
-static HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash);
-static HRESULT WINAPI AntiMonikerImpl_IsRunning(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, IMoniker* pmkNewlyRunning);
-static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, FILETIME* pAntiTime);
-static HRESULT WINAPI AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk);
-static HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther, IMoniker** ppmkPrefix);
-static HRESULT WINAPI AntiMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath);
-static HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName);
-static HRESULT WINAPI AntiMonikerImpl_ParseDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut);
-static HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys);
-
-/********************************************************************************/
-/* IROTData prototype functions */
-
-/* IUnknown prototype functions */
-static HRESULT WINAPI AntiMonikerROTDataImpl_QueryInterface(IROTData* iface,REFIID riid,VOID** ppvObject);
-static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData* iface);
-static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface);
-
-/* IROTData prototype function */
-static HRESULT WINAPI AntiMonikerROTDataImpl_GetComparaisonData(IROTData* iface,BYTE* pbData,ULONG cbMax,ULONG* pcbData);
-
-/* Local function used by AntiMoniker implementation */
-HRESULT WINAPI AntiMonikerImpl_Construct(AntiMonikerImpl* iface);
-HRESULT WINAPI AntiMonikerImpl_Destroy(AntiMonikerImpl* iface);
-
-/********************************************************************************/
-/* Virtual function table for the AntiMonikerImpl class which include IPersist,*/
-/* IPersistStream and IMoniker functions. */
-static IMonikerVtbl VT_AntiMonikerImpl =
-{
- AntiMonikerImpl_QueryInterface,
- AntiMonikerImpl_AddRef,
- AntiMonikerImpl_Release,
- AntiMonikerImpl_GetClassID,
- AntiMonikerImpl_IsDirty,
- AntiMonikerImpl_Load,
- AntiMonikerImpl_Save,
- AntiMonikerImpl_GetSizeMax,
- AntiMonikerImpl_BindToObject,
- AntiMonikerImpl_BindToStorage,
- AntiMonikerImpl_Reduce,
- AntiMonikerImpl_ComposeWith,
- AntiMonikerImpl_Enum,
- AntiMonikerImpl_IsEqual,
- AntiMonikerImpl_Hash,
- AntiMonikerImpl_IsRunning,
- AntiMonikerImpl_GetTimeOfLastChange,
- AntiMonikerImpl_Inverse,
- AntiMonikerImpl_CommonPrefixWith,
- AntiMonikerImpl_RelativePathTo,
- AntiMonikerImpl_GetDisplayName,
- AntiMonikerImpl_ParseDisplayName,
- AntiMonikerImpl_IsSystemMoniker
-};
-
-/********************************************************************************/
-/* Virtual function table for the IROTData class. */
-static IROTDataVtbl VT_ROTDataImpl =
-{
- AntiMonikerROTDataImpl_QueryInterface,
- AntiMonikerROTDataImpl_AddRef,
- AntiMonikerROTDataImpl_Release,
- AntiMonikerROTDataImpl_GetComparaisonData
-};
-
/*******************************************************************************
* AntiMoniker_QueryInterface
*******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
+static HRESULT WINAPI
+AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
{
AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
- TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
+ TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
- /* Perform a sanity check on the parameters.*/
+ /* Perform a sanity check on the parameters.*/
if ( (This==0) || (ppvObject==0) )
return E_INVALIDARG;
- /* Initialize the return parameter */
- *ppvObject = 0;
+ /* Initialize the return parameter */
+ *ppvObject = 0;
- /* Compare the riid with the interface IDs implemented by this object.*/
- if (IsEqualIID(&IID_IUnknown, riid) ||
- IsEqualIID(&IID_IPersist, riid) ||
- IsEqualIID(&IID_IPersistStream, riid) ||
- IsEqualIID(&IID_IMoniker, riid)
- )
- *ppvObject = iface;
+ /* Compare the riid with the interface IDs implemented by this object.*/
+ if (IsEqualIID(&IID_IUnknown, riid) ||
+ IsEqualIID(&IID_IPersist, riid) ||
+ IsEqualIID(&IID_IPersistStream, riid) ||
+ IsEqualIID(&IID_IMoniker, riid))
+ *ppvObject = iface;
else if (IsEqualIID(&IID_IROTData, riid))
*ppvObject = (IROTData*)&(This->lpvtbl2);
- /* Check that we obtained an interface.*/
+ /* Check that we obtained an interface.*/
if ((*ppvObject)==0)
return E_NOINTERFACE;
- /* Query Interface always increases the reference count by one when it is successful */
- AntiMonikerImpl_AddRef(iface);
+ /* always increase the reference count by one when it is successful */
+ IMoniker_AddRef(iface);
- return S_OK;
+ return S_OK;
}
/******************************************************************************
* AntiMoniker_AddRef
******************************************************************************/
-ULONG WINAPI AntiMonikerImpl_AddRef(IMoniker* iface)
+static ULONG WINAPI
+AntiMonikerImpl_AddRef(IMoniker* iface)
{
AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
@@ -194,7 +106,8 @@
/******************************************************************************
* AntiMoniker_Release
******************************************************************************/
-ULONG WINAPI AntiMonikerImpl_Release(IMoniker* iface)
+static ULONG WINAPI
+AntiMonikerImpl_Release(IMoniker* iface)
{
AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
ULONG ref;
@@ -204,7 +117,7 @@
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
- if (ref == 0) AntiMonikerImpl_Destroy(This);
+ if (ref == 0) HeapFree(GetProcessHeap(),0,This);
return ref;
}
@@ -212,7 +125,8 @@
/******************************************************************************
* AntiMoniker_GetClassID
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID)
+static HRESULT WINAPI
+AntiMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID)
{
TRACE("(%p,%p),stub!\n",iface,pClassID);
@@ -227,7 +141,8 @@
/******************************************************************************
* AntiMoniker_IsDirty
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsDirty(IMoniker* iface)
+static HRESULT WINAPI
+AntiMonikerImpl_IsDirty(IMoniker* iface)
{
/* Note that the OLE-provided implementations of the IPersistStream::IsDirty
method in the OLE-provided moniker interfaces always return S_FALSE because
@@ -241,7 +156,8 @@
/******************************************************************************
* AntiMoniker_Load
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Load(IMoniker* iface,IStream* pStm)
+static HRESULT WINAPI
+AntiMonikerImpl_Load(IMoniker* iface,IStream* pStm)
{
DWORD constant=1,dwbuffer;
HRESULT res;
@@ -258,7 +174,8 @@
/******************************************************************************
* AntiMoniker_Save
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fClearDirty)
+static HRESULT WINAPI
+AntiMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fClearDirty)
{
DWORD constant=1;
HRESULT res;
@@ -271,9 +188,12 @@
/******************************************************************************
* AntiMoniker_GetSizeMax
+ *
+ * PARAMS
+ * pcbSize [out] Pointer to size of stream needed to save object
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetSizeMax(IMoniker* iface,
- ULARGE_INTEGER* pcbSize)/* Pointer to size of stream needed to save object */
+static HRESULT WINAPI
+AntiMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
{
TRACE("(%p,%p)\n",iface,pcbSize);
@@ -282,8 +202,11 @@
/* for more details see AntiMonikerImpl_Save coments */
- /* Normaly the sizemax must be the size of DWORD ! but I tested this function it ususlly return 16 bytes */
- /* more than the number of bytes used by AntiMoniker::Save function */
+ /*
+ * Normally the sizemax must be sizeof DWORD, but
+ * I tested this function it usually return 16 bytes
+ * more than the number of bytes used by AntiMoniker::Save function
+ */
pcbSize->u.LowPart = sizeof(DWORD)+16;
pcbSize->u.HighPart=0;
@@ -292,39 +215,11 @@
}
/******************************************************************************
- * AntiMoniker_Construct (local function)
- *******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Construct(AntiMonikerImpl* This)
-{
-
- TRACE("(%p)\n",This);
-
- /* Initialize the virtual fgunction table. */
- This->lpvtbl1 = &VT_AntiMonikerImpl;
- This->lpvtbl2 = &VT_ROTDataImpl;
- This->ref = 0;
-
- return S_OK;
-}
-
-/******************************************************************************
- * AntiMoniker_Destroy (local function)
- *******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Destroy(AntiMonikerImpl* This)
-{
- TRACE("(%p)\n",This);
-
- return HeapFree(GetProcessHeap(),0,This);
-}
-
-/******************************************************************************
* AntiMoniker_BindToObject
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_BindToObject(IMoniker* iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- REFIID riid,
- VOID** ppvResult)
+static HRESULT WINAPI
+AntiMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
+ REFIID riid, VOID** ppvResult)
{
TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
return E_NOTIMPL;
@@ -333,11 +228,9 @@
/******************************************************************************
* AntiMoniker_BindToStorage
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_BindToStorage(IMoniker* iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- REFIID riid,
- VOID** ppvResult)
+static HRESULT WINAPI
+AntiMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
+ REFIID riid, VOID** ppvResult)
{
TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
return E_NOTIMPL;
@@ -346,11 +239,9 @@
/******************************************************************************
* AntiMoniker_Reduce
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Reduce(IMoniker* iface,
- IBindCtx* pbc,
- DWORD dwReduceHowFar,
- IMoniker** ppmkToLeft,
- IMoniker** ppmkReduced)
+static HRESULT WINAPI
+AntiMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar,
+ IMoniker** ppmkToLeft, IMoniker** ppmkReduced)
{
TRACE("(%p,%p,%ld,%p,%p)\n",iface,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
@@ -366,10 +257,9 @@
/******************************************************************************
* AntiMoniker_ComposeWith
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_ComposeWith(IMoniker* iface,
- IMoniker* pmkRight,
- BOOL fOnlyIfNotGeneric,
- IMoniker** ppmkComposite)
+static HRESULT WINAPI
+AntiMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight,
+ BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite)
{
TRACE("(%p,%p,%d,%p)\n",iface,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
@@ -388,7 +278,8 @@
/******************************************************************************
* AntiMoniker_Enum
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
+static HRESULT WINAPI
+AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
{
TRACE("(%p,%d,%p)\n",iface,fForward,ppenumMoniker);
@@ -403,7 +294,8 @@
/******************************************************************************
* AntiMoniker_IsEqual
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
+static HRESULT WINAPI
+AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
{
DWORD mkSys;
@@ -423,7 +315,7 @@
/******************************************************************************
* AntiMoniker_Hash
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
+static HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
{
if (pdwHash==NULL)
return E_POINTER;
@@ -436,10 +328,9 @@
/******************************************************************************
* AntiMoniker_IsRunning
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsRunning(IMoniker* iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- IMoniker* pmkNewlyRunning)
+static HRESULT WINAPI
+AntiMonikerImpl_IsRunning(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
+ IMoniker* pmkNewlyRunning)
{
IRunningObjectTable* rot;
HRESULT res;
@@ -452,7 +343,7 @@
res=IBindCtx_GetRunningObjectTable(pbc,&rot);
if (FAILED(res))
- return res;
+ return res;
res = IRunningObjectTable_IsRunning(rot,iface);
@@ -464,7 +355,7 @@
/******************************************************************************
* AntiMoniker_GetTimeOfLastChange
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
+static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
IBindCtx* pbc,
IMoniker* pmkToLeft,
FILETIME* pAntiTime)
@@ -476,7 +367,8 @@
/******************************************************************************
* AntiMoniker_Inverse
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
+static HRESULT WINAPI
+AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
{
TRACE("(%p,%p)\n",iface,ppmk);
@@ -491,7 +383,8 @@
/******************************************************************************
* AntiMoniker_CommonPrefixWith
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
+static HRESULT WINAPI
+AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
{
DWORD mkSys;
@@ -514,7 +407,8 @@
/******************************************************************************
* AntiMoniker_RelativePathTo
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
+static HRESULT WINAPI
+AntiMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
{
TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);
@@ -531,10 +425,9 @@
/******************************************************************************
* AntiMoniker_GetDisplayName
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- LPOLESTR *ppszDisplayName)
+static HRESULT WINAPI
+AntiMonikerImpl_GetDisplayName(IMoniker* iface, IBindCtx* pbc,
+ IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName)
{
static const WCHAR back[]={'\\','.','.',0};
@@ -553,7 +446,7 @@
if (*ppszDisplayName==NULL)
return E_OUTOFMEMORY;
- strcpyW(*ppszDisplayName,back);
+ lstrcpyW(*ppszDisplayName,back);
return S_OK;
}
@@ -561,12 +454,10 @@
/******************************************************************************
* AntiMoniker_ParseDisplayName
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_ParseDisplayName(IMoniker* iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- LPOLESTR pszDisplayName,
- ULONG* pchEaten,
- IMoniker** ppmkOut)
+static HRESULT WINAPI
+AntiMonikerImpl_ParseDisplayName(IMoniker* iface, IBindCtx* pbc,
+ IMoniker* pmkToLeft, LPOLESTR pszDisplayName,
+ ULONG* pchEaten, IMoniker** ppmkOut)
{
TRACE("(%p,%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
return E_NOTIMPL;
@@ -575,7 +466,8 @@
/******************************************************************************
* AntiMoniker_IsSystemMoniker
******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
+static HRESULT WINAPI
+AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
{
TRACE("(%p,%p)\n",iface,pwdMksys);
@@ -590,9 +482,9 @@
/*******************************************************************************
* AntiMonikerIROTData_QueryInterface
*******************************************************************************/
-HRESULT WINAPI AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
+static HRESULT WINAPI
+AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
{
-
ICOM_THIS_From_IROTData(IMoniker, iface);
TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
@@ -603,7 +495,7 @@
/***********************************************************************
* AntiMonikerIROTData_AddRef
*/
-ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
+static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
@@ -615,7 +507,7 @@
/***********************************************************************
* AntiMonikerIROTData_Release
*/
-ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface)
+static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
@@ -627,16 +519,71 @@
/******************************************************************************
* AntiMonikerIROTData_GetComparaisonData
******************************************************************************/
-HRESULT WINAPI AntiMonikerROTDataImpl_GetComparaisonData(IROTData* iface,
- BYTE* pbData,
- ULONG cbMax,
- ULONG* pcbData)
+static HRESULT WINAPI
+AntiMonikerROTDataImpl_GetComparaisonData(IROTData* iface, BYTE* pbData,
+ ULONG cbMax, ULONG* pcbData)
{
FIXME("(),stub!\n");
return E_NOTIMPL;
}
+/********************************************************************************/
+/* Virtual function table for the AntiMonikerImpl class which include IPersist,*/
+/* IPersistStream and IMoniker functions. */
+static IMonikerVtbl VT_AntiMonikerImpl =
+{
+ AntiMonikerImpl_QueryInterface,
+ AntiMonikerImpl_AddRef,
+ AntiMonikerImpl_Release,
+ AntiMonikerImpl_GetClassID,
+ AntiMonikerImpl_IsDirty,
+ AntiMonikerImpl_Load,
+ AntiMonikerImpl_Save,
+ AntiMonikerImpl_GetSizeMax,
+ AntiMonikerImpl_BindToObject,
+ AntiMonikerImpl_BindToStorage,
+ AntiMonikerImpl_Reduce,
+ AntiMonikerImpl_ComposeWith,
+ AntiMonikerImpl_Enum,
+ AntiMonikerImpl_IsEqual,
+ AntiMonikerImpl_Hash,
+ AntiMonikerImpl_IsRunning,
+ AntiMonikerImpl_GetTimeOfLastChange,
+ AntiMonikerImpl_Inverse,
+ AntiMonikerImpl_CommonPrefixWith,
+ AntiMonikerImpl_RelativePathTo,
+ AntiMonikerImpl_GetDisplayName,
+ AntiMonikerImpl_ParseDisplayName,
+ AntiMonikerImpl_IsSystemMoniker
+};
+
+/********************************************************************************/
+/* Virtual function table for the IROTData class. */
+static IROTDataVtbl VT_ROTDataImpl =
+{
+ AntiMonikerROTDataImpl_QueryInterface,
+ AntiMonikerROTDataImpl_AddRef,
+ AntiMonikerROTDataImpl_Release,
+ AntiMonikerROTDataImpl_GetComparaisonData
+};
+
/******************************************************************************
+ * AntiMoniker_Construct (local function)
+ *******************************************************************************/
+static HRESULT AntiMonikerImpl_Construct(AntiMonikerImpl* This)
+{
+
+ TRACE("(%p)\n",This);
+
+ /* Initialize the virtual fgunction table. */
+ This->lpvtbl1 = &VT_AntiMonikerImpl;
+ This->lpvtbl2 = &VT_ROTDataImpl;
+ This->ref = 0;
+
+ return S_OK;
+}
+
+/******************************************************************************
* CreateAntiMoniker [OLE32.@]
******************************************************************************/
HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk)
@@ -653,9 +600,8 @@
return STG_E_INSUFFICIENTMEMORY;
hr = AntiMonikerImpl_Construct(newAntiMoniker);
-
- if (FAILED(hr)){
-
+ if (FAILED(hr))
+ {
HeapFree(GetProcessHeap(),0,newAntiMoniker);
return hr;
}
--- trunk/reactos/lib/ole32/bindctx.c 2005-05-05 17:45:00 UTC (rev 15009)
+++ trunk/reactos/lib/ole32/bindctx.c 2005-05-05 18:16:09 UTC (rev 15010)
@@ -27,7 +27,6 @@
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
-#include "wine/unicode.h"
#include "objbase.h"
#include "wine/debug.h"
@@ -64,82 +63,42 @@
} BindCtxImpl;
/* IBindCtx prototype functions : */
+static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx*);
+static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl*, IUnknown*, LPOLESTR, DWORD *);
-/* IUnknown functions*/
-static HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject);
-static ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface);
-static ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface);
-/* IBindCtx functions */
-static HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk);
-static HRESULT WINAPI BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk);
-static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface);
-static HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts);
-static HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts);
-static HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot);
-static HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown* punk);
-static HRESULT WINAPI BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown** punk);
-static HRESULT WINAPI BindCtxImpl_EnumObjectParam(IBindCtx* iface,IEnumString** ppenum);
-static HRESULT WINAPI BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR pszkey);
-/* Local functions*/
-HRESULT WINAPI BindCtxImpl_Construct(BindCtxImpl* This);
-HRESULT WINAPI BindCtxImpl_Destroy(BindCtxImpl* This);
-HRESULT WINAPI BindCtxImpl_GetObjectIndex(BindCtxImpl* This,IUnknown* punk,LPOLESTR pszkey,DWORD *index);
-
-/* Virtual function table for the BindCtx class. */
-static IBindCtxVtbl VT_BindCtxImpl =
- {
- BindCtxImpl_QueryInterface,
- BindCtxImpl_AddRef,
- BindCtxImpl_Release,
- BindCtxImpl_RegisterObjectBound,
- BindCtxImpl_RevokeObjectBound,
- BindCtxImpl_ReleaseBoundObjects,
- BindCtxImpl_SetBindOptions,
- BindCtxImpl_GetBindOptions,
- BindCtxImpl_GetRunningObjectTable,
- BindCtxImpl_RegisterObjectParam,
- BindCtxImpl_GetObjectParam,
- BindCtxImpl_EnumObjectParam,
- BindCtxImpl_RevokeObjectParam
-};
-
/*******************************************************************************
* BindCtx_QueryInterface
*******************************************************************************/
-HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject)
+static HRESULT WINAPI
+BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject)
{
- BindCtxImpl *This = (BindCtxImpl *)iface;
+ BindCtxImpl *This = (BindCtxImpl *)iface;
- TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
+ TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
- /* Perform a sanity check on the parameters.*/
- if ( (This==0) || (ppvObject==0) )
- return E_INVALIDARG;
+ /* Perform a sanity check on the parameters.*/
+ if ( (This==0) || (ppvObject==0) )
+ return E_INVALIDARG;
- /* Initialize the return parameter.*/
- *ppvObject = 0;
+ /* Initialize the return parameter.*/
+ *ppvObject = 0;
- /* Compare the riid with the interface IDs implemented by this object.*/
- if (IsEqualIID(&IID_IUnknown, riid))
- *ppvObject = (IBindCtx*)This;
- else
- if (IsEqualIID(&IID_IBindCtx, riid))
- *ppvObject = (IBindCtx*)This;
+ /* Compare the riid with the interface IDs implemented by this object.*/
+ if (IsEqualIID(&IID_IUnknown, riid) ||
+ IsEqualIID(&IID_IBindCtx, riid))
+ {
+ *ppvObject = (IBindCtx*)This;
+ IBindCtx_AddRef(iface);
+ return S_OK;
+ }
- /* Check that we obtained an interface.*/
- if ((*ppvObject)==0)
- return E_NOINTERFACE;
-
- /* Query Interface always increases the reference count by one when it is successful */
- BindCtxImpl_AddRef(iface);
-
- return S_OK;
+ return E_NOINTERFACE;
}
/******************************************************************************
* BindCtx_AddRef
******************************************************************************/
-ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface)
+static ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface)
{
BindCtxImpl *This = (BindCtxImpl *)iface;
@@ -149,9 +108,25 @@
}
/******************************************************************************
+ * BindCtx_Destroy (local function)
+ *******************************************************************************/
+static HRESULT BindCtxImpl_Destroy(BindCtxImpl* This)
+{
+ TRACE("(%p)\n",This);
+
+ /* free the table space memory */
+ HeapFree(GetProcessHeap(),0,This->bindCtxTable);
+
+ /* free the bindctx structure */
+ HeapFree(GetProcessHeap(),0,This);
+
+ return S_OK;
+}
+
+/******************************************************************************
* BindCtx_Release
******************************************************************************/
-ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface)
+static ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface)
{
BindCtxImpl *This = (BindCtxImpl *)iface;
ULONG ref;
@@ -159,8 +134,8 @@
TRACE("(%p)\n",This);
ref = InterlockedDecrement(&This->ref);
-
- if (ref == 0){
+ if (ref == 0)
+ {
/* release all registered objects */
BindCtxImpl_ReleaseBoundObjects((IBindCtx*)This);
@@ -171,59 +146,10 @@
/******************************************************************************
- * BindCtx_Construct (local function)
- *******************************************************************************/
-HRESULT WINAPI BindCtxImpl_Construct(BindCtxImpl* This)
-{
- TRACE("(%p)\n",This);
-
- /* Initialize the virtual function table.*/
- This->lpVtbl = &VT_BindCtxImpl;
- This->ref = 0;
-
- /* Initialize the BIND_OPTS2 structure */
- This->bindOption2.cbStruct = sizeof(BIND_OPTS2);
- This->bindOption2.grfFlags = 0;
- This->bindOption2.grfMode = STGM_READWRITE;
- This->bindOption2.dwTickCountDeadline = 0;
-
- This->bindOption2.dwTrackFlags = 0;
- This->bindOption2.dwClassContext = CLSCTX_SERVER;
- This->bindOption2.locale = 1033;
- This->bindOption2.pServerInfo = 0;
-
- /* Initialize the bindctx table */
- This->bindCtxTableSize=BLOCK_TAB_SIZE;
- This->bindCtxTableLastIndex=0;
- This->bindCtxTable= HeapAlloc(GetProcessHeap(), 0,This->bindCtxTableSize*sizeof(BindCtxObject));
-
- if (This->bindCtxTable==NULL)
- return E_OUTOFMEMORY;
-
- return S_OK;
-}
-
-/******************************************************************************
- * BindCtx_Destroy (local function)
- *******************************************************************************/
-HRESULT WINAPI BindCtxImpl_Destroy(BindCtxImpl* This)
-{
- TRACE("(%p)\n",This);
-
- /* free the table space memory */
- HeapFree(GetProcessHeap(),0,This->bindCtxTable);
-
- /* free the bindctx structure */
- HeapFree(GetProcessHeap(),0,This);
-
- return S_OK;
-}
-
-
-/******************************************************************************
* BindCtx_RegisterObjectBound
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk)
+static HRESULT WINAPI
+BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk)
{
BindCtxImpl *This = (BindCtxImpl *)iface;
DWORD lastIndex=This->bindCtxTableLastIndex;
@@ -261,7 +187,8 @@
/******************************************************************************
* BindCtx_RevokeObjectBound
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk)
+static HRESULT WINAPI
+BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk)
{
DWORD index,j;
@@ -289,7 +216,8 @@
/******************************************************************************
* BindCtx_ReleaseBoundObjects
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface)
+static HRESULT WINAPI
+BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface)
{
DWORD i;
@@ -312,7 +240,8 @@
/******************************************************************************
* BindCtx_SetBindOptions
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
+static HRESULT WINAPI
+BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
{
BindCtxImpl *This = (BindCtxImpl *)iface;
@@ -333,7 +262,8 @@
/******************************************************************************
* BindCtx_GetBindOptions
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
+static HRESULT WINAPI
+BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
{
BindCtxImpl *This = (BindCtxImpl *)iface;
@@ -354,7 +284,8 @@
/******************************************************************************
* BindCtx_GetRunningObjectTable
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot)
+static HRESULT WINAPI
+BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot)
{
HRESULT res;
@@ -373,7 +304,8 @@
/******************************************************************************
* BindCtx_RegisterObjectParam
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown* punk)
+static HRESULT WINAPI
+BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown* punk)
{
DWORD index=0;
BindCtxImpl *This = (BindCtxImpl *)iface;
@@ -399,23 +331,26 @@
This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=NULL;
- else{
+ else
+ {
This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=
HeapAlloc(GetProcessHeap(),0,(sizeof(WCHAR)*(1+lstrlenW(pszkey))));
if (This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj==NULL)
return E_OUTOFMEMORY;
- strcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
+ lstrcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
}
This->bindCtxTableLastIndex++;
- if (This->bindCtxTableLastIndex == This->bindCtxTableSize){ /* table is full ! must be resized */
+ if (This->bindCtxTableLastIndex == This->bindCtxTableSize)
+ {
+ /* table is full ! must be resized */
This->bindCtxTableSize+=BLOCK_TAB_SIZE; /* new table size */
-
- if (This->bindCtxTableSize > (MAX_TAB_SIZE-BLOCK_TAB_SIZE)){
+ if (This->bindCtxTableSize > (MAX_TAB_SIZE-BLOCK_TAB_SIZE))
+ {
FIXME("This->bindCtxTableSize: %ld is out of data limite \n",This->bindCtxTableSize);
return E_FAIL;
}
@@ -431,7 +366,8 @@
/******************************************************************************
* BindCtx_GetObjectParam
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown** punk)
+static HRESULT WINAPI
+BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown** punk)
{
DWORD index;
BindCtxImpl *This = (BindCtxImpl *)iface;
@@ -456,7 +392,8 @@
/******************************************************************************
* BindCtx_RevokeObjectParam
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR ppenum)
+static HRESULT WINAPI
+BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR ppenum)
{
DWORD index,j;
@@ -484,7 +421,8 @@
/******************************************************************************
* BindCtx_EnumObjectParam
******************************************************************************/
-HRESULT WINAPI BindCtxImpl_EnumObjectParam(IBindCtx* iface,IEnumString** pszkey)
+static HRESULT WINAPI
+BindCtxImpl_EnumObjectParam(IBindCtx* iface,IEnumString** pszkey)
{
FIXME("(%p,%p),stub!\n",iface,pszkey);
[truncated at 1000 lines; 6850 more skipped]