Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
32671b1d
Commit
32671b1d
authored
Jan 25, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added Seek implementations for streams using cache file.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
df614332
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
12 deletions
+75
-12
binding.c
dlls/urlmon/binding.c
+34
-2
url.c
dlls/urlmon/tests/url.c
+41
-10
No files found.
dlls/urlmon/binding.c
View file @
32671b1d
...
...
@@ -520,8 +520,40 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove
DWORD
dwOrigin
,
ULARGE_INTEGER
*
plibNewPosition
)
{
ProtocolStream
*
This
=
impl_from_IStream
(
iface
);
FIXME
(
"(%p)->(%d %08x %p)
\n
"
,
This
,
dlibMove
.
u
.
LowPart
,
dwOrigin
,
plibNewPosition
);
return
E_NOTIMPL
;
LARGE_INTEGER
new_pos
;
DWORD
method
;
TRACE
(
"(%p)->(%d %08x %p)
\n
"
,
This
,
dlibMove
.
u
.
LowPart
,
dwOrigin
,
plibNewPosition
);
if
(
This
->
buf
->
file
==
INVALID_HANDLE_VALUE
)
{
/* We should probably call protocol handler's Seek. */
FIXME
(
"no cache file, not supported
\n
"
);
return
E_FAIL
;
}
switch
(
dwOrigin
)
{
case
STREAM_SEEK_SET
:
method
=
FILE_BEGIN
;
break
;
case
STREAM_SEEK_CUR
:
method
=
FILE_CURRENT
;
break
;
case
STREAM_SEEK_END
:
method
=
FILE_END
;
break
;
default:
WARN
(
"Invalid origin %x
\n
"
,
dwOrigin
);
return
E_FAIL
;
}
if
(
!
SetFilePointerEx
(
This
->
buf
->
file
,
dlibMove
,
&
new_pos
,
method
))
{
FIXME
(
"SetFilePointerEx failed: %u
\n
"
,
GetLastError
());
return
E_FAIL
;
}
if
(
plibNewPosition
)
plibNewPosition
->
QuadPart
=
new_pos
.
QuadPart
;
return
S_OK
;
}
static
HRESULT
WINAPI
ProtocolStream_SetSize
(
IStream
*
iface
,
ULARGE_INTEGER
libNewSize
)
...
...
dlls/urlmon/tests/url.c
View file @
32671b1d
...
...
@@ -1949,6 +1949,31 @@ static HRESULT WINAPI statusclb_GetBindInfo(IBindStatusCallbackEx *iface, DWORD
return
S_OK
;
}
static
void
test_stream_seek
(
IStream
*
stream
)
{
ULARGE_INTEGER
new_pos
;
LARGE_INTEGER
pos
;
HRESULT
hres
;
pos
.
QuadPart
=
0
;
new_pos
.
QuadPart
=
0xdeadbeef
;
hres
=
IStream_Seek
(
stream
,
pos
,
STREAM_SEEK_SET
,
&
new_pos
);
ok
(
hres
==
S_OK
,
"Seek failed: %08x
\n
"
,
hres
);
ok
(
!
new_pos
.
QuadPart
,
"new_pos.QuadPart != 0
\n
"
);
pos
.
QuadPart
=
0
;
new_pos
.
QuadPart
=
0xdeadbeef
;
hres
=
IStream_Seek
(
stream
,
pos
,
STREAM_SEEK_END
,
&
new_pos
);
ok
(
hres
==
S_OK
,
"Seek failed: %08x
\n
"
,
hres
);
ok
(
new_pos
.
QuadPart
,
"new_pos.QuadPart = 0
\n
"
);
pos
.
QuadPart
=
0
;
new_pos
.
QuadPart
=
0xdeadbeef
;
hres
=
IStream_Seek
(
stream
,
pos
,
100
,
&
new_pos
);
ok
(
hres
==
E_FAIL
,
"Seek failed: %08x
\n
"
,
hres
);
ok
(
new_pos
.
QuadPart
==
0xdeadbeef
,
"unexpected new_pos.QuadPart
\n
"
);
}
static
HRESULT
WINAPI
statusclb_OnDataAvailable
(
IBindStatusCallbackEx
*
iface
,
DWORD
grfBSCF
,
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
{
...
...
@@ -1995,24 +2020,28 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallbackEx *iface, DW
ok
(
pstgmed
->
pUnkForRelease
!=
NULL
,
"pUnkForRelease == NULL
\n
"
);
switch
(
pstgmed
->
tymed
)
{
case
TYMED_ISTREAM
:
case
TYMED_ISTREAM
:
{
IStream
*
stream
=
U
(
*
pstgmed
).
pstm
;
ok
(
stream
!=
NULL
,
"U(*pstgmed).pstm == NULL
\n
"
);
if
(
grfBSCF
&
BSCF_FIRSTDATANOTIFICATION
)
{
STATSTG
stat
;
hres
=
IStream_Write
(
U
(
*
pstgmed
).
pst
m
,
buf
,
10
,
NULL
);
hres
=
IStream_Write
(
strea
m
,
buf
,
10
,
NULL
);
ok
(
hres
==
STG_E_ACCESSDENIED
,
"Write failed: %08x, expected STG_E_ACCESSDENIED
\n
"
,
hres
);
hres
=
IStream_Commit
(
U
(
*
pstgmed
).
pst
m
,
0
);
hres
=
IStream_Commit
(
strea
m
,
0
);
ok
(
hres
==
E_NOTIMPL
,
"Commit failed: %08x, expected E_NOTIMPL
\n
"
,
hres
);
hres
=
IStream_Revert
(
U
(
*
pstgmed
).
pst
m
);
hres
=
IStream_Revert
(
strea
m
);
ok
(
hres
==
E_NOTIMPL
,
"Revert failed: %08x, expected E_NOTIMPL
\n
"
,
hres
);
hres
=
IStream_Stat
(
U
(
*
pstgmed
).
pst
m
,
NULL
,
STATFLAG_NONAME
);
hres
=
IStream_Stat
(
strea
m
,
NULL
,
STATFLAG_NONAME
);
ok
(
hres
==
E_FAIL
,
"hres = %x
\n
"
,
hres
);
if
(
use_cache_file
&&
emulate_protocol
)
{
hres
=
IStream_Stat
(
U
(
*
pstgmed
).
pst
m
,
&
stat
,
STATFLAG_DEFAULT
);
hres
=
IStream_Stat
(
strea
m
,
&
stat
,
STATFLAG_DEFAULT
);
ok
(
hres
==
S_OK
,
"hres = %x
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
stat
.
pwcsName
,
cache_file_name
),
"stat.pwcsName = %s, cache_file_name = %s
\n
"
,
...
...
@@ -2021,7 +2050,7 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallbackEx *iface, DW
ok
(
U
(
stat
.
cbSize
).
LowPart
==
(
bindf
&
BINDF_ASYNCHRONOUS
?
0
:
6500
),
"stat.cbSize.LowPart = %u
\n
"
,
U
(
stat
.
cbSize
).
LowPart
);
}
else
{
hres
=
IStream_Stat
(
U
(
*
pstgmed
).
pst
m
,
&
stat
,
STATFLAG_NONAME
);
hres
=
IStream_Stat
(
strea
m
,
&
stat
,
STATFLAG_NONAME
);
ok
(
hres
==
S_OK
,
"hres = %x
\n
"
,
hres
);
ok
(
!
stat
.
pwcsName
||
broken
(
stat
.
pwcsName
!=
NULL
),
"stat.pwcsName = %s
\n
"
,
wine_dbgstr_w
(
stat
.
pwcsName
));
...
...
@@ -2034,17 +2063,19 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallbackEx *iface, DW
ok
(
stat
.
reserved
==
0
,
"stat.reserved = %x
\n
"
,
stat
.
reserved
);
}
ok
(
U
(
*
pstgmed
).
pstm
!=
NULL
,
"U(*pstgmed).pstm == NULL
\n
"
);
if
(
callback_read
)
{
do
{
hres
=
IStream_Read
(
U
(
*
pstgmed
).
pst
m
,
buf
,
512
,
&
readed
);
hres
=
IStream_Read
(
strea
m
,
buf
,
512
,
&
readed
);
if
(
test_protocol
==
HTTP_TEST
&&
emulate_protocol
&&
readed
)
ok
(
buf
[
0
]
==
(
use_cache_file
&&
!
(
bindf
&
BINDF_ASYNCHRONOUS
)
?
'X'
:
'?'
),
"buf[0] = '%c'
\n
"
,
buf
[
0
]);
}
while
(
hres
==
S_OK
);
ok
(
hres
==
S_FALSE
||
hres
==
E_PENDING
,
"IStream_Read returned %08x
\n
"
,
hres
);
}
break
;
if
(
use_cache_file
&&
(
grfBSCF
&
BSCF_FIRSTDATANOTIFICATION
)
&&
!
(
bindf
&
BINDF_PULLDATA
))
test_stream_seek
(
stream
);
break
;
}
case
TYMED_FILE
:
if
(
test_protocol
==
FILE_TEST
)
ok
(
!
lstrcmpW
(
pstgmed
->
u
.
lpszFileName
,
file_url
+
7
),
...
...
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