Nikolay Sivov : scrrun: It' s not allowed to change compare mode when dictionary is not empty.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Feb 27 08:00:16 CST 2015
Module: wine
Branch: master
Commit: 778d4da2d9e9f899013ce52a2aa30ada263542ca
URL: http://source.winehq.org/git/wine.git/?a=commit;h=778d4da2d9e9f899013ce52a2aa30ada263542ca
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu Feb 26 17:27:02 2015 +0300
scrrun: It's not allowed to change compare mode when dictionary is not empty.
---
dlls/scrrun/dictionary.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/scrrun/dictionary.c b/dlls/scrrun/dictionary.c
index a33e1de..958d7fc 100644
--- a/dlls/scrrun/dictionary.c
+++ b/dlls/scrrun/dictionary.c
@@ -41,6 +41,7 @@ typedef struct
LONG ref;
CompareMethod method;
+ LONG count;
} dictionary;
static inline dictionary *impl_from_IDictionary(IDictionary *iface)
@@ -200,14 +201,13 @@ static HRESULT WINAPI dictionary_Add(IDictionary *iface, VARIANT *Key, VARIANT *
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);
- FIXME("(%p)->(%p)\n", This, pCount);
-
- *pCount = 0;
+ TRACE("(%p)->(%p)\n", This, count);
+ *count = This->count;
return S_OK;
}
@@ -271,6 +271,9 @@ static HRESULT WINAPI dictionary_put_CompareMode(IDictionary *iface, CompareMeth
TRACE("(%p)->(%d)\n", This, method);
+ if (This->count)
+ return CTL_E_ILLEGALFUNCTIONCALL;
+
This->method = method;
return S_OK;
}
@@ -411,6 +414,7 @@ HRESULT WINAPI Dictionary_CreateInstance(IClassFactory *factory,IUnknown *outer,
This->IDictionary_iface.lpVtbl = &dictionary_vtbl;
This->ref = 1;
This->method = BinaryCompare;
+ This->count = 0;
*obj = &This->IDictionary_iface;
More information about the wine-cvs
mailing list