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
3886d7f8
Commit
3886d7f8
authored
Apr 29, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Fixed synchronous binding to file.
parent
d5672fee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
21 deletions
+35
-21
binding.c
dlls/urlmon/binding.c
+10
-7
url.c
dlls/urlmon/tests/url.c
+25
-14
No files found.
dlls/urlmon/binding.c
View file @
3886d7f8
...
...
@@ -57,7 +57,7 @@ typedef struct _stgmed_obj_t stgmed_obj_t;
typedef
struct
{
void
(
*
release
)(
stgmed_obj_t
*
);
HRESULT
(
*
fill_stgmed
)(
stgmed_obj_t
*
,
STGMEDIUM
*
);
void
*
(
*
get_result
)(
stgmed_obj_t
*
);
HRESULT
(
*
get_result
)(
stgmed_obj_t
*
,
DWORD
,
void
*
*
);
}
stgmed_obj_vtbl
;
struct
_stgmed_obj_t
{
...
...
@@ -637,12 +637,13 @@ static HRESULT stgmed_stream_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed)
return
S_OK
;
}
static
void
*
stgmed_stream_get_result
(
stgmed_obj_t
*
obj
)
static
HRESULT
stgmed_stream_get_result
(
stgmed_obj_t
*
obj
,
DWORD
bindf
,
void
**
result
)
{
ProtocolStream
*
stream
=
(
ProtocolStream
*
)
obj
;
IStream_AddRef
(
STREAM
(
stream
));
return
STREAM
(
stream
);
*
result
=
STREAM
(
stream
);
return
S_OK
;
}
static
const
stgmed_obj_vtbl
stgmed_stream_vtbl
=
{
...
...
@@ -707,9 +708,9 @@ static HRESULT stgmed_file_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed)
return
S_OK
;
}
static
void
*
stgmed_file_get_result
(
stgmed_obj_t
*
obj
)
static
HRESULT
stgmed_file_get_result
(
stgmed_obj_t
*
obj
,
DWORD
bindf
,
void
**
result
)
{
return
NULL
;
return
bindf
&
BINDF_ASYNCHRONOUS
?
MK_S_ASYNCHRONOUS
:
S_OK
;
}
static
const
stgmed_obj_vtbl
stgmed_file_vtbl
=
{
...
...
@@ -1530,12 +1531,14 @@ HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
if
((
binding
->
state
&
BINDING_STOPPED
)
&&
(
binding
->
state
&
BINDING_LOCKED
))
IInternetProtocol_UnlockRequest
(
binding
->
protocol
);
*
ppv
=
binding
->
stgmed_obj
->
vtbl
->
get_result
(
binding
->
stgmed_obj
);
hres
=
binding
->
stgmed_obj
->
vtbl
->
get_result
(
binding
->
stgmed_obj
,
binding
->
bindf
,
ppv
);
}
else
{
hres
=
MK_S_ASYNCHRONOUS
;
}
IBinding_Release
(
BINDING
(
binding
));
return
*
ppv
?
S_OK
:
MK_S_ASYNCHRONOUS
;
return
hres
;
}
HRESULT
bind_to_object
(
IMoniker
*
mon
,
LPCWSTR
url
,
IBindCtx
*
pbc
,
REFIID
riid
,
void
**
ppv
)
...
...
dlls/urlmon/tests/url.c
View file @
3886d7f8
...
...
@@ -479,7 +479,7 @@ static HRESULT WINAPI Protocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
DWORD
grfPI
,
HANDLE_PTR
dwReserved
)
{
BINDINFO
bindinfo
;
DWORD
bind
f
,
bscf
=
BSCF_FIRSTDATANOTIFICATION
|
BSCF_LASTDATANOTIFICATION
;
DWORD
bind
_info
,
bscf
=
BSCF_FIRSTDATANOTIFICATION
|
BSCF_LASTDATANOTIFICATION
;
HRESULT
hres
;
static
const
STGMEDIUM
stgmed_zero
=
{
0
};
...
...
@@ -509,20 +509,21 @@ static HRESULT WINAPI Protocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
memset
(
&
bindinfo
,
0
,
sizeof
(
bindinfo
));
bindinfo
.
cbSize
=
sizeof
(
bindinfo
);
hres
=
IInternetBindInfo_GetBindInfo
(
pOIBindInfo
,
&
bind
f
,
&
bindinfo
);
hres
=
IInternetBindInfo_GetBindInfo
(
pOIBindInfo
,
&
bind
_info
,
&
bindinfo
);
ok
(
hres
==
S_OK
,
"GetBindInfo failed: %08x
\n
"
,
hres
);
if
(
filedwl_api
)
{
ok
(
bind
f
==
(
BINDF_PULLDATA
|
BINDF_FROMURLMON
|
BINDF_NEEDFILE
),
"bindf=%08x
\n
"
,
bindf
);
ok
(
bind
_info
==
(
BINDF_PULLDATA
|
BINDF_FROMURLMON
|
BINDF_NEEDFILE
),
"bind_info=%08x
\n
"
,
bind_info
);
}
else
if
(
tymed
==
TYMED_ISTREAM
&&
is_urlmon_protocol
(
test_protocol
))
{
ok
(
bind
f
==
(
BINDF_ASYNCHRONOUS
|
BINDF_ASYNCSTORAGE
|
BINDF_PULLDATA
ok
(
bind
_info
==
(
BINDF_ASYNCHRONOUS
|
BINDF_ASYNCSTORAGE
|
BINDF_PULLDATA
|
BINDF_FROMURLMON
),
"bind
f=%08x
\n
"
,
bindf
);
}
else
{
ok
(
bind
f
==
(
BINDF_ASYNCHRONOUS
|
BINDF_ASYNCSTORAGE
|
BINDF_PULLDATA
"bind
_info=%08x
\n
"
,
bind_info
);
}
else
if
(
bindf
&
BINDF_ASYNCHRONOUS
)
{
ok
(
bind
_info
==
(
BINDF_ASYNCHRONOUS
|
BINDF_ASYNCSTORAGE
|
BINDF_PULLDATA
|
BINDF_FROMURLMON
|
BINDF_NEEDFILE
),
"bindf=%08x
\n
"
,
bindf
);
}
"bind_info=%08x
\n
"
,
bind_info
);
}
else
ok
(
bind_info
==
(
BINDF_FROMURLMON
|
BINDF_NEEDFILE
),
"bind_info=%08x
\n
"
,
bind_info
);
ok
(
bindinfo
.
cbSize
==
sizeof
(
bindinfo
),
"bindinfo.cbSize = %d
\n
"
,
bindinfo
.
cbSize
);
ok
(
!
bindinfo
.
szExtraInfo
,
"bindinfo.szExtraInfo = %p
\n
"
,
bindinfo
.
szExtraInfo
);
...
...
@@ -1283,7 +1284,7 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG u
todo_wine
CHECK_EXPECT
(
OnProgress_FINDINGRESOURCE
);
else
CHECK_EXPECT
(
OnProgress_FINDINGRESOURCE
);
if
(
(
bindf
&
BINDF_ASYNCHRONOUS
)
&&
emulate_protocol
)
if
(
emulate_protocol
&&
(
test_protocol
==
HTTP_TEST
||
test_protocol
==
HTTPS_TEST
)
)
SetEvent
(
complete_event
);
break
;
case
BINDSTATUS_CONNECTING
:
...
...
@@ -1293,7 +1294,7 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG u
todo_wine
CHECK_EXPECT
(
OnProgress_CONNECTING
);
else
CHECK_EXPECT
(
OnProgress_CONNECTING
);
if
(
(
bindf
&
BINDF_ASYNCHRONOUS
)
&&
emulate_protocol
)
if
(
emulate_protocol
&&
(
test_protocol
==
HTTP_TEST
||
test_protocol
==
HTTPS_TEST
)
)
SetEvent
(
complete_event
);
break
;
case
BINDSTATUS_REDIRECTING
:
...
...
@@ -1303,7 +1304,8 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG u
CHECK_EXPECT
(
OnProgress_REDIRECTING
);
ok
(
!
lstrcmpW
(
szStatusText
,
WINE_ABOUT_URL
),
"unexpected status text %s
\n
"
,
wine_dbgstr_w
(
szStatusText
));
if
(
!
bind_to_object
||
iface
==
&
objbsc
)
if
(
emulate_protocol
&&
(
test_protocol
==
HTTP_TEST
||
test_protocol
==
HTTPS_TEST
)
&&
(
!
bind_to_object
||
iface
==
&
objbsc
))
SetEvent
(
complete_event
);
break
;
case
BINDSTATUS_SENDINGREQUEST
:
...
...
@@ -1313,7 +1315,7 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG u
CHECK_EXPECT2
(
OnProgress_SENDINGREQUEST
);
else
CHECK_EXPECT
(
OnProgress_SENDINGREQUEST
);
if
(
(
bindf
&
BINDF_ASYNCHRONOUS
)
&&
emulate_protocol
)
if
(
emulate_protocol
&&
(
test_protocol
==
HTTP_TEST
||
test_protocol
==
HTTPS_TEST
)
)
SetEvent
(
complete_event
);
break
;
case
BINDSTATUS_MIMETYPEAVAILABLE
:
...
...
@@ -2353,7 +2355,10 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
return
;
}
if
(((
bindf
&
BINDF_ASYNCHRONOUS
)
&&
!
data_available
)
if
(
!
(
bindf
&
BINDF_ASYNCHRONOUS
)
&&
tymed
==
TYMED_FILE
)
{
ok
(
hres
==
S_OK
,
"IMoniker_BindToStorage failed: %08x
\n
"
,
hres
);
ok
(
unk
==
NULL
,
"unk != NULL
\n
"
);
}
else
if
(((
bindf
&
BINDF_ASYNCHRONOUS
)
&&
!
data_available
)
||
(
tymed
==
TYMED_FILE
&&
test_protocol
==
FILE_TEST
))
{
ok
(
hres
==
MK_S_ASYNCHRONOUS
,
"IMoniker_BindToStorage failed: %08x
\n
"
,
hres
);
ok
(
unk
==
NULL
,
"istr should be NULL
\n
"
);
...
...
@@ -2906,12 +2911,18 @@ START_TEST(url)
trace
(
"synchronous http test...
\n
"
);
test_BindToStorage
(
HTTP_TEST
,
0
,
TYMED_ISTREAM
);
trace
(
"emulated synchronous http test (to file)...
\n
"
);
test_BindToStorage
(
HTTP_TEST
,
BINDTEST_EMULATE
,
TYMED_FILE
);
trace
(
"synchronous http test (to object)...
\n
"
);
test_BindToObject
(
HTTP_TEST
,
0
);
trace
(
"synchronous file test...
\n
"
);
test_BindToStorage
(
FILE_TEST
,
0
,
TYMED_ISTREAM
);
trace
(
"emulated synchronous file test (to file)...
\n
"
);
test_BindToStorage
(
FILE_TEST
,
BINDTEST_EMULATE
,
TYMED_FILE
);
trace
(
"synchronous file test (to object)...
\n
"
);
test_BindToObject
(
FILE_TEST
,
0
);
...
...
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