Commit 10ee7b36 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Implement IROTData::GetComparisonData for file & item monikers.

parent b3e0a032
......@@ -59,9 +59,6 @@ typedef struct FileMonikerImpl{
} FileMonikerImpl;
/* IROTData prototype function */
static HRESULT WINAPI FileMonikerROTDataImpl_GetComparaisonData(IROTData* iface,BYTE* pbData,ULONG cbMax,ULONG* pcbData);
/* Local function used by filemoniker implementation */
static HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* iface, LPCOLESTR lpszPathName);
static HRESULT WINAPI FileMonikerImpl_Destroy(FileMonikerImpl* iface);
......@@ -1165,11 +1162,27 @@ FileMonikerROTDataImpl_Release(IROTData* iface)
* FileMonikerIROTData_GetComparaisonData
*/
static HRESULT WINAPI
FileMonikerROTDataImpl_GetComparaisonData(IROTData* iface, BYTE* pbData,
FileMonikerROTDataImpl_GetComparisonData(IROTData* iface, BYTE* pbData,
ULONG cbMax, ULONG* pcbData)
{
FIXME("(),stub!\n");
return E_NOTIMPL;
ICOM_THIS_From_IROTData(IMoniker, iface);
FileMonikerImpl *This1 = (FileMonikerImpl *)This;
int len = (strlenW(This1->filePathName)+1);
int i;
LPWSTR pszFileName;
TRACE("(%p, %lu, %p)\n", pbData, cbMax, pcbData);
*pcbData = sizeof(CLSID) + len * sizeof(WCHAR);
if (cbMax < *pcbData)
return E_OUTOFMEMORY;
memcpy(pbData, &CLSID_FileMoniker, sizeof(CLSID));
pszFileName = (LPWSTR)(pbData+sizeof(CLSID));
for (i = 0; i < len; i++)
pszFileName[i] = toupperW(This1->filePathName[i]);
return S_OK;
}
/*
......@@ -1209,7 +1222,7 @@ static IROTDataVtbl VT_ROTDataImpl =
FileMonikerROTDataImpl_QueryInterface,
FileMonikerROTDataImpl_AddRef,
FileMonikerROTDataImpl_Release,
FileMonikerROTDataImpl_GetComparaisonData
FileMonikerROTDataImpl_GetComparisonData
};
/******************************************************************************
......
......@@ -107,7 +107,7 @@ static ULONG WINAPI ItemMonikerROTDataImpl_AddRef(IROTData* iface);
static ULONG WINAPI ItemMonikerROTDataImpl_Release(IROTData* iface);
/* IROTData prototype function */
static HRESULT WINAPI ItemMonikerROTDataImpl_GetComparaisonData(IROTData* iface,BYTE* pbData,ULONG cbMax,ULONG* pcbData);
static HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData* iface,BYTE* pbData,ULONG cbMax,ULONG* pcbData);
/********************************************************************************/
/* Virtual function table for the ItemMonikerImpl class which include IPersist,*/
......@@ -146,7 +146,7 @@ static IROTDataVtbl VT_ROTDataImpl =
ItemMonikerROTDataImpl_QueryInterface,
ItemMonikerROTDataImpl_AddRef,
ItemMonikerROTDataImpl_Release,
ItemMonikerROTDataImpl_GetComparaisonData
ItemMonikerROTDataImpl_GetComparisonData
};
/*******************************************************************************
......@@ -952,13 +952,35 @@ ULONG WINAPI ItemMonikerROTDataImpl_Release(IROTData* iface)
/******************************************************************************
* ItemMonikerIROTData_GetComparaisonData
******************************************************************************/
HRESULT WINAPI ItemMonikerROTDataImpl_GetComparaisonData(IROTData* iface,
HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData* iface,
BYTE* pbData,
ULONG cbMax,
ULONG* pcbData)
{
FIXME("(),stub!\n");
return E_NOTIMPL;
ICOM_THIS_From_IROTData(IMoniker, iface);
ItemMonikerImpl *This1 = (ItemMonikerImpl *)This;
int len = (strlenW(This1->itemName)+1);
int i;
LPWSTR pszItemName;
LPWSTR pszItemDelimiter;
TRACE("(%p, %lu, %p)\n", pbData, cbMax, pcbData);
*pcbData = sizeof(CLSID) + sizeof(WCHAR) + len * sizeof(WCHAR);
if (cbMax < *pcbData)
return E_OUTOFMEMORY;
/* write CLSID */
memcpy(pbData, &CLSID_ItemMoniker, sizeof(CLSID));
/* write delimiter */
pszItemDelimiter = (LPWSTR)(pbData+sizeof(CLSID));
*pszItemDelimiter = *This1->itemDelimiter;
/* write name */
pszItemName = pszItemDelimiter + 1;
for (i = 0; i < len; i++)
pszItemName[i] = toupperW(This1->itemName[i]);
return S_OK;
}
/******************************************************************************
......
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