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
1a6659e8
Commit
1a6659e8
authored
Sep 20, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Remove unnecessary helpers to create/destroy bind context.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dd18a63b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
84 deletions
+27
-84
bindctx.c
dlls/ole32/bindctx.c
+27
-84
No files found.
dlls/ole32/bindctx.c
View file @
1a6659e8
...
...
@@ -30,6 +30,7 @@
#include "objbase.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
...
@@ -112,41 +113,21 @@ static ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface)
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
* BindCtx_Destroy (local function)
*******************************************************************************/
static
HRESULT
BindCtxImpl_Destroy
(
BindCtxImpl
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
/* free the table space memory */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
bindCtxTable
);
/* free the bindctx structure */
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
}
/******************************************************************************
* BindCtx_Release
******************************************************************************/
static
ULONG
WINAPI
BindCtxImpl_Release
(
IBindCtx
*
iface
)
{
BindCtxImpl
*
This
=
impl_from_IBindCtx
(
iface
);
ULONG
ref
;
BindCtxImpl
*
context
=
impl_from_IBindCtx
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
context
->
ref
)
;
TRACE
(
"
(%p)
\n
"
,
This
);
TRACE
(
"
%p refcount %d.
\n
"
,
iface
,
refcount
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
if
(
!
refcount
)
{
/* release all registered objects */
BindCtxImpl_ReleaseBoundObjects
(
&
This
->
IBindCtx_iface
);
BindCtxImpl_Destroy
(
This
);
BindCtxImpl_ReleaseBoundObjects
(
&
context
->
IBindCtx_iface
);
heap_free
(
context
->
bindCtxTable
);
heap_free
(
context
);
}
return
ref
;
return
refcount
;
}
...
...
@@ -487,8 +468,6 @@ static HRESULT BindCtxImpl_ExpandTable(BindCtxImpl *This)
return
S_OK
;
}
/* Virtual function table for the BindCtx class. */
static
const
IBindCtxVtbl
VT_BindCtxImpl
=
{
BindCtxImpl_QueryInterface
,
...
...
@@ -507,73 +486,37 @@ static const IBindCtxVtbl VT_BindCtxImpl =
};
/******************************************************************************
* BindCtx_Construct (local function)
*******************************************************************************/
static
HRESULT
BindCtxImpl_Construct
(
BindCtxImpl
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
/* Initialize the virtual function table.*/
This
->
IBindCtx_iface
.
lpVtbl
=
&
VT_BindCtxImpl
;
This
->
ref
=
0
;
memset
(
&
This
->
options
,
0
,
sizeof
(
This
->
options
));
This
->
options
.
cbStruct
=
sizeof
(
This
->
options
);
This
->
options
.
grfMode
=
STGM_READWRITE
;
This
->
options
.
dwClassContext
=
CLSCTX_SERVER
;
This
->
options
.
locale
=
GetThreadLocale
();
/* Initialize the bindctx table */
This
->
bindCtxTableSize
=
0
;
This
->
bindCtxTableLastIndex
=
0
;
This
->
bindCtxTable
=
NULL
;
return
S_OK
;
}
/******************************************************************************
* CreateBindCtx (OLE32.@)
*
* Creates a bind context. A bind context encompasses information and options
* used when binding to a moniker.
*
* PARAMS
* reserved [I] Reserved. Set to 0.
* ppbc [O] Address that receives the bind context object.
*
* RETURNS
* Success: S_OK.
* Failure: Any HRESULT code.
*/
HRESULT
WINAPI
CreateBindCtx
(
DWORD
reserved
,
LPBC
*
ppbc
)
HRESULT
WINAPI
CreateBindCtx
(
DWORD
reserved
,
IBindCtx
**
bind_context
)
{
BindCtxImpl
*
newBindCtx
;
HRESULT
hr
;
BindCtxImpl
*
object
;
TRACE
(
"
(%d,%p)
\n
"
,
reserved
,
ppbc
);
TRACE
(
"
%#x, %p
\n
"
,
reserved
,
bind_context
);
if
(
!
ppbc
)
return
E_INVALIDARG
;
if
(
!
bind_context
)
return
E_INVALIDARG
;
*
ppbc
=
NULL
;
*
bind_context
=
NULL
;
if
(
reserved
!=
0
)
if
(
reserved
)
{
ERR
(
"reserved should be 0, not 0x%x
\n
"
,
reserved
);
WARN
(
"reserved should be 0, not 0x%x
\n
"
,
reserved
);
return
E_INVALIDARG
;
}
newBindCtx
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BindCtxImpl
));
if
(
newBindCtx
==
0
)
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
hr
=
BindCtxImpl_Construct
(
newBindCtx
)
;
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
newBindCtx
)
;
return
hr
;
}
object
->
IBindCtx_iface
.
lpVtbl
=
&
VT_BindCtxImpl
;
object
->
ref
=
1
;
object
->
options
.
cbStruct
=
sizeof
(
object
->
options
);
object
->
options
.
grfMode
=
STGM_READWRITE
;
object
->
options
.
dwClassContext
=
CLSCTX_SERVER
;
object
->
options
.
locale
=
GetThreadLocale
();
return
BindCtxImpl_QueryInterface
(
&
newBindCtx
->
IBindCtx_iface
,
&
IID_IBindCtx
,(
void
**
)
ppbc
);
*
bind_context
=
&
object
->
IBindCtx_iface
;
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