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
8012d4ae
Commit
8012d4ae
authored
Nov 02, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Moved extracting callback from IBindCtx to separated function.
parent
54639c5d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
32 deletions
+47
-32
bindctx.c
dlls/urlmon/bindctx.c
+47
-32
No files found.
dlls/urlmon/bindctx.c
View file @
8012d4ae
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
static
WCHAR
BSCBHolder
[]
=
{
'_'
,
'B'
,
'S'
,
'C'
,
'B'
,
'_'
,
'H'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'_'
,
0
};
static
WCHAR
bscb_holderW
[]
=
{
'_'
,
'B'
,
'S'
,
'C'
,
'B'
,
'_'
,
'H'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'_'
,
0
};
extern
IID
IID_IBindStatusCallbackHolder
;
extern
IID
IID_IBindStatusCallbackHolder
;
...
@@ -51,6 +51,44 @@ static void *get_callback_iface(BindStatusCallback *This, REFIID riid)
...
@@ -51,6 +51,44 @@ static void *get_callback_iface(BindStatusCallback *This, REFIID riid)
return
SUCCEEDED
(
hres
)
?
ret
:
NULL
;
return
SUCCEEDED
(
hres
)
?
ret
:
NULL
;
}
}
static
IBindStatusCallback
*
bsch_from_bctx
(
IBindCtx
*
bctx
)
{
IBindStatusCallback
*
bsc
;
IUnknown
*
unk
;
HRESULT
hres
;
hres
=
IBindCtx_GetObjectParam
(
bctx
,
bscb_holderW
,
&
unk
);
if
(
FAILED
(
hres
))
return
NULL
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBindStatusCallback
,
(
void
**
)
&
bsc
);
IUnknown_Release
(
unk
);
return
SUCCEEDED
(
hres
)
?
bsc
:
NULL
;
}
static
IBindStatusCallback
*
bsc_from_bctx
(
IBindCtx
*
bctx
)
{
BindStatusCallback
*
holder
;
IBindStatusCallback
*
bsc
;
HRESULT
hres
;
bsc
=
bsch_from_bctx
(
bctx
);
if
(
!
bsc
)
return
NULL
;
hres
=
IBindStatusCallback_QueryInterface
(
bsc
,
&
IID_IBindStatusCallbackHolder
,
(
void
**
)
&
holder
);
if
(
FAILED
(
hres
))
return
bsc
;
if
(
holder
->
callback
)
{
IBindStatusCallback_Release
(
bsc
);
bsc
=
holder
->
callback
;
}
IBindStatusCallbackEx_Release
(
&
holder
->
IBindStatusCallbackEx_iface
);
return
bsc
;
}
static
inline
BindStatusCallback
*
impl_from_IBindStatusCallbackEx
(
IBindStatusCallbackEx
*
iface
)
static
inline
BindStatusCallback
*
impl_from_IBindStatusCallbackEx
(
IBindStatusCallbackEx
*
iface
)
{
{
return
CONTAINING_RECORD
(
iface
,
BindStatusCallback
,
IBindStatusCallbackEx_iface
);
return
CONTAINING_RECORD
(
iface
,
BindStatusCallback
,
IBindStatusCallbackEx_iface
);
...
@@ -516,7 +554,6 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
...
@@ -516,7 +554,6 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
{
{
BindStatusCallback
*
holder
;
BindStatusCallback
*
holder
;
IBindStatusCallback
*
bsc
,
*
prev
=
NULL
;
IBindStatusCallback
*
bsc
,
*
prev
=
NULL
;
IUnknown
*
unk
;
HRESULT
hres
;
HRESULT
hres
;
TRACE
(
"(%p %p %p %x)
\n
"
,
pbc
,
pbsc
,
ppbscPrevious
,
dwReserved
);
TRACE
(
"(%p %p %p %x)
\n
"
,
pbc
,
pbsc
,
ppbscPrevious
,
dwReserved
);
...
@@ -524,11 +561,8 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
...
@@ -524,11 +561,8 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
if
(
!
pbc
||
!
pbsc
)
if
(
!
pbc
||
!
pbsc
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
hres
=
IBindCtx_GetObjectParam
(
pbc
,
BSCBHolder
,
&
unk
);
bsc
=
bsch_from_bctx
(
pbc
);
if
(
SUCCEEDED
(
hres
))
{
if
(
bsc
)
{
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBindStatusCallback
,
(
void
**
)
&
bsc
);
IUnknown_Release
(
unk
);
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
))
{
if
(
ppbscPrevious
)
{
if
(
ppbscPrevious
)
{
...
@@ -544,14 +578,13 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
...
@@ -544,14 +578,13 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
}
else
{
}
else
{
prev
=
bsc
;
prev
=
bsc
;
}
}
}
IBindCtx_RevokeObjectParam
(
pbc
,
BSCBHolder
);
IBindCtx_RevokeObjectParam
(
pbc
,
bscb_holderW
);
}
}
hres
=
wrap_callback
(
pbsc
,
&
bsc
);
hres
=
wrap_callback
(
pbsc
,
&
bsc
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
hres
=
IBindCtx_RegisterObjectParam
(
pbc
,
BSCBHolder
,
(
IUnknown
*
)
bsc
);
hres
=
IBindCtx_RegisterObjectParam
(
pbc
,
bscb_holderW
,
(
IUnknown
*
)
bsc
);
IBindStatusCallback_Release
(
bsc
);
IBindStatusCallback_Release
(
bsc
);
}
}
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
...
@@ -579,39 +612,21 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
...
@@ -579,39 +612,21 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
*/
*/
HRESULT
WINAPI
RevokeBindStatusCallback
(
IBindCtx
*
pbc
,
IBindStatusCallback
*
pbsc
)
HRESULT
WINAPI
RevokeBindStatusCallback
(
IBindCtx
*
pbc
,
IBindStatusCallback
*
pbsc
)
{
{
BindStatusCallback
*
holder
;
IBindStatusCallback
*
callback
;
IBindStatusCallback
*
callback
;
IUnknown
*
unk
;
BOOL
dorevoke
=
FALSE
;
HRESULT
hres
;
TRACE
(
"(%p %p)
\n
"
,
pbc
,
pbsc
);
TRACE
(
"(%p %p)
\n
"
,
pbc
,
pbsc
);
if
(
!
pbc
||
!
pbsc
)
if
(
!
pbc
||
!
pbsc
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
hres
=
IBindCtx_GetObjectParam
(
pbc
,
BSCBHolder
,
&
unk
);
callback
=
bsc_from_bctx
(
pbc
);
if
(
FAILED
(
hres
)
)
if
(
!
callback
)
return
S_OK
;
return
S_OK
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBindStatusCallback
,
(
void
**
)
&
callback
);
if
(
callback
==
pbsc
)
IUnknown_Release
(
unk
);
IBindCtx_RevokeObjectParam
(
pbc
,
bscb_holderW
);
if
(
FAILED
(
hres
))
return
S_OK
;
hres
=
IBindStatusCallback_QueryInterface
(
callback
,
&
IID_IBindStatusCallbackHolder
,
(
void
**
)
&
holder
);
if
(
SUCCEEDED
(
hres
))
{
if
(
pbsc
==
holder
->
callback
)
dorevoke
=
TRUE
;
IBindStatusCallbackEx_Release
(
&
holder
->
IBindStatusCallbackEx_iface
);
}
else
if
(
pbsc
==
callback
)
{
dorevoke
=
TRUE
;
}
IBindStatusCallback_Release
(
callback
);
IBindStatusCallback_Release
(
callback
);
if
(
dorevoke
)
IBindCtx_RevokeObjectParam
(
pbc
,
BSCBHolder
);
return
S_OK
;
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