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
2eb2d740
Commit
2eb2d740
authored
Feb 07, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Use queue for whole ReportData implementation.
parent
16bf14d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
31 deletions
+40
-31
binding.c
dlls/urlmon/binding.c
+40
-31
No files found.
dlls/urlmon/binding.c
View file @
2eb2d740
...
...
@@ -812,26 +812,61 @@ static HRESULT WINAPI InternetProtocolSink_ReportProgress(IInternetProtocolSink
return
S_OK
;
}
static
void
report_data
(
Binding
*
This
,
DWORD
bscf
)
static
void
report_data
(
Binding
*
This
,
DWORD
bscf
,
ULONG
progress
,
ULONG
progress_max
)
{
FORMATETC
formatetc
=
{
0
,
NULL
,
1
,
-
1
,
TYMED_ISTREAM
};
TRACE
(
"(%p)->(%d %u %u)
\n
"
,
This
,
bscf
,
progress
,
progress_max
);
if
(
GetCurrentThreadId
()
!=
This
->
apartment_thread
)
FIXME
(
"called from worked hread
\n
"
);
if
(
!
This
->
verified_mime
)
{
LPWSTR
mime
;
This
->
verified_mime
=
TRUE
;
fill_stream_buffer
(
This
->
stream
);
FindMimeFromData
(
NULL
,
This
->
url
,
This
->
stream
->
buf
,
min
(
This
->
stream
->
buf_size
,
255
),
This
->
mime
,
0
,
&
mime
,
0
);
on_progress
(
This
,
progress
,
progress_max
,
BINDSTATUS_MIMETYPEAVAILABLE
,
mime
);
}
if
(
bscf
&
BSCF_FIRSTDATANOTIFICATION
)
{
on_progress
(
This
,
progress
,
progress_max
,
BINDSTATUS_BEGINDOWNLOADDATA
,
This
->
url
);
}
if
(
bscf
&
BSCF_LASTDATANOTIFICATION
)
on_progress
(
This
,
progress
,
progress_max
,
BINDSTATUS_ENDDOWNLOADDATA
,
This
->
url
);
if
(
!
This
->
request_locked
)
{
HRESULT
hres
=
IInternetProtocol_LockRequest
(
This
->
protocol
,
0
);
This
->
request_locked
=
SUCCEEDED
(
hres
);
}
fill_stream_buffer
(
This
->
stream
);
IBindStatusCallback_OnDataAvailable
(
This
->
callback
,
bscf
,
This
->
stream
->
buf_size
,
&
formatetc
,
&
This
->
stgmed
);
if
(
bscf
&
BSCF_LASTDATANOTIFICATION
)
IBindStatusCallback_OnStopBinding
(
This
->
callback
,
S_OK
,
NULL
);
}
typedef
struct
{
task_header_t
header
;
DWORD
bscf
;
ULONG
progress
;
ULONG
progress_max
;
}
report_data_task_t
;
static
void
report_data_proc
(
Binding
*
binding
,
task_header_t
*
t
)
{
report_data_task_t
*
task
=
(
report_data_task_t
*
)
t
;
report_data
(
binding
,
task
->
bscf
);
report_data
(
binding
,
task
->
bscf
,
task
->
progress
,
task
->
progress_max
);
HeapFree
(
GetProcessHeap
(),
0
,
task
);
}
...
...
@@ -846,43 +881,17 @@ static HRESULT WINAPI InternetProtocolSink_ReportData(IInternetProtocolSink *ifa
if
(
GetCurrentThreadId
()
!=
This
->
apartment_thread
)
FIXME
(
"called from worked hread
\n
"
);
if
(
!
This
->
verified_mime
)
{
LPWSTR
mime
;
This
->
verified_mime
=
TRUE
;
fill_stream_buffer
(
This
->
stream
);
FindMimeFromData
(
NULL
,
This
->
url
,
This
->
stream
->
buf
,
min
(
This
->
stream
->
buf_size
,
255
),
This
->
mime
,
0
,
&
mime
,
0
);
on_progress
(
This
,
ulProgress
,
ulProgressMax
,
BINDSTATUS_MIMETYPEAVAILABLE
,
mime
);
}
if
(
grfBSCF
&
BSCF_FIRSTDATANOTIFICATION
)
{
on_progress
(
This
,
ulProgress
,
ulProgressMax
,
BINDSTATUS_BEGINDOWNLOADDATA
,
This
->
url
);
}
if
(
grfBSCF
&
BSCF_LASTDATANOTIFICATION
)
on_progress
(
This
,
ulProgress
,
ulProgressMax
,
BINDSTATUS_ENDDOWNLOADDATA
,
This
->
url
);
if
(
!
This
->
request_locked
)
{
HRESULT
hres
=
IInternetProtocol_LockRequest
(
This
->
protocol
,
0
);
This
->
request_locked
=
SUCCEEDED
(
hres
);
}
if
(
This
->
continue_call
)
{
report_data_task_t
*
task
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
report_data_task_t
));
task
->
bscf
=
grfBSCF
;
task
->
progress
=
ulProgress
;
task
->
progress_max
=
ulProgressMax
;
push_task
(
This
,
&
task
->
header
,
report_data_proc
);
}
else
{
report_data
(
This
,
grfBSCF
);
report_data
(
This
,
grfBSCF
,
ulProgress
,
ulProgressMax
);
}
if
(
grfBSCF
&
BSCF_LASTDATANOTIFICATION
)
IBindStatusCallback_OnStopBinding
(
This
->
callback
,
S_OK
,
NULL
);
return
S_OK
;
}
...
...
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