IProvHelper::FlushRollbackData


Saves rollback data to a persistent store. Used by providers that interact with Microsoft. Provisioning Framework (MPF).

This function is useful whenever a provider needs intermediate checkpoints for rollback data since, by default, provisioning engines only flush rollback data after the provider procedure (or more precisely, the IProvProvider::ProcessRequest call) returns successfully. This function stores rollback data per action, per provider.

Syntax

C++
HRESULT FlushRollbackData  (
);
Visual Basic
Sub FlushRollbackData ( _
)

Return Codes

Zero indicates success; a non-zero value represents an error. For a list of error codes, see MPF Errors.

C++ Example

BSTR bstrKey;
VARIANT vValue;
HRESULT hr = E_OUTOFMEMORY;

bstrKey = ::SysAllocString(L"fileName");
vValue.bstrVal = ::SysAllocString(L"sample.txt");
vValue.vt = VT_BSTR;

if(bstrKey && vValue.bstrVal)
	hr = m_pProvHelper->SetRollbackData(bstrKey, vValue);

::SysFreeString(bstrKey);
::VariantClear(vValue);

if(FAILED(hr))
	return hr;

// You can call SetRollbackData several times 
...

// All rollback data will be saved now 
hr = m_pProvHelper->FlushRollbackData()

Visual Basic Example

Dim strKey
Dim vValue

strKey = "fileName"
vValue = "sample.txt"
Call mProvHelper.SetRollbackData(strKey, vValue)

' You can call SetRollbackData several times 
...

' All rollback data will be saved now 
Call mProvHelper.FlushRollbackData()

See Also

IProvHelper, GetRollBackData, Transactions


Up Top of Page
) 1999-2002 Microsoft Corporation. All rights reserved.