Skip to content

Latest commit

 

History

History
159 lines (129 loc) · 4.55 KB

nf-winsync-isynchronousdataretriever-loadchangedata.md

File metadata and controls

159 lines (129 loc) · 4.55 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winsync.ISynchronousDataRetriever.LoadChangeData
ISynchronousDataRetriever::LoadChangeData (winsync.h)
Retrieves item data for a change. (ISynchronousDataRetriever.LoadChangeData)
ISynchronousDataRetriever interface [Windows Sync]
LoadChangeData method
ISynchronousDataRetriever.LoadChangeData
ISynchronousDataRetriever::LoadChangeData
LoadChangeData
LoadChangeData method [Windows Sync]
LoadChangeData method [Windows Sync]
ISynchronousDataRetriever interface
winsync.isynchronousdataretriever_loadchangedata
winsync/ISynchronousDataRetriever::LoadChangeData
winsync\isynchronousdataretriever_loadchangedata.htm
winsync
ae309301-3810-4785-b4f2-a55fbdf819d8
12/05/2018
ISynchronousDataRetriever interface [Windows Sync],LoadChangeData method, ISynchronousDataRetriever.LoadChangeData, ISynchronousDataRetriever::LoadChangeData, LoadChangeData, LoadChangeData method [Windows Sync], LoadChangeData method [Windows Sync],ISynchronousDataRetriever interface, winsync.isynchronousdataretriever_loadchangedata, winsync/ISynchronousDataRetriever::LoadChangeData
winsync.h
Windows
Windows 7 [desktop apps only]
Windows Server 2008 R2 [desktop apps only]
Windows
19H1
ISynchronousDataRetriever::LoadChangeData
winsync/ISynchronousDataRetriever::LoadChangeData
c++
APIRef
kbSyntax
COM
winsync.h
ISynchronousDataRetriever.LoadChangeData

ISynchronousDataRetriever::LoadChangeData

-description

Retrieves item data for a change.

-parameters

-param pLoadChangeContext [in]

Metadata that describes the change for which data should be retrieved.

-param ppUnkData [out]

Returns the item data for the change specified in pLoadChangeContext.

-returns

The possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
S_OK
The method succeeded.
Provider-determined error codes.

-remarks

The source provider determines the data retrieval interface that is implemented by the object that is returned in ppUnkData. The destination provider can acquire this interface by using the QueryInterface method of ppUnkData.

Examples

The following example is an implementation of LoadChangeData that finds the specified change in a custom data store and returns a copy of it.

STDMETHODIMP CItemStore::LoadChangeData(
    ILoadChangeContext * pLoadChangeContext,
    IUnknown ** ppUnkData)
{
    HRESULT hr = E_UNEXPECTED;

    if (NULL == pLoadChangeContext || NULL == ppUnkData)
    {
        hr = E_POINTER;    
    }
    else
    {
        // Find the item in the data store, clone it, and return its IUnknown interface.
        ISyncChange* pChange = NULL;
        hr = pLoadChangeContext->GetSyncChange(&pChange);
        if (SUCCEEDED(hr))
        {
            SYNC_GID gidItem;
            DWORD cbID = sizeof(gidItem);
            hr = pChange->GetRootItemId((BYTE*)&gidItem, &cbID);
            if (SUCCEEDED(hr))
            {
                IXMLDOMNode* pNodeItem = NULL;
                hr = FindItem(&gidItem, &pNodeItem);
                if (SUCCEEDED(hr))
                {
                    IXMLDOMNode* pNodeClone = NULL;
                    hr = pNodeItem->cloneNode(TRUE, &pNodeClone);
                    if (SUCCEEDED(hr))
                    {
                        hr = pNodeClone->QueryInterface(IID_IUnknown, (void**)ppUnkData);

                        pNodeClone->Release();
                    }

                    pNodeItem->Release();                
                }
            }

            pChange->Release();
        }
    }

    return hr;
}

-see-also

ILoadChangeContext Interface

ISynchronousDataRetriever Interface