Commit 778d4da2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

scrrun: It's not allowed to change compare mode when dictionary is not empty.

parent 94e5353f
...@@ -41,6 +41,7 @@ typedef struct ...@@ -41,6 +41,7 @@ typedef struct
LONG ref; LONG ref;
CompareMethod method; CompareMethod method;
LONG count;
} dictionary; } dictionary;
static inline dictionary *impl_from_IDictionary(IDictionary *iface) static inline dictionary *impl_from_IDictionary(IDictionary *iface)
...@@ -200,14 +201,13 @@ static HRESULT WINAPI dictionary_Add(IDictionary *iface, VARIANT *Key, VARIANT * ...@@ -200,14 +201,13 @@ static HRESULT WINAPI dictionary_Add(IDictionary *iface, VARIANT *Key, VARIANT *
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI dictionary_get_Count(IDictionary *iface, LONG *pCount) static HRESULT WINAPI dictionary_get_Count(IDictionary *iface, LONG *count)
{ {
dictionary *This = impl_from_IDictionary(iface); dictionary *This = impl_from_IDictionary(iface);
FIXME("(%p)->(%p)\n", This, pCount); TRACE("(%p)->(%p)\n", This, count);
*pCount = 0;
*count = This->count;
return S_OK; return S_OK;
} }
...@@ -271,6 +271,9 @@ static HRESULT WINAPI dictionary_put_CompareMode(IDictionary *iface, CompareMeth ...@@ -271,6 +271,9 @@ static HRESULT WINAPI dictionary_put_CompareMode(IDictionary *iface, CompareMeth
TRACE("(%p)->(%d)\n", This, method); TRACE("(%p)->(%d)\n", This, method);
if (This->count)
return CTL_E_ILLEGALFUNCTIONCALL;
This->method = method; This->method = method;
return S_OK; return S_OK;
} }
...@@ -411,6 +414,7 @@ HRESULT WINAPI Dictionary_CreateInstance(IClassFactory *factory,IUnknown *outer, ...@@ -411,6 +414,7 @@ HRESULT WINAPI Dictionary_CreateInstance(IClassFactory *factory,IUnknown *outer,
This->IDictionary_iface.lpVtbl = &dictionary_vtbl; This->IDictionary_iface.lpVtbl = &dictionary_vtbl;
This->ref = 1; This->ref = 1;
This->method = BinaryCompare; This->method = BinaryCompare;
This->count = 0;
*obj = &This->IDictionary_iface; *obj = &This->IDictionary_iface;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment