Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e14e464d
Commit
e14e464d
authored
Mar 09, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Mar 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add more tests of IBindCtx functions.
Add tests for IBindCtx::GetObjectParam, IBindCtx::RevokeObjectParam and IBindCtx::RevokeObjectBound.
parent
d0f75b59
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
bindctx.c
dlls/ole32/bindctx.c
+2
-0
moniker.c
dlls/ole32/tests/moniker.c
+34
-3
No files found.
dlls/ole32/bindctx.c
View file @
e14e464d
...
...
@@ -539,6 +539,8 @@ HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC * ppbc)
TRACE
(
"(%d,%p)
\n
"
,
reserved
,
ppbc
);
if
(
!
ppbc
)
return
E_INVALIDARG
;
*
ppbc
=
NULL
;
if
(
reserved
!=
0
)
...
...
dlls/ole32/tests/moniker.c
View file @
e14e464d
...
...
@@ -1444,8 +1444,13 @@ static void test_bind_context(void)
BIND_OPTS2
bind_opts
;
HeapUnknown
*
unknown
;
HeapUnknown
*
unknown2
;
IUnknown
*
param_obj
;
ULONG
refs
;
static
const
WCHAR
wszParamName
[]
=
{
'G'
,
'e'
,
'm'
,
'm'
,
'a'
,
0
};
static
const
WCHAR
wszNonExistant
[]
=
{
'N'
,
'o'
,
'n'
,
'E'
,
'x'
,
'i'
,
's'
,
't'
,
'a'
,
'n'
,
't'
,
0
};
hr
=
CreateBindCtx
(
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"CreateBindCtx with NULL ppbc should have returned E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
hr
=
CreateBindCtx
(
0xdeadbeef
,
&
pBindCtx
);
ok
(
hr
==
E_INVALIDARG
,
"CreateBindCtx with reserved value non-zero should have returned E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
...
...
@@ -1458,6 +1463,12 @@ static void test_bind_context(void)
ok_ole_success
(
hr
,
"IBindCtx_GetBindOptions"
);
ok
(
bind_opts
.
cbStruct
==
sizeof
(
bind_opts
),
"bind_opts.cbStruct was %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"
);
todo_wine
ok
(
bind_opts
.
cbStruct
==
sizeof
(
BIND_OPTS
),
"bind_opts.cbStruct was %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"
);
...
...
@@ -1469,7 +1480,6 @@ static void test_bind_context(void)
ok
(
bind_opts
.
dwClassContext
==
(
CLSCTX_INPROC_SERVER
|
CLSCTX_LOCAL_SERVER
|
CLSCTX_REMOTE_SERVER
),
"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
);
bind_opts
.
cbStruct
=
-
1
;
...
...
@@ -1479,12 +1489,23 @@ static void test_bind_context(void)
hr
=
IBindCtx_RegisterObjectParam
(
pBindCtx
,
(
WCHAR
*
)
wszParamName
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"IBindCtx_RegisterObjectParam should have returned E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
unknown
=
(
HeapUnknown
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
unknown
));
unknown
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
unknown
));
unknown
->
lpVtbl
=
&
HeapUnknown_Vtbl
;
unknown
->
refs
=
1
;
hr
=
IBindCtx_RegisterObjectParam
(
pBindCtx
,
(
WCHAR
*
)
wszParamName
,
(
IUnknown
*
)
&
unknown
->
lpVtbl
);
ok_ole_success
(
hr
,
"IBindCtx_RegisterObjectParam"
);
hr
=
IBindCtx_GetObjectParam
(
pBindCtx
,
(
WCHAR
*
)
wszParamName
,
&
param_obj
);
ok_ole_success
(
hr
,
"IBindCtx_GetObjectParam"
);
IUnknown_Release
(
param_obj
);
hr
=
IBindCtx_GetObjectParam
(
pBindCtx
,
(
WCHAR
*
)
wszNonExistant
,
&
param_obj
);
ok
(
hr
==
E_FAIL
,
"IBindCtx_GetObjectParam with non-existing key should have failed with E_FAIL instead of 0x%08x
\n
"
,
hr
);
ok
(
param_obj
==
NULL
,
"IBindCtx_GetObjectParam with non-existing key should have set output parameter to NULL instead of %p
\n
"
,
param_obj
);
hr
=
IBindCtx_RevokeObjectParam
(
pBindCtx
,
(
WCHAR
*
)
wszNonExistant
);
ok
(
hr
==
E_FAIL
,
"IBindCtx_RevokeObjectParam with non-existing key should have failed with E_FAIL instead of 0x%08x
\n
"
,
hr
);
hr
=
IBindCtx_EnumObjectParam
(
pBindCtx
,
&
pEnumString
);
ok
(
hr
==
E_NOTIMPL
,
"IBindCtx_EnumObjectParam should have returned E_NOTIMPL instead of 0x%08x
\n
"
,
hr
);
ok
(
!
pEnumString
,
"pEnumString should be NULL
\n
"
);
...
...
@@ -1493,12 +1514,22 @@ static void test_bind_context(void)
todo_wine
ok_ole_success
(
hr
,
"IBindCtx_RegisterObjectBound(NULL)"
);
unknown2
=
(
HeapUnknown
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
unknown
));
hr
=
IBindCtx_RevokeObjectBound
(
pBindCtx
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"IBindCtx_RevokeObjectBound(NULL) should have return E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
unknown2
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
unknown
));
unknown2
->
lpVtbl
=
&
HeapUnknown_Vtbl
;
unknown2
->
refs
=
1
;
hr
=
IBindCtx_RegisterObjectBound
(
pBindCtx
,
(
IUnknown
*
)
&
unknown2
->
lpVtbl
);
ok_ole_success
(
hr
,
"IBindCtx_RegisterObjectBound"
);
hr
=
IBindCtx_RevokeObjectBound
(
pBindCtx
,
(
IUnknown
*
)
&
unknown2
->
lpVtbl
);
ok_ole_success
(
hr
,
"IBindCtx_RevokeObjectBound"
);
hr
=
IBindCtx_RevokeObjectBound
(
pBindCtx
,
(
IUnknown
*
)
&
unknown2
->
lpVtbl
);
ok
(
hr
==
MK_E_NOTBOUND
,
"IBindCtx_RevokeObjectBound with not bound object should have returned MK_E_NOTBOUND instead of 0x%08x
\n
"
,
hr
);
IBindCtx_Release
(
pBindCtx
);
refs
=
IUnknown_Release
((
IUnknown
*
)
&
unknown
->
lpVtbl
);
...
...
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