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
075fe10b
Commit
075fe10b
authored
Feb 24, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Store compare method for dictionary.
parent
a8b000c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
12 deletions
+61
-12
dictionary.c
dlls/scrrun/dictionary.c
+11
-7
dictionary.c
dlls/scrrun/tests/dictionary.c
+50
-5
No files found.
dlls/scrrun/dictionary.c
View file @
075fe10b
...
...
@@ -34,8 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun);
typedef
struct
{
IDictionary
IDictionary_iface
;
LONG
ref
;
CompareMethod
method
;
}
dictionary
;
static
inline
dictionary
*
impl_from_IDictionary
(
IDictionary
*
iface
)
...
...
@@ -260,22 +261,24 @@ static HRESULT WINAPI dictionary_RemoveAll(IDictionary *iface)
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dictionary_put_CompareMode
(
IDictionary
*
iface
,
CompareMethod
pcomp
)
static
HRESULT
WINAPI
dictionary_put_CompareMode
(
IDictionary
*
iface
,
CompareMethod
method
)
{
dictionary
*
This
=
impl_from_IDictionary
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
method
);
return
E_NOTIMPL
;
This
->
method
=
method
;
return
S_OK
;
}
static
HRESULT
WINAPI
dictionary_get_CompareMode
(
IDictionary
*
iface
,
CompareMethod
*
pcomp
)
static
HRESULT
WINAPI
dictionary_get_CompareMode
(
IDictionary
*
iface
,
CompareMethod
*
method
)
{
dictionary
*
This
=
impl_from_IDictionary
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pcomp
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
method
);
return
E_NOTIMPL
;
*
method
=
This
->
method
;
return
S_OK
;
}
static
HRESULT
WINAPI
dictionary__NewEnum
(
IDictionary
*
iface
,
IUnknown
**
ppunk
)
...
...
@@ -336,6 +339,7 @@ HRESULT WINAPI Dictionary_CreateInstance(IClassFactory *factory,IUnknown *outer,
This
->
IDictionary_iface
.
lpVtbl
=
&
dictionary_vtbl
;
This
->
ref
=
1
;
This
->
method
=
BinaryCompare
;
*
obj
=
&
This
->
IDictionary_iface
;
...
...
dlls/scrrun/tests/dictionary.c
View file @
075fe10b
...
...
@@ -44,10 +44,7 @@ static void test_interfaces(void)
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Could not create FileSystem object: %08x
\n
"
,
hr
);
return
;
}
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantInit
(
&
key
);
VariantInit
(
&
value
);
...
...
@@ -91,12 +88,60 @@ static void test_interfaces(void)
IDispatch_Release
(
disp
);
}
static
void
test_comparemode
(
void
)
{
CompareMethod
method
;
IDictionary
*
dict
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDictionary
,
(
void
**
)
&
dict
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
0
)
/* crashes on native */
hr
=
IDictionary_get_CompareMode
(
dict
,
NULL
);
method
=
10
;
hr
=
IDictionary_get_CompareMode
(
dict
,
&
method
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
method
==
BinaryCompare
,
"got %d
\n
"
,
method
);
/* invalid mode value is not checked */
hr
=
IDictionary_put_CompareMode
(
dict
,
10
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDictionary_get_CompareMode
(
dict
,
&
method
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
method
==
10
,
"got %d
\n
"
,
method
);
hr
=
IDictionary_put_CompareMode
(
dict
,
DatabaseCompare
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDictionary_get_CompareMode
(
dict
,
&
method
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
method
==
DatabaseCompare
,
"got %d
\n
"
,
method
);
IDictionary_Release
(
dict
);
}
START_TEST
(
dictionary
)
{
IDispatch
*
disp
;
HRESULT
hr
;
CoInitialize
(
NULL
);
test_interfaces
();
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Dictionary object is not supported: %08x
\n
"
,
hr
);
CoUninitialize
();
return
;
}
IDispatch_Release
(
disp
);
test_interfaces
();
test_comparemode
();
CoUninitialize
();
}
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