1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome_frame/stream_impl.h"
#include "base/logging.h"
void StreamImpl::Initialize(IStream* delegate) {
delegate_ = delegate;
}
STDMETHODIMP StreamImpl::Write(const void * buffer, ULONG size,
ULONG* size_written) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->Write(buffer, size, size_written);
return hr;
}
STDMETHODIMP StreamImpl::Read(void* pv, ULONG cb, ULONG* read) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->Read(pv, cb, read);
return hr;
}
STDMETHODIMP StreamImpl::Seek(LARGE_INTEGER move, DWORD origin,
ULARGE_INTEGER* new_pos) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->Seek(move, origin, new_pos);
return hr;
}
STDMETHODIMP StreamImpl::SetSize(ULARGE_INTEGER new_size) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->SetSize(new_size);
return hr;
}
STDMETHODIMP StreamImpl::CopyTo(IStream* stream, ULARGE_INTEGER cb,
ULARGE_INTEGER* read,
ULARGE_INTEGER* written) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->CopyTo(stream, cb, read, written);
return hr;
}
STDMETHODIMP StreamImpl::Commit(DWORD flags) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->Commit(flags);
return hr;
}
STDMETHODIMP StreamImpl::Revert() {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->Revert();
return hr;
}
STDMETHODIMP StreamImpl::LockRegion(ULARGE_INTEGER offset, ULARGE_INTEGER cb,
DWORD type) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->LockRegion(offset, cb, type);
return hr;
}
STDMETHODIMP StreamImpl::UnlockRegion(ULARGE_INTEGER offset, ULARGE_INTEGER cb,
DWORD type) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->UnlockRegion(offset, cb, type);
return hr;
}
STDMETHODIMP StreamImpl::Stat(STATSTG* statstg, DWORD flag) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->Stat(statstg, flag);
return hr;
}
STDMETHODIMP StreamImpl::Clone(IStream** stream) {
HRESULT hr = E_NOTIMPL;
if (delegate_)
hr = delegate_->Clone(stream);
return hr;
}
|