- Better tracing.

- Small cleanup of creation functions.
This commit is contained in:
Robert Shearman 2005-02-18 20:13:23 +00:00 committed by Alexandre Julliard
parent c6806cd204
commit 4390d003f4
2 changed files with 38 additions and 27 deletions

View File

@ -157,7 +157,7 @@ HRESULT WINAPI FileMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void**
{
FileMonikerImpl *This = (FileMonikerImpl *)iface;
TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
/* Perform a sanity check on the parameters.*/
if ( (This==0) || (ppvObject==0) )
@ -223,7 +223,7 @@ ULONG WINAPI FileMonikerImpl_Release(IMoniker* iface)
HRESULT WINAPI FileMonikerImpl_GetClassID(IMoniker* iface,
CLSID *pClassID)/* Pointer to CLSID of object */
{
TRACE("(%p,%p),stub!\n",iface,pClassID);
TRACE("(%p,%p)\n",iface,pClassID);
if (pClassID==NULL)
return E_POINTER;
@ -473,7 +473,7 @@ HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
static const WCHAR bkSlash[]={'\\',0};
BYTE addBkSlash;
TRACE("(%p,%p)\n",This,lpszPathName);
TRACE("(%p,%s)\n",This,debugstr_w(lpszPathName));
/* Initialize the virtual fgunction table. */
This->lpvtbl1 = &VT_FileMonikerImpl;
@ -566,7 +566,7 @@ HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker* iface,
*ppvResult=0;
TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
if(pmkToLeft==NULL){
@ -673,7 +673,7 @@ HRESULT WINAPI FileMonikerImpl_BindToStorage(IMoniker* iface,
IStorage *pstg=0;
HRESULT res;
TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvObject);
TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvObject);
if (pmkToLeft==NULL){
@ -708,7 +708,7 @@ HRESULT WINAPI FileMonikerImpl_BindToStorage(IMoniker* iface,
}
else {
FIXME("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvObject);
FIXME("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvObject);
return E_NOTIMPL;
}
@ -1243,6 +1243,8 @@ HRESULT WINAPI FileMonikerImpl_GetDisplayName(IMoniker* iface,
strcpyW(*ppszDisplayName,This->filePathName);
TRACE("-- %s\n", debugstr_w(*ppszDisplayName));
return S_OK;
}
@ -1283,7 +1285,7 @@ HRESULT WINAPI FileMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid
ICOM_THIS_From_IROTData(IMoniker, iface);
TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
return FileMonikerImpl_QueryInterface(This, riid, ppvObject);
}
@ -1329,29 +1331,28 @@ HRESULT WINAPI FileMonikerROTDataImpl_GetComparaisonData(IROTData* iface,
******************************************************************************/
HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER * ppmk)
{
FileMonikerImpl* newFileMoniker = 0;
HRESULT hr = E_FAIL;
IID riid=IID_IMoniker;
FileMonikerImpl* newFileMoniker;
HRESULT hr;
TRACE("(%p,%p)\n",lpszPathName,ppmk);
TRACE("(%s,%p)\n",debugstr_w(lpszPathName),ppmk);
if (ppmk==NULL)
if (!ppmk)
return E_POINTER;
if(lpszPathName==NULL)
if(!lpszPathName)
return MK_E_SYNTAX;
*ppmk=0;
*ppmk=NULL;
newFileMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(FileMonikerImpl));
if (newFileMoniker == 0)
if (!newFileMoniker)
return E_OUTOFMEMORY;
hr = FileMonikerImpl_Construct(newFileMoniker,lpszPathName);
if (SUCCEEDED(hr))
hr = FileMonikerImpl_QueryInterface((IMoniker*)newFileMoniker,&riid,(void**)ppmk);
hr = FileMonikerImpl_QueryInterface((IMoniker*)newFileMoniker,&IID_IMoniker,(void**)ppmk);
else
HeapFree(GetProcessHeap(),0,newFileMoniker);

View File

@ -156,7 +156,7 @@ HRESULT WINAPI ItemMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void**
{
ItemMonikerImpl *This = (ItemMonikerImpl *)iface;
TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
/* Perform a sanity check on the parameters.*/
if ( (This==0) || (ppvObject==0) )
@ -221,7 +221,7 @@ ULONG WINAPI ItemMonikerImpl_Release(IMoniker* iface)
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID)
{
TRACE("(%p,%p),stub!\n",iface,pClassID);
TRACE("(%p,%p)\n",iface,pClassID);
if (pClassID==NULL)
return E_POINTER;
@ -257,6 +257,8 @@ HRESULT WINAPI ItemMonikerImpl_Load(IMoniker* iface,IStream* pStm)
CHAR *itemNameA,*itemDelimiterA;
ULONG bread;
TRACE("\n");
/* for more details about data read by this function see coments of ItemMonikerImpl_Save function */
/* read item delimiter string length + 1 */
@ -335,6 +337,8 @@ HRESULT WINAPI ItemMonikerImpl_Save(IMoniker* iface,
WideCharToMultiByte( CP_ACP, 0, This->itemName, -1, itemNameA, nameLength, NULL, NULL);
WideCharToMultiByte( CP_ACP, 0, This->itemDelimiter, -1, itemDelimiterA, delimiterLength, NULL, NULL);
TRACE("%p, %s\n", pStm, fClearDirty ? "TRUE" : "FALSE");
res=IStream_Write(pStm,&delimiterLength,sizeof(DWORD),NULL);
res=IStream_Write(pStm,itemDelimiterA,delimiterLength * sizeof(CHAR),NULL);
res=IStream_Write(pStm,&nameLength,sizeof(DWORD),NULL);
@ -381,7 +385,7 @@ HRESULT WINAPI ItemMonikerImpl_Construct(ItemMonikerImpl* This, LPCOLESTR lpszDe
static const OLECHAR emptystr[1];
LPCOLESTR delim;
TRACE("(%p,%p)\n",This,lpszItem);
TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszDelim),debugstr_w(lpszItem));
/* Initialize the virtual fgunction table. */
This->lpvtbl1 = &VT_ItemMonikerImpl;
@ -437,7 +441,7 @@ HRESULT WINAPI ItemMonikerImpl_BindToObject(IMoniker* iface,
IID refid=IID_IOleItemContainer;
IOleItemContainer *poic=0;
TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
if(ppvResult ==NULL)
return E_POINTER;
@ -473,7 +477,7 @@ HRESULT WINAPI ItemMonikerImpl_BindToStorage(IMoniker* iface,
HRESULT res;
IOleItemContainer *poic=0;
TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
*ppvResult=0;
@ -781,6 +785,9 @@ HRESULT WINAPI ItemMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
HRESULT WINAPI ItemMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
{
DWORD mkSys;
TRACE("(%p,%p)\n", pmkOther, ppmkPrefix);
IMoniker_IsSystemMoniker(pmkOther,&mkSys);
/* If the other moniker is an item moniker that is equal to this moniker, this method sets *ppmkPrefix */
/* to this moniker and returns MK_S_US */
@ -841,6 +848,8 @@ HRESULT WINAPI ItemMonikerImpl_GetDisplayName(IMoniker* iface,
lstrcpyW(*ppszDisplayName,This->itemDelimiter);
lstrcatW(*ppszDisplayName,This->itemName);
TRACE("-- %s\n", debugstr_w(*ppszDisplayName));
return S_OK;
}
@ -860,6 +869,8 @@ HRESULT WINAPI ItemMonikerImpl_ParseDisplayName(IMoniker* iface,
HRESULT res;
ItemMonikerImpl *This = (ItemMonikerImpl *)iface;
TRACE("%s\n", debugstr_w(pszDisplayName));
/* If pmkToLeft is NULL, this method returns MK_E_SYNTAX */
if (pmkToLeft==NULL)
@ -955,15 +966,14 @@ HRESULT WINAPI ItemMonikerROTDataImpl_GetComparaisonData(IROTData* iface,
******************************************************************************/
HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim,LPCOLESTR lpszItem, LPMONIKER * ppmk)
{
ItemMonikerImpl* newItemMoniker = 0;
HRESULT hr = S_OK;
IID riid=IID_IMoniker;
ItemMonikerImpl* newItemMoniker;
HRESULT hr;
TRACE("(%p,%p,%p)\n",lpszDelim,lpszItem,ppmk);
TRACE("(%s,%s,%p)\n",debugstr_w(lpszDelim),debugstr_w(lpszItem),ppmk);
newItemMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(ItemMonikerImpl));
if (newItemMoniker == 0)
if (!newItemMoniker)
return STG_E_INSUFFICIENTMEMORY;
hr = ItemMonikerImpl_Construct(newItemMoniker,lpszDelim,lpszItem);
@ -974,5 +984,5 @@ HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim,LPCOLESTR lpszItem, LPMONI
return hr;
}
return ItemMonikerImpl_QueryInterface((IMoniker*)newItemMoniker,&riid,(void**)ppmk);
return ItemMonikerImpl_QueryInterface((IMoniker*)newItemMoniker,&IID_IMoniker,(void**)ppmk);
}