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
0c9205ad
Commit
0c9205ad
authored
Dec 17, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Add tests for system moniker identification queries.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b5c02b21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
3 deletions
+61
-3
moniker.c
dlls/ole32/tests/moniker.c
+61
-3
No files found.
dlls/ole32/tests/moniker.c
View file @
0c9205ad
...
...
@@ -31,6 +31,7 @@
#include "ocidl.h"
#include "comcat.h"
#include "olectl.h"
#include "initguid.h"
#include "wine/test.h"
...
...
@@ -62,6 +63,13 @@ static const CLSID CLSID_TestMoniker =
{
0xb9
,
0x3e
,
0x2f
,
0xf9
,
0xc8
,
0x32
,
0x23
,
0xd7
}
};
DEFINE_OLEGUID
(
CLSID_FileMoniker
,
0x303
,
0
,
0
);
DEFINE_OLEGUID
(
CLSID_ItemMoniker
,
0x304
,
0
,
0
);
DEFINE_OLEGUID
(
CLSID_AntiMoniker
,
0x305
,
0
,
0
);
DEFINE_OLEGUID
(
CLSID_CompositeMoniker
,
0x309
,
0
,
0
);
DEFINE_OLEGUID
(
CLSID_ClassMoniker
,
0x31a
,
0
,
0
);
DEFINE_OLEGUID
(
CLSID_PointerMoniker
,
0x306
,
0
,
0
);
static
LONG
cLocks
;
static
void
LockModule
(
void
)
...
...
@@ -1543,7 +1551,15 @@ static void test_class_moniker(void)
hr
=
CreateClassMoniker
(
&
CLSID_StdComponentCategoriesMgr
,
&
moniker
);
ok_ole_success
(
hr
,
CreateClassMoniker
);
if
(
!
moniker
)
return
;
hr
=
IMoniker_QueryInterface
(
moniker
,
&
CLSID_ClassMoniker
,
(
void
**
)
&
unknown
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
unknown
==
(
IUnknown
*
)
moniker
,
"Unexpected interface.
\n
"
);
IUnknown_Release
(
unknown
);
}
test_moniker
(
"class moniker"
,
moniker
,
expected_class_moniker_marshal_data
,
sizeof
(
expected_class_moniker_marshal_data
),
...
...
@@ -1603,11 +1619,21 @@ static void test_file_moniker(WCHAR* path)
{
IStream
*
stream
;
IMoniker
*
moniker1
=
NULL
,
*
moniker2
=
NULL
;
IUnknown
*
unk
;
HRESULT
hr
;
hr
=
CreateFileMoniker
(
path
,
&
moniker1
);
ok_ole_success
(
hr
,
CreateFileMoniker
);
hr
=
IMoniker_QueryInterface
(
moniker1
,
&
CLSID_FileMoniker
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
unk
==
(
IUnknown
*
)
moniker1
,
"Unexpected interface.
\n
"
);
IUnknown_Release
(
unk
);
}
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
ok_ole_success
(
hr
,
CreateStreamOnHGlobal
);
...
...
@@ -1719,6 +1745,15 @@ static void test_item_moniker(void)
hr
=
CreateItemMoniker
(
NULL
,
wszObjectName
,
&
moniker
);
ok
(
hr
==
S_OK
,
"Failed to create item moniker, hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_QueryInterface
(
moniker
,
&
CLSID_ItemMoniker
,
(
void
**
)
&
unknown
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
unknown
==
(
IUnknown
*
)
moniker
,
"Unexpected interface.
\n
"
);
IUnknown_Release
(
unknown
);
}
test_moniker
(
"item moniker 2"
,
moniker
,
expected_item_moniker_marshal_data2
,
sizeof
(
expected_item_moniker_marshal_data2
),
expected_item_moniker_saved_data2
,
sizeof
(
expected_item_moniker_saved_data2
),
...
...
@@ -1860,7 +1895,15 @@ static void test_anti_moniker(void)
hr
=
CreateAntiMoniker
(
&
moniker
);
ok_ole_success
(
hr
,
CreateAntiMoniker
);
if
(
!
moniker
)
return
;
hr
=
IMoniker_QueryInterface
(
moniker
,
&
CLSID_AntiMoniker
,
(
void
**
)
&
unknown
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
unknown
==
(
IUnknown
*
)
moniker
,
"Unexpected interface.
\n
"
);
IUnknown_Release
(
unknown
);
}
test_moniker
(
"anti moniker"
,
moniker
,
expected_anti_moniker_marshal_data
,
sizeof
(
expected_anti_moniker_marshal_data
),
...
...
@@ -1932,6 +1975,13 @@ static void test_generic_composite_moniker(void)
hr
=
CreateGenericComposite
(
moniker1
,
moniker2
,
&
moniker
);
ok_ole_success
(
hr
,
CreateGenericComposite
);
/* Generic composite is special, as it does not addref in this case. */
hr
=
IMoniker_QueryInterface
(
moniker
,
&
CLSID_CompositeMoniker
,
(
void
**
)
&
unknown
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ok
(
unknown
==
(
IUnknown
*
)
moniker
,
"Unexpected interface.
\n
"
);
test_moniker
(
"generic composite moniker"
,
moniker
,
expected_gc_moniker_marshal_data
,
sizeof
(
expected_gc_moniker_marshal_data
),
expected_gc_moniker_saved_data
,
sizeof
(
expected_gc_moniker_saved_data
),
...
...
@@ -2007,7 +2057,15 @@ static void test_pointer_moniker(void)
hr
=
CreatePointerMoniker
((
IUnknown
*
)
&
Test_ClassFactory
,
&
moniker
);
ok_ole_success
(
hr
,
CreatePointerMoniker
);
if
(
!
moniker
)
return
;
hr
=
IMoniker_QueryInterface
(
moniker
,
&
CLSID_PointerMoniker
,
(
void
**
)
&
unknown
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
unknown
==
(
IUnknown
*
)
moniker
,
"Unexpected interface.
\n
"
);
IUnknown_Release
(
unknown
);
}
ok_more_than_one_lock
();
...
...
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