Function GetVolumeStream

Synopsis

#include <include/fileupdatecallback.hpp>

STDMETHOD() GetVolumeStream(UInt32 index, ISequentialOutStream **volumeStream)

Description

No description yet.

Source

Lines 148-163 in src/fileupdatecallback.cpp. Line 50 in include/fileupdatecallback.hpp.

HRESULT FileUpdateCallback::GetVolumeStream( UInt32 index, ISequentialOutStream** volumeStream ) {
    wstring res = ( index < 9 ? L"00" : index < 99 ? L"0" : L"" ) + std::to_wstring( index + 1 );

    wstring fileName = mVolName + L'.' + res;// + mVolExt;
    auto* streamSpec = new COutFileStream;
    CMyComPtr< ISequentialOutStream > streamLoc( streamSpec );

    if ( !streamSpec->Create( fileName.c_str(), false ) ) {
        //return ::GetLastError();
        DWORD last_error = ::GetLastError();
        return ( last_error == 0 ) ? E_FAIL : HRESULT_FROM_WIN32( last_error );
    }

    *volumeStream = streamLoc.Detach();
    return S_OK;
}





Add Discussion as Guest

Log in