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
89ef98ab
Commit
89ef98ab
authored
Nov 03, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Support BIND_OPTS3 in bind context.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ab627418
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
28 deletions
+23
-28
bindctx.c
dlls/ole32/bindctx.c
+15
-23
moniker.c
dlls/ole32/tests/moniker.c
+8
-5
No files found.
dlls/ole32/bindctx.c
View file @
89ef98ab
...
...
@@ -57,7 +57,7 @@ typedef struct BindCtxImpl{
DWORD
bindCtxTableLastIndex
;
/* first free index in the table */
DWORD
bindCtxTableSize
;
/* size table */
BIND_OPTS
2
bindOption2
;
/* a structure which contains the bind options*/
BIND_OPTS
3
options
;
}
BindCtxImpl
;
...
...
@@ -246,17 +246,17 @@ BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
{
BindCtxImpl
*
This
=
impl_from_IBindCtx
(
iface
);
TRACE
(
"(%p,%p)
\n
"
,
This
,
pbindopts
);
TRACE
(
"(%p,%p)
\n
"
,
This
,
pbindopts
);
if
(
pbindopts
==
NULL
)
return
E_POINTER
;
if
(
pbindopts
->
cbStruct
>
sizeof
(
BIND_OPTS2
))
if
(
pbindopts
->
cbStruct
>
sizeof
(
This
->
options
))
{
WARN
(
"invalid size
\n
"
);
return
E_INVALIDARG
;
/* FIXME : not verified */
WARN
(
"invalid size
%u.
\n
"
,
pbindopts
->
cbStruct
);
return
E_INVALIDARG
;
}
memcpy
(
&
This
->
bindOption2
,
pbindopts
,
pbindopts
->
cbStruct
);
memcpy
(
&
This
->
options
,
pbindopts
,
pbindopts
->
cbStruct
);
return
S_OK
;
}
...
...
@@ -267,19 +267,16 @@ static HRESULT WINAPI
BindCtxImpl_GetBindOptions
(
IBindCtx
*
iface
,
BIND_OPTS
*
pbindopts
)
{
BindCtxImpl
*
This
=
impl_from_IBindCtx
(
iface
);
ULONG
cbStruct
;
DWORD
size
;
TRACE
(
"(%p,%p)
\n
"
,
This
,
pbindopts
);
if
(
pbindopts
==
NULL
)
return
E_POINTER
;
cbStruct
=
pbindopts
->
cbStruct
;
if
(
cbStruct
>
sizeof
(
BIND_OPTS2
))
cbStruct
=
sizeof
(
BIND_OPTS2
);
memcpy
(
pbindopts
,
&
This
->
bindOption2
,
cbStruct
);
pbindopts
->
cbStruct
=
cbStruct
;
size
=
min
(
pbindopts
->
cbStruct
,
sizeof
(
This
->
options
));
memcpy
(
pbindopts
,
&
This
->
options
,
size
);
pbindopts
->
cbStruct
=
size
;
return
S_OK
;
}
...
...
@@ -520,16 +517,11 @@ static HRESULT BindCtxImpl_Construct(BindCtxImpl* This)
This
->
IBindCtx_iface
.
lpVtbl
=
&
VT_BindCtxImpl
;
This
->
ref
=
0
;
/* Initialize the BIND_OPTS2 structure */
This
->
bindOption2
.
cbStruct
=
sizeof
(
BIND_OPTS2
);
This
->
bindOption2
.
grfFlags
=
0
;
This
->
bindOption2
.
grfMode
=
STGM_READWRITE
;
This
->
bindOption2
.
dwTickCountDeadline
=
0
;
This
->
bindOption2
.
dwTrackFlags
=
0
;
This
->
bindOption2
.
dwClassContext
=
CLSCTX_SERVER
;
This
->
bindOption2
.
locale
=
GetThreadLocale
();
This
->
bindOption2
.
pServerInfo
=
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
;
...
...
dlls/ole32/tests/moniker.c
View file @
89ef98ab
...
...
@@ -1888,7 +1888,7 @@ static void test_bind_context(void)
HRESULT
hr
;
IBindCtx
*
pBindCtx
;
IEnumString
*
pEnumString
;
BIND_OPTS
2
bind_opts
;
BIND_OPTS
3
bind_opts
;
HeapUnknown
*
unknown
;
HeapUnknown
*
unknown2
;
IUnknown
*
param_obj
;
...
...
@@ -1908,19 +1908,20 @@ static void test_bind_context(void)
bind_opts
.
cbStruct
=
-
1
;
hr
=
IBindCtx_GetBindOptions
(
pBindCtx
,
(
BIND_OPTS
*
)
&
bind_opts
);
ok_ole_success
(
hr
,
"IBindCtx_GetBindOptions"
);
ok
(
bind_opts
.
cbStruct
==
sizeof
(
bind_opts
)
||
bind_opts
.
cbStruct
==
sizeof
(
bind_opts
)
+
sizeof
(
void
*
),
/* Vista */
"bind_opts.cbStruct was %d
\n
"
,
bind_opts
.
cbStruct
);
ok
(
bind_opts
.
cbStruct
==
sizeof
(
BIND_OPTS3
)
||
broken
(
bind_opts
.
cbStruct
==
sizeof
(
BIND_OPTS2
))
/* XP */
,
"Unexpected bind_opts.cbStruct %d.
\n
"
,
bind_opts
.
cbStruct
);
bind_opts
.
cbStruct
=
sizeof
(
BIND_OPTS
);
hr
=
IBindCtx_GetBindOptions
(
pBindCtx
,
(
BIND_OPTS
*
)
&
bind_opts
);
ok_ole_success
(
hr
,
"IBindCtx_GetBindOptions"
);
ok
(
bind_opts
.
cbStruct
==
sizeof
(
BIND_OPTS
),
"bind_opts.cbStruct was %d
\n
"
,
bind_opts
.
cbStruct
);
memset
(
&
bind_opts
,
0xfe
,
sizeof
(
bind_opts
));
bind_opts
.
cbStruct
=
sizeof
(
bind_opts
);
hr
=
IBindCtx_GetBindOptions
(
pBindCtx
,
(
BIND_OPTS
*
)
&
bind_opts
);
ok_ole_success
(
hr
,
"IBindCtx_GetBindOptions"
);
ok
(
bind_opts
.
cbStruct
==
sizeof
(
bind_opts
),
"bind_opts.cbStruct was %d
\n
"
,
bind_opts
.
cbStruct
);
ok
(
bind_opts
.
cbStruct
==
sizeof
(
bind_opts
)
||
bind_opts
.
cbStruct
==
sizeof
(
BIND_OPTS2
)
/* XP */
,
"Unexpected bind_opts.cbStruct %d.
\n
"
,
bind_opts
.
cbStruct
);
ok
(
bind_opts
.
grfFlags
==
0
,
"bind_opts.grfFlags was 0x%x instead of 0
\n
"
,
bind_opts
.
grfFlags
);
ok
(
bind_opts
.
grfMode
==
STGM_READWRITE
,
"bind_opts.grfMode was 0x%x instead of STGM_READWRITE
\n
"
,
bind_opts
.
grfMode
);
ok
(
bind_opts
.
dwTickCountDeadline
==
0
,
"bind_opts.dwTickCountDeadline was %d instead of 0
\n
"
,
bind_opts
.
dwTickCountDeadline
);
...
...
@@ -1929,6 +1930,8 @@ static void test_bind_context(void)
"bind_opts.dwClassContext should have been 0x15 instead of 0x%x
\n
"
,
bind_opts
.
dwClassContext
);
ok
(
bind_opts
.
locale
==
GetThreadLocale
(),
"bind_opts.locale should have been 0x%x instead of 0x%x
\n
"
,
GetThreadLocale
(),
bind_opts
.
locale
);
ok
(
bind_opts
.
pServerInfo
==
NULL
,
"bind_opts.pServerInfo should have been NULL instead of %p
\n
"
,
bind_opts
.
pServerInfo
);
if
(
bind_opts
.
cbStruct
>=
sizeof
(
BIND_OPTS3
))
ok
(
bind_opts
.
hwnd
==
NULL
,
"Unexpected bind_opts.hwnd %p.
\n
"
,
bind_opts
.
hwnd
);
bind_opts
.
cbStruct
=
-
1
;
hr
=
IBindCtx_SetBindOptions
(
pBindCtx
,
(
BIND_OPTS
*
)
&
bind_opts
);
...
...
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