other-licenses/7zstub/src/7zip/Common/LockedStream.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // LockedStream.h
michael@0 2
michael@0 3 #ifndef __LOCKEDSTREAM_H
michael@0 4 #define __LOCKEDSTREAM_H
michael@0 5
michael@0 6 #include "../../Windows/Synchronization.h"
michael@0 7 #include "../../Common/MyCom.h"
michael@0 8 #include "../IStream.h"
michael@0 9
michael@0 10 class CLockedInStream
michael@0 11 {
michael@0 12 CMyComPtr<IInStream> _stream;
michael@0 13 NWindows::NSynchronization::CCriticalSection _criticalSection;
michael@0 14 public:
michael@0 15 void Init(IInStream *stream)
michael@0 16 { _stream = stream; }
michael@0 17 HRESULT Read(UInt64 startPos, void *data, UInt32 size, UInt32 *processedSize);
michael@0 18 };
michael@0 19
michael@0 20 class CLockedSequentialInStreamImp:
michael@0 21 public ISequentialInStream,
michael@0 22 public CMyUnknownImp
michael@0 23 {
michael@0 24 CLockedInStream *_lockedInStream;
michael@0 25 UInt64 _pos;
michael@0 26 public:
michael@0 27 void Init(CLockedInStream *lockedInStream, UInt64 startPos)
michael@0 28 {
michael@0 29 _lockedInStream = lockedInStream;
michael@0 30 _pos = startPos;
michael@0 31 }
michael@0 32
michael@0 33 MY_UNKNOWN_IMP
michael@0 34
michael@0 35 STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
michael@0 36 };
michael@0 37
michael@0 38 #endif

mercurial