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
42dda83b
Commit
42dda83b
authored
Feb 06, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
itss: Allow reading from ReportData call.
parent
e39a96c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
protocol.c
dlls/itss/protocol.c
+4
-4
protocol.c
dlls/itss/tests/protocol.c
+24
-2
No files found.
dlls/itss/protocol.c
View file @
42dda83b
...
...
@@ -195,6 +195,10 @@ static HRESULT WINAPI ITSProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
CoTaskMemFree
(
mime
);
}
release_chm
(
This
);
/* Native leaks handle here */
This
->
chm_file
=
chm_file
;
memcpy
(
&
This
->
chm_object
,
&
chm_object
,
sizeof
(
chm_object
));
hres
=
IInternetProtocolSink_ReportData
(
pOIProtSink
,
BSCF_FIRSTDATANOTIFICATION
|
BSCF_DATAFULLYAVAILABLE
,
chm_object
.
length
,
chm_object
.
length
);
...
...
@@ -206,10 +210,6 @@ static HRESULT WINAPI ITSProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
hres
=
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
BINDSTATUS_BEGINDOWNLOADDATA
,
NULL
);
release_chm
(
This
);
/* Native leaks handle here */
This
->
chm_file
=
chm_file
;
memcpy
(
&
This
->
chm_object
,
&
chm_object
,
sizeof
(
chm_object
));
return
report_result
(
pOIProtSink
,
hres
);
}
...
...
dlls/itss/tests/protocol.c
View file @
42dda83b
...
...
@@ -66,6 +66,7 @@ DEFINE_EXPECT(ReportData);
DEFINE_EXPECT
(
ReportResult
);
static
HRESULT
expect_hrResult
;
static
IInternetProtocol
*
read_protocol
=
NULL
;
static
enum
{
ITS_PROTOCOL
,
...
...
@@ -148,11 +149,22 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR
else
ok
(
grfBSCF
==
(
BSCF_FIRSTDATANOTIFICATION
|
BSCF_LASTDATANOTIFICATION
),
"grcf = %08x
\n
"
,
grfBSCF
);
if
(
read_protocol
)
{
BYTE
buf
[
100
];
DWORD
cb
=
0xdeadbeef
;
HRESULT
hres
;
hres
=
IInternetProtocol_Read
(
read_protocol
,
buf
,
sizeof
(
buf
),
&
cb
);
ok
(
hres
==
S_OK
,
"Read failed: %08x
\n
"
,
hres
);
ok
(
cb
==
13
,
"cb=%u expected 13
\n
"
,
cb
);
ok
(
!
memcmp
(
buf
,
"<html></html>"
,
13
),
"unexpected data
\n
"
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
ProtocolSink_ReportResult
(
IInternetProtocolSink
*
iface
,
HRESULT
hrResult
,
DWORD
dwError
,
LPCWSTR
szResult
)
static
HRESULT
WINAPI
ProtocolSink_ReportResult
(
IInternetProtocolSink
*
iface
,
HRESULT
hrResult
,
DWORD
dwError
,
LPCWSTR
szResult
)
{
CHECK_EXPECT
(
ReportResult
);
...
...
@@ -365,6 +377,16 @@ static void test_protocol_url(IClassFactory *factory, LPCWSTR url)
ok
(
cb
==
2
,
"cb=%u expected 2
\n
"
,
cb
);
ref
=
IInternetProtocol_Release
(
protocol
);
ok
(
!
ref
,
"protocol ref=%d
\n
"
,
ref
);
hres
=
IClassFactory_CreateInstance
(
factory
,
NULL
,
&
IID_IInternetProtocol
,
(
void
**
)
&
read_protocol
);
ok
(
hres
==
S_OK
,
"Could not get IInternetProtocol: %08x
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
protocol_start
(
read_protocol
,
url
);
ref
=
IInternetProtocol_Release
(
read_protocol
);
ok
(
!
ref
,
"protocol ref=%d
\n
"
,
ref
);
read_protocol
=
NULL
;
}
static
void
test_its_protocol
(
void
)
...
...
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