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
428c1bba
Commit
428c1bba
authored
Oct 06, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Use existing callback holder in RegisterBindStatusCallback if already exists.
parent
1db24bed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
14 deletions
+40
-14
bindctx.c
dlls/urlmon/bindctx.c
+40
-14
No files found.
dlls/urlmon/bindctx.c
View file @
428c1bba
...
@@ -460,9 +460,30 @@ static const IAuthenticateVtbl BSCAuthenticateVtbl = {
...
@@ -460,9 +460,30 @@ static const IAuthenticateVtbl BSCAuthenticateVtbl = {
BSCAuthenticate_Authenticate
BSCAuthenticate_Authenticate
};
};
static
IBindStatusCallback
*
create_bsc
(
IBindStatusCallback
*
bsc
)
static
void
set_callback
(
BindStatusCallback
*
This
,
IBindStatusCallback
*
bsc
)
{
{
BindStatusCallback
*
ret
=
heap_alloc_zero
(
sizeof
(
BindStatusCallback
));
IServiceProvider
*
serv_prov
;
HRESULT
hres
;
if
(
This
->
callback
)
IBindStatusCallback_Release
(
This
->
callback
);
if
(
This
->
serv_prov
)
IServiceProvider_Release
(
This
->
serv_prov
);
IBindStatusCallback_AddRef
(
bsc
);
This
->
callback
=
bsc
;
hres
=
IBindStatusCallback_QueryInterface
(
bsc
,
&
IID_IServiceProvider
,
(
void
**
)
&
serv_prov
);
This
->
serv_prov
=
hres
==
S_OK
?
serv_prov
:
NULL
;
}
static
HRESULT
wrap_callback
(
IBindStatusCallback
*
bsc
,
IBindStatusCallback
**
ret_iface
)
{
BindStatusCallback
*
ret
;
ret
=
heap_alloc_zero
(
sizeof
(
BindStatusCallback
));
if
(
!
ret
)
return
E_OUTOFMEMORY
;
ret
->
lpBindStatusCallbackExVtbl
=
&
BindStatusCallbackExVtbl
;
ret
->
lpBindStatusCallbackExVtbl
=
&
BindStatusCallbackExVtbl
;
ret
->
lpServiceProviderVtbl
=
&
BSCServiceProviderVtbl
;
ret
->
lpServiceProviderVtbl
=
&
BSCServiceProviderVtbl
;
...
@@ -470,13 +491,10 @@ static IBindStatusCallback *create_bsc(IBindStatusCallback *bsc)
...
@@ -470,13 +491,10 @@ static IBindStatusCallback *create_bsc(IBindStatusCallback *bsc)
ret
->
lpAuthenticateVtbl
=
&
BSCAuthenticateVtbl
;
ret
->
lpAuthenticateVtbl
=
&
BSCAuthenticateVtbl
;
ret
->
ref
=
1
;
ret
->
ref
=
1
;
set_callback
(
ret
,
bsc
);
IBindStatusCallback_AddRef
(
bsc
);
*
ret_iface
=
STATUSCLB
(
ret
);
ret
->
callback
=
bsc
;
return
S_OK
;
IBindStatusCallback_QueryInterface
(
bsc
,
&
IID_IServiceProvider
,
(
void
**
)
&
ret
->
serv_prov
);
return
STATUSCLB
(
ret
);
}
}
/***********************************************************************
/***********************************************************************
...
@@ -511,25 +529,33 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
...
@@ -511,25 +529,33 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
hres
=
IBindCtx_GetObjectParam
(
pbc
,
BSCBHolder
,
&
unk
);
hres
=
IBindCtx_GetObjectParam
(
pbc
,
BSCBHolder
,
&
unk
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBindStatusCallback
,
(
void
**
)
&
bsc
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBindStatusCallback
,
(
void
**
)
&
bsc
);
IUnknown_Release
(
unk
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
hres
=
IBindStatusCallback_QueryInterface
(
bsc
,
&
IID_IBindStatusCallbackHolder
,
(
void
**
)
&
holder
);
hres
=
IBindStatusCallback_QueryInterface
(
bsc
,
&
IID_IBindStatusCallbackHolder
,
(
void
**
)
&
holder
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
prev
=
holder
->
callback
;
if
(
ppbscPrevious
)
{
IBindStatusCallback_AddRef
(
prev
);
IBindStatusCallback_AddRef
(
holder
->
callback
);
*
ppbscPrevious
=
holder
->
callback
;
}
set_callback
(
holder
,
pbsc
);
IBindStatusCallback_Release
(
bsc
);
IBindStatusCallback_Release
(
bsc
);
IBindStatusCallback_Release
(
STATUSCLB
(
holder
));
IBindStatusCallback_Release
(
STATUSCLB
(
holder
));
return
S_OK
;
}
else
{
}
else
{
prev
=
bsc
;
prev
=
bsc
;
}
}
}
}
IUnknown_Release
(
unk
);
IBindCtx_RevokeObjectParam
(
pbc
,
BSCBHolder
);
IBindCtx_RevokeObjectParam
(
pbc
,
BSCBHolder
);
}
}
bsc
=
create_bsc
(
pbsc
);
hres
=
wrap_callback
(
pbsc
,
&
bsc
);
hres
=
IBindCtx_RegisterObjectParam
(
pbc
,
BSCBHolder
,
(
IUnknown
*
)
bsc
);
if
(
SUCCEEDED
(
hres
))
{
IBindStatusCallback_Release
(
bsc
);
hres
=
IBindCtx_RegisterObjectParam
(
pbc
,
BSCBHolder
,
(
IUnknown
*
)
bsc
);
IBindStatusCallback_Release
(
bsc
);
}
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
if
(
prev
)
if
(
prev
)
IBindStatusCallback_Release
(
prev
);
IBindStatusCallback_Release
(
prev
);
...
...
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