Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2b3c115a
Commit
2b3c115a
authored
Jan 31, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added support for binding to IID_IUnknown storage (cache file).
parent
458d27fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
5 deletions
+72
-5
binding.c
dlls/urlmon/binding.c
+72
-5
No files found.
dlls/urlmon/binding.c
View file @
2b3c115a
...
...
@@ -788,6 +788,11 @@ static const stgmed_obj_vtbl stgmed_stream_vtbl = {
stgmed_stream_get_result
};
typedef
struct
{
stgmed_obj_t
stgmed_obj
;
stgmed_buf_t
*
buf
;
}
stgmed_file_obj_t
;
static
stgmed_obj_t
*
create_stgmed_stream
(
stgmed_buf_t
*
buf
)
{
ProtocolStream
*
ret
=
heap_alloc
(
sizeof
(
ProtocolStream
));
...
...
@@ -804,6 +809,61 @@ static stgmed_obj_t *create_stgmed_stream(stgmed_buf_t *buf)
return
&
ret
->
stgmed_obj
;
}
static
void
stgmed_file_release
(
stgmed_obj_t
*
obj
)
{
heap_free
(
obj
);
}
static
HRESULT
stgmed_file_fill_stgmed
(
stgmed_obj_t
*
obj
,
STGMEDIUM
*
stgmed
)
{
stgmed_file_obj_t
*
file_obj
=
(
stgmed_file_obj_t
*
)
obj
;
if
(
!
file_obj
->
buf
->
cache_file
)
{
WARN
(
"cache_file not set
\n
"
);
return
INET_E_DATA_NOT_AVAILABLE
;
}
fill_stgmed_buffer
(
file_obj
->
buf
);
if
(
file_obj
->
buf
->
size
==
sizeof
(
file_obj
->
buf
->
buf
))
{
BYTE
buf
[
1024
];
DWORD
read
;
HRESULT
hres
;
do
{
hres
=
IInternetProtocol_Read
(
file_obj
->
buf
->
protocol
,
buf
,
sizeof
(
buf
),
&
read
);
}
while
(
hres
==
S_OK
);
}
stgmed
->
tymed
=
TYMED_FILE
;
stgmed
->
u
.
lpszFileName
=
file_obj
->
buf
->
cache_file
;
stgmed
->
pUnkForRelease
=
STGMEDUNK
(
file_obj
->
buf
);
return
S_OK
;
}
static
void
*
stgmed_file_get_result
(
stgmed_obj_t
*
obj
)
{
return
NULL
;
}
static
const
stgmed_obj_vtbl
stgmed_file_vtbl
=
{
stgmed_file_release
,
stgmed_file_fill_stgmed
,
stgmed_file_get_result
};
static
stgmed_obj_t
*
create_stgmed_file
(
stgmed_buf_t
*
buf
)
{
stgmed_file_obj_t
*
ret
=
heap_alloc
(
sizeof
(
*
ret
));
ret
->
stgmed_obj
.
vtbl
=
&
stgmed_file_vtbl
;
IUnknown_AddRef
(
STGMEDUNK
(
buf
));
ret
->
buf
=
buf
;
return
&
ret
->
stgmed_obj
;
}
#define BINDING_THIS(iface) DEFINE_THIS(Binding, Binding, iface)
static
HRESULT
WINAPI
Binding_QueryInterface
(
IBinding
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -1160,6 +1220,7 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres
create_object
(
This
);
}
else
{
STGMEDIUM
stgmed
;
HRESULT
hres
;
if
(
!
(
This
->
state
&
BINDING_LOCKED
))
{
HRESULT
hres
=
IInternetProtocol_LockRequest
(
This
->
protocol
,
0
);
...
...
@@ -1167,8 +1228,14 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres
This
->
state
|=
BINDING_LOCKED
;
}
hres
=
This
->
stgmed_obj
->
vtbl
->
fill_stgmed
(
This
->
stgmed_obj
,
&
stgmed
);
if
(
FAILED
(
hres
))
{
stop_binding
(
This
,
hres
,
NULL
);
return
;
}
formatetc
.
tymed
=
stgmed
.
tymed
;
formatetc
.
cfFormat
=
This
->
clipboard_format
;
This
->
stgmed_obj
->
vtbl
->
fill_stgmed
(
This
->
stgmed_obj
,
&
stgmed
);
IBindStatusCallback_OnDataAvailable
(
This
->
callback
,
bscf
,
progress
,
&
formatetc
,
&
stgmed
);
...
...
@@ -1554,6 +1621,9 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, LPCWSTR url,
ret
->
stgmed_obj
=
NULL
;
}
else
if
(
IsEqualGUID
(
&
IID_IStream
,
riid
))
{
ret
->
stgmed_obj
=
create_stgmed_stream
(
ret
->
stgmed_buf
);
}
else
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
ret
->
bindf
|=
BINDF_NEEDFILE
;
ret
->
stgmed_obj
=
create_stgmed_file
(
ret
->
stgmed_buf
);
}
else
{
FIXME
(
"Unsupported riid %s
\n
"
,
debugstr_guid
(
riid
));
IBinding_Release
(
BINDING
(
ret
));
...
...
@@ -1633,14 +1703,11 @@ HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
IInternetProtocol_UnlockRequest
(
binding
->
protocol
);
*
ppv
=
binding
->
stgmed_obj
->
vtbl
->
get_result
(
binding
->
stgmed_obj
);
hres
=
S_OK
;
}
else
{
hres
=
MK_S_ASYNCHRONOUS
;
}
IBinding_Release
(
BINDING
(
binding
));
return
hres
;
return
*
ppv
?
S_OK
:
MK_S_ASYNCHRONOUS
;
}
HRESULT
bind_to_object
(
IMoniker
*
mon
,
LPCWSTR
url
,
IBindCtx
*
pbc
,
REFIID
riid
,
void
**
ppv
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment