michael@0: // OutStreamWithCRC.cpp michael@0: michael@0: #include "StdAfx.h" michael@0: michael@0: #include "OutStreamWithCRC.h" michael@0: michael@0: STDMETHODIMP COutStreamWithCRC::Write(const void *data, michael@0: UInt32 size, UInt32 *processedSize) michael@0: { michael@0: UInt32 realProcessedSize; michael@0: HRESULT result; michael@0: if(!_stream) michael@0: { michael@0: realProcessedSize = size; michael@0: result = S_OK; michael@0: } michael@0: else michael@0: result = _stream->Write(data, size, &realProcessedSize); michael@0: _crc.Update(data, realProcessedSize); michael@0: if(processedSize != NULL) michael@0: *processedSize = realProcessedSize; michael@0: return result; michael@0: }